Goherr: Fish consumption study: Difference between revisions

From Opasnet
Jump to navigation Jump to search
Line 461: Line 461:
* Model run 5.2.2019 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=uHmMkAcFTNeMeipn]
* Model run 5.2.2019 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=uHmMkAcFTNeMeipn]
* Model run 6.2.2019 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=tAYKM8VxbmhxtGyw]
* Model run 6.2.2019 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=tAYKM8VxbmhxtGyw]
* Model run 7.2.2019 with systematic analyses of reasons to eat and not to eat Baltic herring [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=fnpxJmMcVxiW9SnC]


Methodological concerns:
Methodological concerns:
Line 466: Line 467:
* [https://stats.stackexchange.com/questions/46345/how-to-calculate-goodness-of-fit-in-glm-r Goodness of fit in logistic regression]
* [https://stats.stackexchange.com/questions/46345/how-to-calculate-goodness-of-fit-in-glm-r Goodness of fit in logistic regression]
* [https://stats.stackexchange.com/questions/8661/logistic-regression-in-r-odds-ratio Calculate odds ratios in logistic regression]
* [https://stats.stackexchange.com/questions/8661/logistic-regression-in-r-odds-ratio Calculate odds ratios in logistic regression]
* [https://www3.nd.edu/~rwilliam/stats3/ordinalindependent.pdf You might treat independent ordinal variables as continuous]


<rcode graphics=1>
<rcode graphics=1>
Line 478: Line 480:


BS <- 24
BS <- 24
########################## Functions


groups <- function(o) {
groups <- function(o) {
Line 620: Line 624:
   return(tmp)
   return(tmp)
}
}
#' @title Perform and print regression analyses
#' @param dat data.frame with data
#' @param y name of column to be used as dependent variable
#' @param countries logical atom to tell whether to run country-specific analyses
#' @return returns the model fit object
printregr <- function(dat, y, title, countries = FALSE) {
 
  dat$y <- dat[[y]]
  cat("\n############### Logistic regression analysis:",title, "(", y, ")\n")
  fit <- glm(
    y ~ Ages + Gender + Country + as.numeric(Education) + as.numeric(Purchasing.power),
    family=binomial(),na.action="na.omit",weights=Weighting,
    data=dat
  )
  step <- stepAIC(fit, direction = "both")
  oprint(step$anova)
  oprint(summary(fit))
  oprint(or95(fit))
 
  if(countries) {
    for(i in unique(dat$Country)) {
      cat("\n#### Country-specific logistic regression analysis:", i, y, "\n")
      fit <- glm(
        Eat.fish ~ Ages + Gender + as.numeric(Education) + as.numeric(Purchasing.power),
        family=binomial(),na.action="na.omit",weights=Weighting,
        data=dat[dat$Country==i,]
      )
      step <- stepAIC(fit, direction = "both")
      oprint(step$anova)
      oprint(summary(fit))
      oprint(or95(fit))
    }
  }
  return(fit)
}


################## Get data
################## Get data
Line 706: Line 748:


############## Answers to open questions
############## Answers to open questions
if(FALSE){
cat("Number of open-ended answers per question and country\n")
cat("Number of open-ended answers per question and country\n")


Line 721: Line 764:
oprint(table(tmp$time,tmp$Country))
oprint(table(tmp$time,tmp$Country))
oprint(tmp)
oprint(tmp)
} # End if(FALSE)


#### Baltic salmon
#### Baltic salmon
Line 1,022: Line 1,066:
dat2 <- dat[dat$Iter==1 & dat$Fish=="Herring",]
dat2 <- dat[dat$Iter==1 & dat$Fish=="Herring",]


cat("###################### What explains whether people eat fish at all?\n")
tmp <- printregr(dat2, "Eat.fish", "What explains whether people eat fish at all?")
fit <- glm(
  Eat.fish ~ Ages + Gender + Country + Education + Purchasing.power,
  family=binomial(),na.action="na.omit",weights=Weighting,
  data=dat2
)
oprint(summary(fit))
step <- stepAIC(fit, direction = "both")
oprint(step$anova)
 
if(FALSE) {
  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(),na.action="na.omit",weights=Weighting,
      data=dat2[dat2$Country==i,]
    )
    oprint(summary(fit))
    step <- stepAIC(fit, direction = "both")
    oprint(step$anova)
  }
}
 
cat("###################### What explains whether people eat any herring compared with other fish?\n")
fit <- glm(
  Eat.herring ~ Ages + Gender + Country + Education + Purchasing.power,
  family=binomial(),na.action="na.omit",weights=Weighting,
  data=dat2
)
oprint(summary(fit))
step <- stepAIC(fit, direction = "both")
oprint(step$anova)
oprint(or95(fit))


if(FALSE){
tmp <- printregr(dat2, "Eat.herring", "What explains whether people eat herring compared with other fish?")
  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(),na.action="na.omit",weights=Weighting,
      data=dat2[dat2$Country==i,]
    )
    oprint(summary(fit))
    step <- stepAIC(fit, direction = "both")
    oprint(step$anova)
  }
}
 
cat("###################### What explains whether people eat Baltic herring compared with everyone else?\n")


dat2$Eat.BH2 <- ifelse(dat2$Eat.BH!="Yes" | is.na(dat2$Eat.BH),0,1)
dat2$Eat.BH2 <- ifelse(dat2$Eat.BH!="Yes" | is.na(dat2$Eat.BH),0,1)
fit <- glm(
tmp <- printregr(dat2, "Eat.BH2", "What explains whether people eat Baltic herring compared with everyone else?")
  Eat.BH2 ~ Ages + Gender + Country + Education + Purchasing.power,
  family=binomial(),na.action="na.omit",weights=Weighting,
  data=dat2
)
oprint(summary(fit))
step <- stepAIC(fit, direction = "both")
oprint(step$anova)
oprint(or95(fit))
 
cat("###################### What population determinants explain
    whether people eat Baltic herring?\n")


dat2$What2 <- ifelse(dat2$What=="Baltic herring",1,ifelse(dat2$What=="Other herring",0,NA))
dat2$What2 <- ifelse(dat2$What=="Baltic herring",1,ifelse(dat2$What=="Other herring",0,NA))
fit <- glm(
tmp <- printregr(dat2, "What2", "What explains whether people eat Baltic herring compared with other herring?")
  What2 ~ Ages + Gender + Country + Education + Purchasing.power,
  family=binomial(),na.action="na.omit",weights=Weighting,
  data=dat2
)
step <- stepAIC(fit, direction = "both")
oprint(step$anova)
oprint(summary(fit))
oprint(or95(fit))


if(FALSE) {
  for(i in unique(dat$Country)) {
    cat("\n######## Country-specific regression analysis:", i, "\n")
    fit <- glm(
      What2 ~ Ages + Gender + Education + Purchasing.power,
      family=binomial(),na.action="na.omit",weights=Weighting,
      data=dat2[dat2$Country==i,]
    )
    step <- stepAIC(fit, direction = "both")
    oprint(step$anova)
    oprint(summary(fit))
    oprint(or95(fit))
  }
}


cat("###################### How fish-specific causes are explained by
cat("###################### How fish-specific causes are explained by
     population determinants?\n")
     population determinants?\n")


causes <- c(
 
for(j in c(
   "Tastes.good.BH",
   "Tastes.good.BH",
   "Self.caught.BH",
   "Self.caught.BH",
Line 1,127: Line 1,092:
   "Environmental.BH",
   "Environmental.BH",
   "Traditional.BH"
   "Traditional.BH"
)
)) {
 
   tmp <- printregr(dat2, j, "What explains the reason to eat Baltic herring?")
for(j in causes) {
   cat("\n############################3# Regression analysis for cause:", j, "\n")
  dat2$y <- dat2[[j]]
  fit <- glm(
    y ~  Ages + Gender + Country + Education + Purchasing.power,
    family=binomial(),na.action="na.omit",weights=Weighting,
    data=dat2
  )
  step <- stepAIC(fit, direction = "both")
  oprint(step$anova)
  oprint(summary(fit))
  oprint(or95(fit))
 
  if(FALSE) {
    for(i in unique(dat$Country)) {
      cat("\n#### Country-specific regression analysis:", i, "\n")
      fit <- glm(
        y ~ Ages + Gender + Education + Purchasing.power,
        family=binomial(),na.action="na.omit",weights=Weighting,
        data=dat2[dat2$Country==i,]
      )
      step <- stepAIC(fit, direction = "both")
      oprint(step$anova)
      oprint(summary(fit))
      cat("Odds ratios with 95 % confidence intervals\n")
      oprint(exp(cbind(coef(fit), confint(fit))))
    }}
}
}


cat("###################### What explains whether people eat any salmon?\n")
for(j in c(
 
  "Bad.taste.BH",
fit <- glm(
   "Not.used.to.BH",
   Eat.salmon ~ Ages + Gender + Country + Education + Purchasing.power,
   "Cannot.cook.BH",
   family=binomial(),na.action="na.omit",weights=Weighting,
   "Difficult.to.cook.BH",
   data=dat2
   "Not.available.BH",
)
  "Health.risks.BH",
oprint(summary(fit))
  "Better.for.feed.BH",
step <- stepAIC(fit, direction = "both")
  "Quality.issues.BH",
oprint(step$anova)
  "Sustainability.BH",
oprint(or95(fit))
  "Not.traditional.BH"
 
)) {
if(FALSE) {
  tmp <- printregr(dat2, j, "What explains the reason to not eat Baltic herring?")
   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(),na.action="na.omit",weights=Weighting,
      data=dat2[dat2$Country==i,]
    )
    oprint(summary(fit))
    step <- stepAIC(fit, direction = "both")
    oprint(step$anova)
  }
}
}
if(FALSE){
  cat("###################### What explains whether people eat Baltic salmon?\n")
  fit <- glm(
    Baltic.salmon ~ Ages + Gender + Country + Education + Purchasing.power,
    family=binomial(),na.action="na.omit",weights=Weighting,
    data=dat2
  )
  oprint(summary(fit))
  step <- stepAIC(fit, direction = "both")
  oprint(step$anova)
    
    
  for(i in unique(dat$Country)) {
# tmp <- printregr(dat2, "Eat.salmon", "What explains whether people eat any salmon compared with other fish?")
    cat("\n#### Country-specific regression analysis:", i, "\n")
# tmp <- printregr(dat2, "Baltic.salmon", "What explains whether people eat Baltic salmon compared with other salmon?")
    fit <- glm(
      Baltic.salmon ~ Ages + Gender + Education + Purchasing.power,
      family=binomial(),na.action="na.omit",weights=Weighting,
      data=dat2[dat2$Country==i,]
    )
    oprint(summary(fit))
    step <- stepAIC(fit, direction = "both")
    oprint(step$anova)
  }
}
</rcode>
</rcode>



Revision as of 11:15, 7 February 2019


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

Do you want to use directly the survey data rather than modelled data?:

+ Show code

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.



Assumptions

The following assumptions are used:

Assumptions for calculations(-)
ObsVariableValueUnitResultDescription
1freq1times /a0Never
2freq2times /a0.5 - 0.9less than once a year
3freq3times /a2 - 5A few times a year
4freq4times /a12 - 361 - 3 times per month
5freq5times /a52once a week
6freq6times /a104 - 2082 - 4 times per week
7freq7times /a260 - 3645 or more times per week
8amdish1g /serving20 - 701/6 plate or below (50 grams)
9amdish2g /serving70 - 1301/3 plate (100 grams)
10amdish3g /serving120 - 1801/2 plate (150 grams)
11amdish4g /serving170 - 2302/3 plate (200 grams)
12amdish5g /serving220 - 2805/6 plate (250 grams)
13amdish6g /serving270 - 400full plate (300 grams)
14amdish7g /serving400 - 550overly full plate (500 grams)
15ingredientfraction0.1 - 0.3Fraction of fish in the dish
16amside1g /serving20 - 701/6 plate or below (50 grams)
17amside2g /serving70 - 1301/4 plate (100 grams)
18amside3g /serving120 - 1801/2 plate (150 grams)
19amside4g /serving170 - 2302/3 plate (200 grams)
20amside5g /serving220 - 2805/6 plate (250 grams)
21change1fraction-1 - -0.8Decrease it to zero
22change2fraction-0.9 - -0.5Decrease it to less than half
23change3fraction-0.6 - -0.1Decrease it a bit
24change4fraction0No effect
25change5fraction0.1 - 0.6Increase it a bit
26change6fraction0.5 - 0.9Increase it over by half
27change7fraction0.8 - 1.3Increase it over to double
28change8fraction-0.3 - 0.3Don'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]

+ Show code

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 answers and fig about eating any herring [10]
  • Model run 5.2.2019 [11]
  • Model run 6.2.2019 [12]
  • Model run 7.2.2019 with systematic analyses of reasons to eat and not to eat Baltic herring [13]

Methodological concerns:

+ Show code

Descriptive statistics

Correlation matrix of all questions in the survey (answers converted to numbers).

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

+ Show code

Bayes model

  • Model run 3.3.2017. All variables assumed independent. [15]
  • Model run 3.3.2017. p has more dimensions. [16]
  • Model run 25.3.2017. Several model versions: strange binomial+multivarnormal, binomial, fractalised multivarnormal [17]
  • Model run 27.3.2017 [18]
  • Other models except multivariate normal were archived and removed from active code 29.3.2017.
  • Model run 29.3.2017 with raw data graphs [19]
  • Model run 29.3.2017 with salmon and herring ovariables stored [20]
  • Model run 13.4.2017 with first version of coordinate matrix and principal coordinate analysis [21]
  • Model run 20.4.2017 [22] code works but needs a safety check against outliers
  • Model run 21.4.2017 [23] some model results plotted
  • Model run 21.4.2017 [24] ovariables produced by the model stored.
  • Model run 18.5.2017 [25] small updates
  • 13.2.2018 old model run but with new Opasnet [26]

+ Show code

Initiate ovariables

jsp taken directly from data WITHOUT salmpling.

+ Show code

Amount estimated from a bayesian model.

  • Model run 24.5.2017 [27]

+ Show code

Amount estimates directly from data rather than from a bayesian model.

  • Initiation run 18.5.2017 [28]
  • Initiation run 24.2.2018: sampling from survey rather than each respondent once [29]

+ Show code

Initiate other ovariables

  • Code stores ovariables assump, often, much, oftenside, muchside, amount.
  • Model run 19.5.2017 [30]
  • Initiation run 24.5.2017 without jsp [31]
  • Model run 8.6.2017 [32]

+ Show code

Other code

This is code for analysing EFSA food intake data about fish for BONUS GOHERR manuscript Ronkainen L, Lehikoinen A, Haapasaari P, Tuomisto JT. 2019.

+ Show code

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

Keywords

References


Related files

Goherr: Fish consumption study. Opasnet . [33]. Accessed 15 May 2025.