Goherr: Fish consumption study: Difference between revisions
m (→Assumptions) |
(→Calculations: updated to use new Bayesian model outputs, but results are really high comapred to real questionnaire data) |
||
Line 228: | Line 228: | ||
library(reshape2) | library(reshape2) | ||
library(rjags) | library(rjags) | ||
objects.latest("Op_en7748", code_name = "bayes") #: pcd.pred, ans.pred, mu.pred | |||
pl <- melt(pcd.pred) | |||
mul <- melt(mu.pred) | |||
ql <- melt(ans.pred) | |||
##Assumptions for amount and frequencies | |||
assumptions <- opbase.data("Op_en7749.assumptions_for_calculations") | assumptions <- opbase.data("Op_en7749.assumptions_for_calculations") | ||
salmon_dishtimesassump <- Ovariable("salmon_dishtimesassump", data = assumptions[assumptions$Variable == "freq" , c("value", "Result")]) | |||
salmon_dishamountassump <- Ovariable("salmon_dishamountassump", data = assumptions[assumptions$Variable == "amdish" , c("value", "Result")]) | |||
salmon_ingridient <- Ovariable("salmon_ingridient", data = assumptions[assumptions$Variable == "ingridient", ]["Result"]) | |||
salmon_sidetimesassump <- Ovariable("salmon_wholetimesassump", data = assumptions[assumptions$Variable == "freq" , c("value", "Result")]) | |||
salmon_sideamountassump <- Ovariable("salmon_wholeamountassump", data = assumptions[assumptions$Variable == "amside" , c("value", "Result")]) | |||
##Build up the variables to calculate amount of Baltic salmon eating | |||
salmon_dishtimes <- Ovariable("salmon_dishtimes", data = data.frame( | |||
subset(ql, ql$Question == "How often Baltic salmon" & ql$Seed == "S1"), | |||
Result = 1 | |||
)) | |||
) | |||
salmon_dishtimes@data$Question <- NULL | |||
salmon_dishamount <- Ovariable("salmon_dishamount", data = data.frame( | |||
subset(ql, ql$Question == "How much Baltic salmon" & ql$Seed == "S1"), | |||
Result = 1 | |||
)) #salmon with dish amount per one serving | |||
)) #salmon | |||
salmon_dishamount@data$Question <- NULL | |||
salmon_sidetimes <- Ovariable("salmon_sidetimes", data = data.frame( | |||
subset(ql, ql$Question == "How often side Baltic salmon" & ql$Seed == "S1"), | |||
Result = 1 | |||
)) #salmon as such times / year | |||
salmon_sidetimes@data$Question <- NULL | |||
salmon_sideamount <- Ovariable("salmon_sideamount", data = data.frame( | |||
subset(ql, ql$Question == "How much side Baltic salmon" & ql$Seed == "S1"), | |||
Result = 1 | |||
)) #salmon as whole amount per one serving | |||
salmon_sideamount@data$Question <- NULL | |||
amount <- Ovariable("amount", | amount <- Ovariable("amount", | ||
Line 296: | Line 285: | ||
"salmon_dishtimes", | "salmon_dishtimes", | ||
"salmon_dishtimesassump", | "salmon_dishtimesassump", | ||
" | "salmon_sideamount", | ||
" | "salmon_sideamountassump", | ||
" | "salmon_sidetimes", | ||
" | "salmon_sidetimesassump" | ||
)), | )), | ||
formula = function(...) { | formula = function(...) { | ||
out1 <- (salmon_dishamount * salmon_dishamountassump * salmon_ingridient) | out1 <- (salmon_dishamount * salmon_dishamountassump * salmon_ingridient) | ||
out1@output$ | out1@output$value <- NULL | ||
out1 <- ((salmon_dishtimes * salmon_dishtimesassump) * out1) / 365 | out1 <- ((salmon_dishtimes * salmon_dishtimesassump) * out1) / 365 | ||
out1@output$ | out1@output$value <- NULL | ||
out2 <- ( | out2 <- (salmon_sideamount * salmon_sideamountassump) | ||
out2@output$ | out2@output$value <- NULL | ||
out2 <- (( | out2 <- ((salmon_sidetimes * salmon_sidetimesassump) * out2) / 365 | ||
out2@output$ | out2@output$value <- NULL | ||
out <- out1 + out2 | out <- out1 + out2 | ||
Line 319: | Line 308: | ||
} | } | ||
) | ) | ||
amountSalmon <- EvalOutput(amount, forceEval = TRUE, N = 1000) | |||
amountSalmon <- EvalOutput(amount, forceEval = TRUE) | |||
temp <- amountSalmon@output | temp <- amountSalmon@output | ||
temp <- aggregate(temp$amountResult, by=list(temp$Country, temp$ | temp <- aggregate(temp$amountResult, by=list(temp$Country, temp$Age, temp$Gender), FUN = mean) | ||
colnames(temp) <- c("Country","Age","Gender","Salmon amount") | colnames(temp) <- c("Country","Age","Gender","Salmon amount") | ||
oprint(temp) | oprint(temp) | ||
objects.store(amountHerring, amountSalmon) | #objects.store(amountHerring, amountSalmon) | ||
cat("objects amountHerring, amountSalmon were stored.\n") | #cat("objects amountHerring, amountSalmon were stored.\n") | ||
</rcode> | </rcode> | ||
Revision as of 12:25, 2 March 2017
Moderator:Arja (see all) |
This page is a stub. You may improve it into a full page. |
Upload data
|
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.
Calculations
This code calculates how much (g/day) Baltic herring and salmon are eaten based on the questionnaire data. Calculation takes several minutes!
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
Keywords
References
Related files
<mfanonymousfilelist></mfanonymousfilelist>