Difference between revisions of "Goherr: Fish consumption study"
(→Bayes model) |
(→Preprocessing: surv preprocessing added) |
||
Line 85: | Line 85: | ||
This code is used to preprocess the original questionnaire data from the above .csv file and to store the data as a usable variable to Opasnet base. The code stores a data.frame named survey. | This code is used to preprocess the original questionnaire data from the above .csv file and to store the data as a usable variable to Opasnet base. The code stores a data.frame named survey. | ||
* Model run 13.4.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=1QsyOMpBHrvY0H2o] | * Model run 13.4.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=1QsyOMpBHrvY0H2o] | ||
+ | * Model run 20.4.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=JuLynAzoCuvu0U3g] (contains surv and helping vectors) | ||
<rcode name="preprocess2" label="Preprocess (only for developers)"> | <rcode name="preprocess2" label="Preprocess (only for developers)"> | ||
Line 174: | Line 175: | ||
oprint(head(survey)) | oprint(head(survey)) | ||
− | objects.store(survey) | + | agel <- as.character(unique(survey$Ages)) |
− | cat("Data. | + | countryl <- sort(as.character(unique(survey$Country))) |
+ | genderl <- sort(as.character(unique(survey$Gender))) | ||
+ | fisl <- c("Salmon", "Herring") | ||
+ | |||
+ | # Interesting fish eating questions | ||
+ | surv <- survey[c(1,3,158,16,29,30,31,46:49,86,95:98)] | ||
+ | colnames(surv) | ||
+ | #[1] "Country" "Gender" | ||
+ | #[3] "Ages" "Fish eating" | ||
+ | #[5] "How often eat fish" "Salmon eating" | ||
+ | #[7] "Baltic salmon" "How often Baltic salmon" | ||
+ | #[9] "How much Baltic salmon" "How often side Baltic salmon" | ||
+ | #[11] "How much side Baltic salmon" "Eat Baltic herring" | ||
+ | #[13] "How often Baltic herring" "How much Baltic herring" | ||
+ | #[15] "How often side Baltic herring" "How much side Baltic herring" | ||
+ | |||
+ | # For estimating distributions, we should | ||
+ | #1 remove people with Fish eating = No (142) | ||
+ | #2 merge Eat Baltic herring = I don't know with No (How often BH = NA always) | ||
+ | #3 merge Baltic salmon = NA with No (because they usually have answered BH questions) | ||
+ | |||
+ | oprint(table(is.na(rowSums(sapply(surv[4:16], as.numeric))))) | ||
+ | # BUT: there are so many missing values, that we just model BH and BS separately now. | ||
+ | |||
+ | surv <- as.data.frame(lapply(surv, FUN = function(x) as.integer(x))) # Coerce to integers | ||
+ | surv[is.na(surv[[12]]) | surv[[12]] == 3 , 12] <- 1 # Eat Baltic herring: I don't know --> No | ||
+ | |||
+ | # Row numbers for respondents that have eaten fish, Baltic salmon, and Baltic herring | ||
+ | eatfish <- surv[[4]] %in% 1 | ||
+ | eatsalm <- !(surv[[7]] %in% 0 | is.na(rowSums(surv[7:11]))) | ||
+ | eatherr <- surv[[12]] %in% 1 & !is.na(rowSums(surv[13:16])) | ||
+ | |||
+ | # Oletetaan, että covarianssimatriisi on vakio kaikille maille ja sukupuolille yms | ||
+ | # mutta keskiarvo on spesifi näille ja kysymykselle. | ||
+ | |||
+ | #qlen <- c(4,2,2,2,6,2,2,7,7,7,5,2,7,7,7,5) # Number of options in each question | ||
+ | # qlen not needed when dbinom is not used. | ||
+ | |||
+ | agel | ||
+ | countryl | ||
+ | genderl | ||
+ | fisl | ||
+ | |||
+ | objects.store(survey, surv, agel, countryl, genderl, fisl, eatfish, eatsalm, eatherr) | ||
+ | cat("Data.frames survey and surv, and vectors agel, countryl, genderl, fisl, eatfish, eatsalm, eatherr were stored.\n") | ||
</rcode> | </rcode> | ||
Revision as of 13:33, 20 April 2017
This page is a variable.
The page identifier is Op_en7749 |
---|
Moderator:Arja (see all) |
This page is a stub. You may improve it into a full page, and then a rating bar will appear here. |
Upload data
|
Contents
Question
How Baltic herring and salmon are used as human food in Baltic sea countries? Which determinants affect on people’s eating habits of these fish species?
Answer
Survey data will be analysed during winter 2016-2017 and results will be updated here.
Rationale
Survey of eating habits of Baltic herring and salmon in Denmark, Estonia, Finland and Sweden has been done in September 2016 by Taloustutkimus oy. Content of the questionnaire can be accessed in Google drive. The actual data will be uploaded to Opasnet base on Octobere 2016.
The R-code to analyse the survey data will be provided on this page later on.
Data
Original datafile File:Goherr fish consumption.csv
Preprocessing
This code is used to preprocess the original questionnaire data from the above .csv file and to store the data as a usable variable to Opasnet base. The code stores a data.frame named survey.
Analyses
Model must contain predictors such as country, gender, age etc. Maybe we should first study what determinants are important? Model must also contain determinants that would increase or decrease fish consumption. This should be conditional on the current consumption. How? Maybe we should look at principal coordinates analysis with all questions to see how they behave.
Also look at correlation table to see clusters.
Some obvious results:
- If reports no fish eating, many subsequent answers are NA.
- No vitamins correlates negatively with vitamin intake.
- Unknown salmon correlates negatively with the types of salmon eaten.
- Different age categories correlate with each other.
However, there are also meaningful negative correlations:
- Country vs allergy
- Country vs Norwegian salmon and Rainbow trout
- Country vs not traditional.
- Country vs recommendation awareness
- Allergy vs economic wellbeing
- Baltic salmon use (4 questions) vs Don't like taste and Not used to
- All questions between Easy to cook ... Traditional dish
Meaningful positive correlations:
- All questions between Baltic salmon ... Rainbow trout
- How often Baltic salmon/herring/side salmon/side herring
- How much Baltic salmon/herring/side salmon/side herring
- Better availability ... Recommendation
- All questions between Economic wellbeing...Personal aims
- Omega3, Vitamin D, and Other vitamins
Study plan:
- Determinants
Bayes model
- Model run 3.3.2017. All variables assumed independent. [3]
- Model run 3.3.2017. p has more dimensions. [4]
- Model run 25.3.2017. Several model versions: strange binomial+multivarnormal, binomial, fractalised multivarnormal [5]
- Model run 27.3.2017 [6]
- Other models except multivariate normal were archived and removed from active code 29.3.2017.
- Model run 29.3.2017 with raw data graphs [7]
- Model run 29.3.2017 with salmon and herring ovariables stored [8]
- Model run 13.4.2017 with first version of coordinate matrix and principal coordinate analysis [9]
Calculations
This code calculates how much (g/day) Baltic herring and salmon are eaten based on an Bayesian model build up based on the questionnaire data.
Assumptions
The following assumptions are used:
Obs | Variable | value | Explanation | Result |
---|---|---|---|---|
1 | freq | 6 | times per year | 260 - 364 |
2 | freq | 5 | times per year | 104 - 208 |
3 | freq | 4 | times per year | 52 |
4 | freq | 3 | times per year | 12 - 36 |
5 | freq | 2 | times per year | 2 - 5 |
6 | freq | 1 | times per year | 0.5 - 0.9 |
7 | freq | 0 | times per year | 0 |
8 | amdish | 0 | grams / serving | 20 - 50 |
9 | amdish | 1 | grams / serving | 70 - 100 |
10 | amdish | 2 | grams / serving | 120 - 150 |
11 | amdish | 3 | grams / serving | 170 - 200 |
12 | amdish | 4 | grams / serving | 220 - 250 |
13 | amdish | 5 | grams / serving | 270 - 300 |
14 | amdish | 6 | grams / serving | 450 - 500 |
15 | ingridient | fraction | 0.1 - 0.3 | |
16 | amside | 0 | grams / serving | 20 - 50 |
17 | amside | 1 | grams / serving | 70 - 100 |
18 | amside | 2 | grams / serving | 120 - 150 |
19 | amside | 3 | grams / serving | 170 - 200 |
20 | amside | 4 | grams / serving | 220 - 250 |
Questionnaire
Show details | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Dependencies
The survey data will be used as input in the benefit-risk assessment of Baltic herring and salmon intake, which is part of the WP5 work in Goherr-project.
Formula
See also
- Useful information about Wishart distribution and related topics:
Keywords
References
Related files
<mfanonymousfilelist></mfanonymousfilelist>