Goherr: Fish consumption study: Difference between revisions
Line 458: | Line 458: | ||
* Model run 9.8.2018 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=r3UiLe8x2sRz8DpR] | * Model run 9.8.2018 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=r3UiLe8x2sRz8DpR] | ||
* Model run 12.8.2018 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=zZWea5znWTliAEHo] | * Model run 12.8.2018 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=zZWea5znWTliAEHo] | ||
* Model run 12.9.2018 with country-specific regression analyses, open-ended asnwers and fig about eating any herring [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=NXPWgpgTJDSGl7F4] | |||
<rcode graphics=1> | <rcode graphics=1> | ||
Line 481: | Line 482: | ||
return(o) | return(o) | ||
} | } | ||
#' @title reasons produces a ggplot object for a graph that shows fractions of reasons mentioned in the data. | |||
#' @param dat a data.frame containing survey answers for the target subgroup. | |||
#' @param title an atomic string with the name to be shown as the title of graph | |||
reasons <- function( | reasons <- function( | ||
dat, | dat, | ||
title | title | ||
) { | ) { | ||
weight <- Ovariable("weight",data=data.frame( | weight <- Ovariable("weight",data=data.frame( | ||
Line 502: | Line 507: | ||
tmp$Result <- (tmp$Result %in% c("Yes","1"))*1 | tmp$Result <- (tmp$Result %in% c("Yes","1"))*1 | ||
tmp <- weight * (Ovariable("tmp",data=tmp)) | tmp <- weight * (Ovariable("tmp",data=tmp)) | ||
cat(title, "\n") | cat(title, ": number of individual answers.\n") | ||
oprint(oapply(tmp, c("tmpResult","Country"),length)@output) | oprint(oapply(tmp, c("tmpResult","Country"),length)@output) | ||
Line 510: | Line 515: | ||
tmp$Reason <- factor(tmp$Reason, levels=popu) | tmp$Reason <- factor(tmp$Reason, levels=popu) | ||
levels(tmp$Reason) <- gsub("( BH| BS)", "", gsub("\\.", " ", levels(tmp$Reason))) | levels(tmp$Reason) <- gsub("( BH| BS)", "", gsub("\\.", " ", levels(tmp$Reason))) | ||
cat(title, ": fractions shown on graph.\n") | |||
oprint(tmp@output) | |||
tmp <- ggplot(tmp@output, aes(x=Reason, y=Result,colour=Country, group=Country))+ | tmp <- ggplot(tmp@output, aes(x=Reason, y=Result,colour=Country, group=Country))+ | ||
Line 645: | Line 652: | ||
scale_y_continuous(labels=scales::percent_format())+ | scale_y_continuous(labels=scales::percent_format())+ | ||
labs(title="Fraction of fish eaters within the study population") | labs(title="Fraction of fish eaters within the study population") | ||
############## Answers to open questions | |||
cat("Number of open-ended answers per question and country\n") | |||
tmp <- survey1[c(1,3,27:28,36:37,44:45,60:61,71:72,83:84,93:94,109:110,121:122,133:134,154,157:158)] | |||
tmp <- reshape( | |||
tmp, | |||
varying=list( | |||
Condition = colnames(tmp)[grepl("other",tolower(colnames(tmp)))], | |||
Text = colnames(tmp)[grepl("open",colnames(tmp))] | |||
), | |||
times = colnames(tmp)[grepl("other",tolower(colnames(tmp)))], | |||
direction="long" | |||
) | |||
tmp <- tmp[tmp$Why.not.fish.open!="" , ] | |||
oprint(table(tmp$time,tmp$Country)) | |||
oprint(tmp) | |||
#### Baltic salmon | #### Baltic salmon | ||
Line 660: | Line 684: | ||
"Reasons to eat among Baltic salmon consumers" | "Reasons to eat among Baltic salmon consumers" | ||
) | ) | ||
reasons( | reasons( | ||
survey1[survey1$Baltic.salmon=="No"& !is.na(survey1$Baltic.salmon),c(1,62: | survey1[survey1$Baltic.salmon=="No"& !is.na(survey1$Baltic.salmon),c(1,62:70,154,157)], # 1 Country, 18 Why not Baltic salmon | ||
"Reasons not to eat among Baltic salmon non-consumers" | "Reasons not to eat among Baltic salmon non-consumers" | ||
) | ) | ||
Line 669: | Line 694: | ||
"Effect on Baltic salmon consumption" | "Effect on Baltic salmon consumption" | ||
) | ) | ||
####### Any herring | |||
ggplot(survey1, | |||
aes(x=Country, weight=Weighting, fill=Eat.herring))+geom_bar(position="fill")+ | |||
coord_flip()+#facet_grid(.~Country)+ | |||
theme_gray(base_size=BS)+ | |||
theme(legend.position = "bottom")+ | |||
scale_y_continuous(labels=scales::percent_format())+ | |||
# scale_fill_manual(values=c("Grey","Green","Yellow","Red"))+ | |||
labs(title="Any herring consumption") | |||
####### Baltic herring | ####### Baltic herring | ||
Line 797: | Line 833: | ||
###################### Logistic regression | ###################### Logistic regression | ||
cat("What explains whether people eat fish at all?\n") | cat("###################### What explains whether people eat fish at all?\n") | ||
fit <- glm(Eat.fish ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | fit <- glm(Eat.fish ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | ||
oprint(summary(fit)) | oprint(summary(fit)) | ||
Line 803: | Line 839: | ||
oprint(step$anova) | oprint(step$anova) | ||
cat("What explains whether people eat any herring?\n") | for(i in unique(dat$Country)) { | ||
cat("\n#### Country-specific regression analysis:", i, "\n") | |||
fit <- glm(Eat.fish ~ Ages + Gender + Education + Purchasing.power, family=binomial(), | |||
data=dat[dat$Iter==1 & dat$Country==i,]) | |||
oprint(summary(fit)) | |||
step <- stepAIC(fit, direction = "both") | |||
oprint(step$anova) | |||
} | |||
cat("###################### What explains whether people eat any herring?\n") | |||
fit <- glm(Eat.herring ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | fit <- glm(Eat.herring ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | ||
oprint(summary(fit)) | oprint(summary(fit)) | ||
Line 809: | Line 854: | ||
oprint(step$anova) | oprint(step$anova) | ||
cat("What explains whether people eat Baltic herring?\n") | for(i in unique(dat$Country)) { | ||
cat("\n#### Country-specific regression analysis:", i, "\n") | |||
fit <- glm(Eat.herring ~ Ages + Gender + Education + Purchasing.power, family=binomial(), | |||
data=dat[dat$Iter==1 & dat$Country==i,]) | |||
oprint(summary(fit)) | |||
step <- stepAIC(fit, direction = "both") | |||
oprint(step$anova) | |||
} | |||
cat("###################### What explains whether people eat Baltic herring?\n") | |||
fit <- glm(Eat.BH ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | fit <- glm(Eat.BH ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | ||
oprint(summary(fit)) | oprint(summary(fit)) | ||
Line 815: | Line 869: | ||
oprint(step$anova) | oprint(step$anova) | ||
for(i in unique(dat$Country)) { | |||
cat("\n#### Country-specific regression analysis:", i, "\n") | |||
fit <- glm(Eat.BH ~ Ages + Gender + Education + Purchasing.power, family=binomial(), | |||
data=dat[dat$Iter==1 & dat$Country==i,]) | |||
oprint(summary(fit)) | |||
step <- stepAIC(fit, direction = "both") | |||
oprint(step$anova) | |||
} | |||
cat("###################### What explains whether people eat any salmon?\n") | |||
fit <- glm(Eat.salmon ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | fit <- glm(Eat.salmon ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | ||
oprint(summary(fit)) | oprint(summary(fit)) | ||
Line 820: | Line 884: | ||
oprint(step$anova) | oprint(step$anova) | ||
for(i in unique(dat$Country)) { | |||
cat("\n#### Country-specific regression analysis:", i, "\n") | |||
fit <- glm(Eat.salmon ~ Ages + Gender + Education + Purchasing.power, family=binomial(), | |||
data=dat[dat$Iter==1 & dat$Country==i,]) | |||
oprint(summary(fit)) | |||
step <- stepAIC(fit, direction = "both") | |||
oprint(step$anova) | |||
} | |||
cat("###################### What explains whether people eat Baltic salmon?\n") | |||
fit <- glm(Baltic.salmon ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | fit <- glm(Baltic.salmon ~ Ages + Gender + Country + Education + Purchasing.power, family=binomial(),data=dat[dat$Iter==1,]) | ||
oprint(summary(fit)) | oprint(summary(fit)) | ||
step <- stepAIC(fit, direction = "both") | step <- stepAIC(fit, direction = "both") | ||
oprint(step$anova) | oprint(step$anova) | ||
for(i in unique(dat$Country)) { | |||
cat("\n#### Country-specific regression analysis:", i, "\n") | |||
fit <- glm(Baltic.salmon ~ Ages + Gender + Education + Purchasing.power, family=binomial(), | |||
data=dat[dat$Iter==1 & dat$Country==i,]) | |||
oprint(summary(fit)) | |||
step <- stepAIC(fit, direction = "both") | |||
oprint(step$anova) | |||
} | |||
</rcode> | </rcode> | ||
Revision as of 13:20, 12 September 2018
[show] This page is a study.
The page identifier is Op_en7749 |
---|
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
Original questionnaire analysis results
- 13.3.2017 ----#: . These should be presented somewhere --Arja (talk) 07:39, 26 April 2017 (UTC) (type: truth; paradigms: science: comment)
Consumption amount estimates
- Model run 21.4.2017 [1] first distribution
- Model run 18.5.2017 with modelled data; with direct survey data
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 can be found from the link below (see Data).
Data
Questionnaire
Original datafile File:Goherr fish consumption.csv.
[show]Show details |
---|
Assumptions
The following assumptions are used:
Obs | Variable | Value | Unit | Result | Description |
---|---|---|---|---|---|
1 | freq | 1 | times /a | 0 | Never |
2 | freq | 2 | times /a | 0.5 - 0.9 | less than once a year |
3 | freq | 3 | times /a | 2 - 5 | A few times a year |
4 | freq | 4 | times /a | 12 - 36 | 1 - 3 times per month |
5 | freq | 5 | times /a | 52 | once a week |
6 | freq | 6 | times /a | 104 - 208 | 2 - 4 times per week |
7 | freq | 7 | times /a | 260 - 364 | 5 or more times per week |
8 | amdish | 1 | g /serving | 20 - 70 | 1/6 plate or below (50 grams) |
9 | amdish | 2 | g /serving | 70 - 130 | 1/3 plate (100 grams) |
10 | amdish | 3 | g /serving | 120 - 180 | 1/2 plate (150 grams) |
11 | amdish | 4 | g /serving | 170 - 230 | 2/3 plate (200 grams) |
12 | amdish | 5 | g /serving | 220 - 280 | 5/6 plate (250 grams) |
13 | amdish | 6 | g /serving | 270 - 400 | full plate (300 grams) |
14 | amdish | 7 | g /serving | 400 - 550 | overly full plate (500 grams) |
15 | ingredient | fraction | 0.1 - 0.3 | Fraction of fish in the dish | |
16 | amside | 1 | g /serving | 20 - 70 | 1/6 plate or below (50 grams) |
17 | amside | 2 | g /serving | 70 - 130 | 1/4 plate (100 grams) |
18 | amside | 3 | g /serving | 120 - 180 | 1/2 plate (150 grams) |
19 | amside | 4 | g /serving | 170 - 230 | 2/3 plate (200 grams) |
20 | amside | 5 | g /serving | 220 - 280 | 5/6 plate (250 grams) |
21 | change | 1 | fraction | -1 - -0.8 | Decrease it to zero |
22 | change | 2 | fraction | -0.9 - -0.5 | Decrease it to less than half |
23 | change | 3 | fraction | -0.6 - -0.1 | Decrease it a bit |
24 | change | 4 | fraction | 0 | No effect |
25 | change | 5 | fraction | 0.1 - 0.6 | Increase it a bit |
26 | change | 6 | fraction | 0.5 - 0.9 | Increase it over by half |
27 | change | 7 | fraction | 0.8 - 1.3 | Increase it over to double |
28 | change | 8 | fraction | -0.3 - 0.3 | Don't know |
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.
- Model run 11.7.2018 [2]
Analyses
- Sketches about modelling determinants of eating (spring 2018) [3]
Figures, tables and stat analyses for the first manuscript
- Model run 15.6.2018 [4]
- Model run 16.6.2018 [5]
- Model run 20.6.2018 [6]
- Model run 11.7.2018 [7]
- Model run 9.8.2018 [8]
- Model run 12.8.2018 [9]
- Model run 12.9.2018 with country-specific regression analyses, open-ended asnwers and fig about eating any herring [10]
Descriptive statistics

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
Model runs
- Model run 13.3.2017
- Model run 21.4.2017 [11] old code from Answer merged to this code and debugged
Bayes model
- Model run 3.3.2017. All variables assumed independent. [12]
- Model run 3.3.2017. p has more dimensions. [13]
- Model run 25.3.2017. Several model versions: strange binomial+multivarnormal, binomial, fractalised multivarnormal [14]
- Model run 27.3.2017 [15]
- Other models except multivariate normal were archived and removed from active code 29.3.2017.
- Model run 29.3.2017 with raw data graphs [16]
- Model run 29.3.2017 with salmon and herring ovariables stored [17]
- Model run 13.4.2017 with first version of coordinate matrix and principal coordinate analysis [18]
- Model run 20.4.2017 [19] code works but needs a safety check against outliers
- Model run 21.4.2017 [20] some model results plotted
- Model run 21.4.2017 [21] ovariables produced by the model stored.
- Model run 18.5.2017 [22] small updates
- 13.2.2018 old model run but with new Opasnet [23]
Initiate ovariables
jsp taken directly from data WITHOUT salmpling.
Amount estimated from a bayesian model.
- Model run 24.5.2017 [24]
Amount estimates directly from data rather than from a bayesian model.
- Initiation run 18.5.2017 [25]
- Initiation run 24.2.2018: sampling from survey rather than each respondent once [26]
Initiate other ovariables
- Code stores ovariables assump, often, much, oftenside, muchside, amount.
- Model run 19.5.2017 [27]
- Initiation run 24.5.2017 without jsp [28]
- Model run 8.6.2017 [29]
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.
See also
- Useful information about Wishart distribution and related topics:
Keywords
References
Related files