Difference between revisions of "Benefit-risk assessment of Baltic herring and salmon intake"

From Testiwiki
Jump to: navigation, search
m (Exposure model)
(Health impact model (Monte Carlo))
 
(60 intermediate revisions by 2 users not shown)
Line 17: Line 17:
 
=== Boundaries ===
 
=== Boundaries ===
 
* Four baltic sea countries (Denmark, Estonia, Finland, Sweden)
 
* Four baltic sea countries (Denmark, Estonia, Finland, Sweden)
* Current situation (fish use year 2016, pollutant levels in fish year 2010?)
+
* Current situation (fish use year 2016, pollutant levels in fish year 2010)
* Estimation for future (year 2020?)
+
* Estimation for future (not year specific)
  
 
=== Decisions and scenarios ===
 
=== Decisions and scenarios ===
Line 56: Line 56:
  
 
[[image:Goherr_WP5_HIA_structure.JPG|thumb|Schematic picture of the health benefit-risk model for Baltic herring and salmon intake.]]
 
[[image:Goherr_WP5_HIA_structure.JPG|thumb|Schematic picture of the health benefit-risk model for Baltic herring and salmon intake.]]
 +
[[File:BRA of Baltic herring and salmon.png|400px|thumb|Detailed modelling diagram of the health benefit-risk model. Green nodes are original data, red nodes are based on scientific literature, and blue nodes are computational nodes. Those with a number are generic nodes designed to be used in several assessments. the number refers to the page identifier in Op_en wiki (this Opasnet wiki).]]
  
 
=== Stakeholders ===
 
=== Stakeholders ===
Line 71: Line 72:
  
 
=== Dependencies ===
 
=== Dependencies ===
Content of all variable pages below are preliminary and will be updated when this assessment proceeds.
 
  
* [[TEF |Toxic equivalency factor (TEF)]]
+
'''Calculation of cases of disease
* [[Goherr:_Fish_consumption_study | Consumption of fish]]
+
* totcases (Op_en2261/totcases on page [[Health impact assessment]]) with dose and RR, automatic intermediate variables. Indices: Age, Gender, Country, Response.
* Pollutant and fatty acid levels
+
** population, case-specific, from main model. Suggested indices: Age, Gender, Country.
** [[POPs_in_Baltic_herring | Persistent organic pollutant levels in Baltic herring]]
+
** disincidence,Incidence of the disease of interest. Op_en5917/initiate [[Disease risk]]. Suggested indices: Age, Gender, Country, Response. {{comment|# |Should we use IHME data instead?|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 16:03, 13 April 2017 (UTC)}} {{defend|# |Done|--[[User:Arja|Arja]] ([[User talk:Arja|talk]]) 12:07, 19 May 2017 (UTC)}}
** [[POPs_in_Baltic_salmon | Persistent organic pollutant levels in Baltic salmon]]
+
*** [[Burden_of_disease_in_Finland |Burden of disease as DALY in Finland]] {{attack|# |Inactivate and merge?|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 16:03, 13 April 2017 (UTC)}}
** [[Concentrations_of_beneficial_nutrients_in_fish | Nutrient levels in fish]] {{comment|# |Includes three tables, content modelled with Analytica years ago. How to update these?|--[[User:Arja|Arja]] ([[User talk:Arja|talk]]) 07:20, 20 October 2016 (UTC)}}
+
** ERF and threshold, exposure-response functions. Op_en2031/initiate [[Exposure-response function]]. Existing indices: Exposure_agent, Response, Exposure, Exposure_unit, ER_function, Scaling. {{defend|# |Done.|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 14:22, 19 April 2017 (UTC)}}
* Risk functions of health effects
+
*** [[ERF_of_dioxin | Exposure-response functions of dioxins]]
** [[ERF_of_dioxin | Exposure-response functions of Dioxins]]
+
*** [[ERF_of_omega-3_fatty_acids | Exposure-response functions of fatty acids]]
** [[ERF_of_omega-3_fatty_acids | Exposure-response functions of fatty acids]]
+
*** [[ERF_of_methylmercury |Exposure-response functions of methylmercury]]
** [[ERF_of_methylmercury |Exposure-response functions of methylmercury]]
+
*** [[ERFs of vitamins]]
* Background health data (incidences and DALY)
+
** frexposed, fraction of population that is exposed from [[Goherr: Fish consumption study]]. Suggested indices: Age, Gender, Country.
** [[Burden_of_disease_in_Finland |Burden of disease as DALY in Finland]]
+
** exposure, from the main model because has case-specific adjustments. Suggested indices: Age, Gender, Country, Compound.
** [[Disease_risk |Disease risk: incidences in Finland  and DALY in Europe]]
+
*** amount, [[Goherr:_Fish_consumption_study | Consumption of fish]]. Existing indices: Gender, Age, Country, Fish.
 +
*** [[EU-kalat]]: concentration, Pollutant and fatty acid concentrations in fish. Suggested indices: Fish_species → Fish, POP → Compound, Catch_square (Catch_site, Catch_location) → Area, Length_mean_mm → Length.
 +
**** [[POPs_in_Baltic_herring | Persistent organic pollutant levels in Baltic herring]] {{attack|# |Page only used to summarise data from [[EU-kalat]].|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 11:40, 19 April 2017 (UTC)}}
 +
**** [[POPs_in_Baltic_salmon | Persistent organic pollutant levels in Baltic salmon]] {{attack|# |Page only used to summarise data from [[EU-kalat]].|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 11:40, 19 April 2017 (UTC)}}
 +
**** [[Concentrations of beneficial nutrients in fish]]. Suggested indices: Fish, Compound. {{comment|# |Good data for Baltic herring, Salmon not taken into account yet|--[[User:Arja|Arja]] ([[User talk:Arja|talk]]) 13:27, 13 March 2017 (UTC)}} {{defend|# |Take data from Fineli.|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 16:03, 13 April 2017 (UTC)}} {{comment|# |[[Omega-3 content in salmon]]: update and change the answer to point to the main page.|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 16:03, 13 April 2017 (UTC)}}
 +
**** [[Mercury concentrations in fish in Finland]]. Suggested indices: Fish, Location, Size, Year, Compound. {{defend|# |update code by using Bayesian model on Kerty database.|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 16:03, 13 April 2017 (UTC)}}
 +
*** [[TEF |Toxic equivalency factor (TEF)]]. Indices: TEFversion, Compound. {{defend|# |Done.|--[[User:Jouni|Jouni]] ([[User talk:Jouni|talk]]) 14:22, 19 April 2017 (UTC)}}
 +
 
 +
'''Calculation of DALYs:
 +
* totcases (see above)
 
* [[Disability_weights | Disability weights of health effects]]
 
* [[Disability_weights | Disability weights of health effects]]
 
* [[Duration_of_morbidity | Length of disease]]
 
* [[Duration_of_morbidity | Length of disease]]
 +
 +
<t2b name="Background exposure" index="Background,Country,Gender,Exposure_agent" desc="Unit,Description" unit="-">
 +
Yes|FI|Male|Vitamin D|11.7|µg /d|Finriski 12 - 0.3 silakasta
 +
Yes|SWE|Male|Vitamin D|11.7|µg /d|Finriski 12 - 0.3 silakasta
 +
Yes|EST|Male|Vitamin D|11.7|µg /d|Finriski 12 - 0.3 silakasta
 +
Yes|DK|Male|Vitamin D|11.7|µg /d|Finriski 12 - 0.3 silakasta
 +
Yes||Female|Vitamin D|8.5|µg /d|Finriski 8.7 - 0.2 silakasta
 +
Yes||Male|EPA|120|mg /d|Finriski 125 - 4.6 silakasta
 +
Yes||Female|EPA|96|mg /d|Finriski 100 - 3.9 silakasta
 +
Yes||Male|DHA|118|mg /d|Finriski 125 - 6.7 silakasta
 +
Yes||Female|DHA|94|mg /d|Finriski 100 - 5.4 silakasta
 +
Yes|||PCDDF|0|pg /d (TEQ)|
 +
Yes|||PCB|0|pg /d (TEQ)|
 +
Yes|||MeHg|0|µg /d|
 +
Yes|||logTEQ|0|log(pg /g)|
 +
No||||0||
 +
</t2b>
 +
 +
<t2b name="Exposure-response functions of interest" index="Exposure_agent,Resp,Response,ER_function,Scaling" obs="Dummy" unit="-">
 +
TEQ|Tooth defect|Yes or no dental defect|ERS|None|1
 +
TEQ|Cancer|Cancer morbidity|CSF|BW|1
 +
TEQ|Dioxin TDI|Dioxin recommendation tolerable daily intake|TDI|BW|1
 +
DHA|Child's IQ|Loss in child's IQ points|ERS|None|1
 +
Omega3|Heart (CHD)|CHD2 mortality|Relative Hill|None|1
 +
Omega3|Stroke|Stroke mortality|Relative Hill|None|1
 +
Vitamin D|Vitamin D intake|Vitamin D recommendation|Step|None|1
 +
MeHg|Child's IQ|Loss in child's IQ points|ERS|BW|1
 +
</t2b>
 +
 +
<t2b name="DALYs of responses" index="Resp" obs="DALY" desc="Description" unit="DALY /case">
 +
Heart (CHD)|5 - 15|Assumes DW 1 and D 10 U 50%
 +
Stroke|5 - 15|Assumes DW 1 and D 10 U 50 %
 +
Tooth defect|0 - 0.12|DW 0.001 D 60 U 100 %. Or should we use this: Developmental defect: caries or missing tooth, 0.008 (0.003 - 0.017), Periodontitis weight from IHME. D: 1. U from IHME?
 +
Cancer|0 - 0.28|DW 0.1 D 20, in addition loss of life expectancy 5 a. This comes from a lifetime exposure, so it is (linearly( assumed that 1/50 of this is caused by one-year exposure. U 100 %
 +
Vitamin D intake|0.0001 - 0.0101|DW 0.001 D 1 U 101x. 1 if not met
 +
Dioxin TDI|0.0001 - 0.0101|DW 0.001 D 1 U 101x. 1 if not met
 +
Child's IQ|-0.0517 (-0.03 - -0.0817)|Intellectual disability, mild (IQ<70): 0.031 (0.018-0.049) From IHME. D 50 U from IHME.
 +
</t2b>
 +
 +
: DW = disability weight
 +
: D = duration (a)
 +
: U = uncertainty
  
 
=== Analyses ===
 
=== Analyses ===
Line 94: Line 145:
 
* Country (Denmark, Estonia, Finland, Sweden)
 
* Country (Denmark, Estonia, Finland, Sweden)
 
* Year (current, future)
 
* Year (current, future)
* Sex
+
* Gender
* Age (categories?)
+
* Age: 18-45 years or >45 years
 
* Fish species (Baltic herring, Baltic salmon)
 
* Fish species (Baltic herring, Baltic salmon)
* Health end-point (ICD-10 code?, name? something else? {{comment|# |This need to be matched for disability weight, duration of disease, background incidence and disease burden data, dose-responses|--[[User:Arja|Arja]] ([[User talk:Arja|talk]]) 09:39, 22 September 2016 (UTC)}}
+
* Health end-point, specified by name  
* Compound (pollutant, fatty acid) {{comment|# |This needs to be matched with dose-responses|--[[User:Arja|Arja]] ([[User talk:Arja|talk]]) 09:39, 22 September 2016 (UTC)}}
+
* Compound: TEQ (PCDD/F and PCB), Vitamin D, Omega3 (includes EPA and DHA), MeHg
  
 
=== Calculations ===
 
=== Calculations ===
 
This section will have the actual health benefit-risk model (schematically described in the above figure) written with R. The code will utilise all variables listed in the above Dependencies section. Model results are presented as tables and figures when those are available.
 
This section will have the actual health benefit-risk model (schematically described in the above figure) written with R. The code will utilise all variables listed in the above Dependencies section. Model results are presented as tables and figures when those are available.
  
==== Bayes model for intake ====
+
* 18.5.2017: Archived exposure model ''Op7748/exposure'' by Arja (used separate ovariables for salmon and herring) [http://en.opasnet.org/en-opwiki/index.php?title=Benefit-risk_assessment_of_Baltic_herring_and_salmon_intake&oldid=40413#Exposure_model]
 
 
* Model run 28.2.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=KrjCTGZmB8JkCH75]
 
* Model run 28.2.2017 with corrected survey model [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=ZeO0SdlshPgOjqdL]
 
* Model run 28.2.2017 with Mu estimates [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=TwY2bAIiWr037zqb]
 
* Model run 1.3.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=3Xu19vkWK1lyWVg3]
 
 
 
<rcode name="bayes" label="Sample Bayes model (for developers only)">
 
# This is code Op7748/bayes on page [[Benefit-risk assessment of Baltic herring and salmon intake]]
 
 
 
library(OpasnetUtils)
 
library(reshape2)
 
library(rjags)
 
 
 
objects.latest("Op_en3104", code_name = "preprocess") # [[EU-kalat]]
 
 
 
# Hierarchical Bayes model.
 
 
 
# PCDD/F concentrations in fish.
 
# It uses the sum of PCDD/F (Pcdsum) as the total concentration of dioxin in fish.
 
# Cong_j is the fraction of a congener from pcdsum.
 
# pcdsum is log-normally distributed. cong_j follows Dirichlet distribution.
 
# pcdsum depends on age of fish, fish species and catchment area, but we only have species now so other variables are omitted.
 
# cong_j depends on fish species.
 
 
 
# Fish intake in humans
 
# Data from data.frame survey from page [[Goherr: Fish consumption study]]
 
# Start with salmon questions 46:49 (amounts eaten)
 
# Some preprocessing should be moved away from this code.
 
# Model assumes that questionnaire data follows binomial distribution with parameter p and max value 9.
 
# p depends on country (4 groups), sex (2), age (2) that are known individually.
 
# We should test whether sex makes a difference or whether it can be omitted.
 
# Predicted p for each question, determined by the group, are produced from the bayes model.
 
# p is used to sample answers, which are then combined with estimates of amounts related to each answer.
 
# Total amount eaten of each fish per modelled individual is finally calculated.
 
 
 
objects.latest("Op_en7749", "preprocess") # [[Goherr: Fish consumption study]]: survey, surcol
 
 
 
# The following three rows should be in the preprocessing code.
 
survey$Row <- 1:nrow(survey)
 
survey$Weighting <- as.double(as.character(survey$Weighting))
 
survey$Ages <- ifelse(as.numeric(as.character(survey$Age)) < 46, "18-45",">45")
 
 
 
# Interesting fish eating questions
 
surv <- survey[c(1,3,4,16,29,30,31,46:49,95:98,158)]
 
 
 
agel <- unique(survey$Ages)
 
countryl <- unique(survey$Country)
 
genderl <- unique(survey$Gender)
 
ans <- data.matrix(surv[-c(1:3, ncol(surv))]) - 1 # Zero is the first option
 
qlen <-  unlist(lapply(
 
  surv,
 
  FUN = function(x) {length(levels(x))}))[-c(1:3, ncol(surv))]
 
questionl <- colnames(surv)
 
agel
 
countryl
 
genderl
 
 
 
conl <- as.character(unique(eu@output$Congener))
 
fisl <- sort(as.character(unique(eu@output$Fish)))
 
conl
 
fisl
 
fishsamples <- reshape(
 
  eu@output,
 
  v.names = "euResult",
 
  idvar = "THLcode",
 
  timevar = "Congener",
 
  drop = c("Matrix", "euSource"),
 
  direction = "wide"
 
)
 
 
 
# Find the level of quantification for dinterval function
 
LOQ <- unlist(lapply(fishsamples[3:ncol(fishsamples)], FUN = function(x) min(x[x!=0])))
 
names(LOQ) <- conl
 
cong <- data.matrix(fishsamples[3:ncol(fishsamples)])
 
cong[cong == 0] <- 0.01 # NA # Needed for dinterval
 
 
 
mod <- textConnection("
 
  model{
 
    for(i in 1:S) { # s = fish sample
 
      for(j in 1:C) { # C = congener
 
#        below.LOQ[i,j] ~ dinterval(-cong[i,j], -LOQ[j])
 
        cong[i,j] ~ dlnorm(mu[fis[i],j], tau[fis[i],j])
 
      }
 
    }
 
    for(i in 1:F) { # F = fish species
 
      for(j in 1:C) { # C = congener
 
        mu[i,j] ~ dunif(-3,3) # Why does this not work with dnorm(0, 0.001)?
 
        tau[i,j] <- pow(sigma[i,j], -2)
 
        sigma[i,j] ~ dunif(0, 10)
 
        pcd.pred[i,j] ~ dlnorm(mu[i,j], tau[i,j]) # Model prediction
 
      }
 
    }
 
   
 
    for(i in 1:U) { # U = observation in the questionnaire
 
      for(j in 1:Q) { # Q = question in the questionnaire
 
        ans[i,j] ~ dbin(p[age[i],country[i],gender[i],j], qlen[j])
 
      }
 
    }
 
    for(i in 1:A) { # Age groups
 
      for(j in 1:B) { # Countries
 
        for(k in 1:H) { #Genders
 
          for(l in 1:Q) { # Questions
 
            p[i,j,k,l] ~ dunif(0,1)
 
            ans.pred[i,j,k,l] ~ dbin(p[i,j,k,l], qlen[l])
 
          }
 
        }
 
      }
 
    }
 
  }
 
")
 
 
 
jags <- jags.model(
 
  mod,
 
  data = list(
 
    S = nrow(fishsamples),
 
    C = length(conl),
 
    F = length(fisl),
 
    cong = cong,
 
#    LOQ = LOQ,
 
#    below.LOQ = is.na(cong)*1,
 
    fis = match(fishsamples$Fish, fisl),
 
    U = nrow(ans),
 
    Q = ncol(ans),
 
    ans = ans,
 
    qlen = qlen-1, # Subtract 1 because starts from 0.
 
    age = match(survey$Ages, agel),
 
    country = match(survey$Country, countryl),
 
    gender = match(survey$Gender, genderl),
 
    A = length(agel),
 
    B = length(countryl),
 
    H = length(genderl)
 
  ),
 
  n.chains = 4,
 
  n.adapt = 100
 
)
 
 
 
update(jags, 100)
 
samps <- jags.samples(jags, c('mu', 'pcd.pred', 'ans.pred'), 1000)
 
#samps.coda <- coda.samples(jags, c('mu', 'pcd.pred', 'ans.pred'), 1000)
 
#objects.store(samps)
 
 
 
#library(plyr)
 
#temp <- adply(samps$mu, c(1,2,3,4))
 
 
 
pcd.pred <- array(
 
  samps$pcd.pred,
 
  dim = c(length(fisl), length(conl), 1000, 4),
 
  dimnames = list(
 
    Fish = fisl,
 
    Congener = conl,
 
    Iter = 1:1000,
 
    Seed = c("S1","S2","S3","S4")
 
  )
 
)
 
 
 
mu.pred <- array(
 
  samps$mu,
 
  dim = c(length(fisl), length(conl), 1000, 4),
 
  dimnames = list(
 
    Fish = fisl,
 
    Congener = conl,
 
    Iter = 1:1000,
 
    Seed = c("S1","S2","S3","S4")
 
  )
 
)
 
 
 
ans.pred <- array(
 
  samps$ans.pred,
 
  dim = c(
 
    length(agel),
 
    length(countryl),
 
    length(genderl),
 
    ncol(ans),
 
    1000, # iterations
 
    4 # Seeds
 
  ),
 
  dimnames = list(
 
    Age = agel,
 
    Country = countryl,
 
    Gender = genderl,
 
    Question = colnames(ans),
 
    Iter = 1:1000,
 
    Seed = c("S1","S2","S3","S4")
 
  )
 
)
 
 
 
objects.store(pcd.pred, mu.pred, ans.pred)
 
cat("Arrays pcd.pred, mu.pred, ans.pred stored.\n")
 
</rcode>
 
 
 
==== Exposure model ====
 
 
 
<rcode name="exposure" label="Calculate dioxin and nutrient intake (for developers only)">
 
 
 
# This is code Op7748/exposure on page [[Benefit-risk assessment of Baltic herring and salmon intake]]
 
 
 
library(OpasnetUtils)
 
library(ggplot2)
 
library(reshape2)
 
library(rjags)
 
 
 
objects.latest("Op_en7748", code_name = "bayes") #: pcd.pred, ans.pred, mu.pred
 
 
 
#### Dioxin exposure
 
 
 
pl <- melt(pcd.pred)
 
levels(pl$Congener) <- gsub("HCDD", "HxCDD", levels(pl$Congener))
 
levels(pl$Congener) <- gsub("HCDF", "HxCDF", levels(pl$Congener))
 
 
 
colnames(pl)[colnames(pl) == "value"] <- "Result"
 
dioxconcsalmon <- subset(pl, pl$Fish == "Salmon" & pl$Seed == "S1")
 
dioxconcsalmon <- Ovariable("dioxconcsalmon", data = dioxconcsalmon)
 
 
 
tef <- opbase.data("Op_en4017.tef_values")
 
tef <-  Ovariable("tef", data = tef)
 
 
 
teqsalmon <- tef * dioxconcsalmon
 
teqsalmon <- aggregate(teqsalmon@output$Result, by = list(teqsalmon@output$Iter), sum)
 
colnames(teqsalmon) <- c("Iter","Result")
 
teqsalmon <- Ovariable("teqsalmon", data = teqsalmon)
 
 
 
dioxconcherring <- subset(pl, pl$Fish == "Baltic herring" & pl$Seed == "S1")
 
dioxconcherring <- Ovariable("dioxconcherring", data = dioxconcherring)
 
 
 
teqherring <- tef * dioxconcherring
 
teqherring <- aggregate(teqherring@output$Result, by = list(teqherring@output$Iter), sum)
 
colnames(teqherring) <- c("Iter","Result")
 
teqherring <- Ovariable("teqherring", data = teqherring)
 
 
 
objects.latest("Op_en7749", code_name = "calculate_amount") # amount of salmon and herring intake
 
 
 
expoherring <- teqherring * amountHerring
 
expoherring <- unkeep(expoherring, cols = c("Fish","Seed"), sources = TRUE, prevresults = TRUE)
 
exposalmon <- teqsalmon * amountSalmon
 
exposalmon <- unkeep(exposalmon, cols = c("Fish","Seed"), sources = TRUE, prevresults = TRUE)
 
expodiox <- exposalmon + expoherring
 
 
 
objects.latest("Op_en1838", code_name = "bayes") #nutrient concentrations
 
 
 
##Nutrient intake
 
nutconc <- melt(concddeo.pred)
 
colnames(nutconc)[colnames(nutconc) == "value"] <- "Result"
 
omegaconcherring <- Ovariable("omegaconcherring", data = subset(nutconc, nutconc$Compound == "Omega3" & nutconc$Seed == "1"))
 
omegaconcherring <- unkeep(omegaconcherring, cols = c("Fish","Seed","Compound"), sources = TRUE, prevresults = TRUE)
 
expoomegaherring <- (amountHerring * omegaconcherring) /100 #omega3 content was mg/100 grams of fish
 
expoomegaherring <- unkeep(expoomegaherring, cols = c("Fish","Seed"), sources = TRUE, prevresults = TRUE)
 
 
 
objects.store(expodiox, expoomegaherring)
 
cat("objects expodiox, expoomegaherring were stored.\n")
 
 
 
</rcode>
 
  
 
==== Health impact model (Monte Carlo) ====
 
==== Health impact model (Monte Carlo) ====
Line 360: Line 160:
 
* Model run 13.3.2017: a simple copy of [[:op_fi:Silakan hyöty-riskiarvio]] [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=xF8zPw3M9emJd5yY]
 
* Model run 13.3.2017: a simple copy of [[:op_fi:Silakan hyöty-riskiarvio]] [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=xF8zPw3M9emJd5yY]
 
* Model run 13.3.2017 with showLocations function [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=MJ6Wfun0aV9H85Cj]
 
* Model run 13.3.2017 with showLocations function [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=MJ6Wfun0aV9H85Cj]
 +
* Model run 13.3.2017 produces totcases results but are not meaningful yet [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=FqjfFcJGQ1ZUHcsy]
 +
* Model run 14.3.2017 with exposure graph [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=Rpt6e8XtmK8F4m2i]
 +
* Model run 14.3.2017 bugs not fixed [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=jCTKrJR6HQ4qXjF5]
 +
* Model run 30.5.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=0jq0LB5tfp7mvvCt]
 +
* Model run 12.6.2017 with 2D Monte Carlo [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=ZwSWfkneUHIUG7Xt]
 +
* Model run 8.9.2017 with known bugs fixed [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=qkyKcACq5MYvJmN4]
  
<rcode graphics=1>
+
<rcode name="hia" label="Store intermediate variables (for developers only)">
# This is code Op_en7748/ on page [[Benefit-risk assessment of Baltic herring and salmon intake]]
+
# This is code Op_en7748/hia on page [[Benefit-risk assessment of Baltic herring and salmon intake]]
 
+
Sys.time()
 
library(OpasnetUtils)
 
library(OpasnetUtils)
 
library(ggplot2)
 
library(ggplot2)
  
showLoctable <- function(name = ".GlobalEnv") {
+
# amount does not know where to find jsp.
  loctable <- data.frame()
+
objects.latest("Op_en7749", code_name = "surveyjsp") # Uses jsp directly from survey data.
 
 
  for(i in ls(name = name)) {
 
    if(class(get(i)) == "ovariable") {
 
      for(j in colnames(get(i)@output)) {
 
        if(!(grepl("Source", j) | grepl("Result", j))) {
 
          loctable <- rbind(
 
            loctable,
 
            data.frame(
 
              Ovariable = i,
 
              Index = j,
 
              Class = class(get(i)@output[[j]]),
 
              NumLoc = length(unique(get(i)@output[[j]])),
 
              Locations = paste(head(unique(get(i)@output[[j]])), collapse = " ")
 
            )
 
          )
 
        }
 
      }
 
    }
 
  }
 
  return(loctable)
 
}
 
  
exposure <- 1
+
openv.setN(max(as.numeric(as.character(jsp$Iter)))) # Adjust N to data size
BW <- 70
 
  
solet <- opbase.data("Op_fi3831.saantioletukset")
+
# For development and testing, use smaller ovariables
 +
openv.setN(200)
 +
jsp <- jsp[as.numeric(as.character(jsp$Iter)) <= 200 , ]
  
############# Tämän yläpuoliset eivät ole oikeaa koodia!!!
+
conc <- Ovariable(
 
+
  "conc",
#!!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
  dependencies = data.frame(
## Tausta-altistus D-vitamiinille ja omega-3:lle
+
    Name = c(
addexposure <- EvalOutput(Ovariable("addexposure", ddata = "Op_fi3831.tausta_altistus"))
+
      "conc_pcddf", # [[EU-kalat]]
#ii++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
      "conc_vit" # [[Concentrations of beneficial nutrients in fish]]
 +
    ),
 +
    Ident = c("Op_en3104/initiate", "Op_en1838/initiate")
 +
  ),
 +
  formula = function(...) {
 +
    colnames(conc_pcddf@output)[colnames(conc_pcddf@output)=="Compound"] <- "Exposure_agent"
 +
    conc_pcddf$Fish <- as.factor(conc_pcddf$Fish) # This is character vector for some reason.
 +
    levels(conc_vit$Exposure_agent)[levels(conc_vit$Exposure_agent) == "D_vitamin"] <- "Vitamin D"
 +
    conc_vit <- conc_vit / 100 # From /100g to /g
 +
    result(conc_vit)[conc_vit$Exposure_agent == "Vitamin D"] <- result(conc_vit)[conc_vit$Exposure_agent == "Vitamin D"] * 1000 # from mg to ug
 +
    out <- combine(conc_pcddf, conc_vit)
 +
    levels(out$Fish)[levels(out$Fish)=="Baltic herring"] <- "Herring"
 +
    result(out) <- pmax(0,result(out))
 +
    return(out)
 +
  }
 +
)
 +
conc@meta = c(conc@meta, list(units = "Vitamin D: ug/g; DHA, EPA, and omega3: mg/g; PCDD/F, PCB: pg/g f.w."))
  
# Empty values ("") in indices must be replaced by NA so that Ops works correctly.
+
#objects.latest("Op_en4004", code_name = "initiate") # [[Mercury concentrations in fish in Finland]]
levels(addexposure@output$Sukupuoli)[levels(addexposure@output$Sukupuoli) == ""] <- NA
+
# ^ This code does not exist yet. Use EU-kalat as example.
levels(addexposure@output$Exposure_agent)[levels(addexposure@output$Exposure_agent) == ""] <- NA
 
addexposure@output <- fillna(addexposure@output, c("Sukupuoli", "Exposure_agent"))
 
  
 +
# sumitem is needed by both expoRaw and bgexposure
 
sumitem <- function(
 
sumitem <- function(
   ova, #ovariable that has locations to sum
+
   ova, # ovariable that has locations to sum
 
   cond, # index column that contains the locations to sum
 
   cond, # index column that contains the locations to sum
 
   condvalue, # vector of locations to sum
 
   condvalue, # vector of locations to sum
Line 422: Line 223:
 
}
 
}
  
addexposure <- sumitem(addexposure, "Exposure_agent", c("PCDDF", "PCB"), "TEQ")
+
# Exposure with fish-related exposure and additional exposure from other sources.
addexposure <- sumitem(addexposure, "Exposure_agent", c("EPA", "DHA"), "Omega3")
+
# Does NOT contain infant's exposure from mother.
addexposure <- unkeep(addexposure, prevresults = TRUE, sources = TRUE)
 
  
# Make the background exposure uncertain rather than an index.
+
expoRaw <- Ovariable(
 
+
   "expoRaw",
taustat <- Ovariable(
+
  dependencies = data.frame(
   output = data.frame(
+
     Name = c("conc", "amount", "bgexposure", "info"),
     Iter = 1:get("N", envir = openv),
+
    Ident = c(NA, "Op_en7749/initiate", NA, NA)
    Tausta = c("Kyllä", "Ei")[sample(2, get("N", envir = openv), replace = TRUE)],
 
    Result = 1
 
 
   ),
 
   ),
   marginal = c(TRUE, FALSE, FALSE)
+
   formula = function(...) {
 +
    amount <- unkeep(
 +
      amount,
 +
      sources=TRUE,
 +
      prevresults=TRUE,
 +
      cols=c(
 +
        "Eat.fish",
 +
        "How.often.fish",
 +
        "Eat.salmon",
 +
        "assumpUnit"
 +
      )
 +
    )
 +
   
 +
    # Make a summary for TEQ (Omega3 exists already)
 +
    conc <- sumitem(conc, "Exposure_agent", c("PCDDF", "PCB"), "TEQ")
 +
    levels(conc$Fish)[levels(conc$Fish) == "Baltic herring"] <- "Herring"
 +
    expoRaw <- amount * conc + bgexposure
 +
    expoRaw <- oapply(expoRaw, cols = "Fish", FUN = sum) * info
 +
   
 +
    return(expoRaw)
 +
  }
 
)
 
)
  
addexposure <- addexposure * taustat
+
## Background-exposure to vitamin D and omega-3
 +
addexposure <- Ovariable(
 +
  "addexposure",
 +
  ddata = "Op_en7748", # [[Benefit-risk assessment of Baltic herring and salmon intake]]
 +
  subset = "Background exposure"
 +
)
  
exposure <- exposure + addexposure
+
# Should the background be specific for gender and country? At the moment it is.
 +
bgexposure <- Ovariable(
 +
  "bgexposure",
 +
  dependencies = data.frame(Name="addexposure"),
 +
  formula = function(...) {
 +
    out <- addexposure
 +
    # Empty values ("") in indices must be replaced by NA so that Ops works correctly.
 +
    levels(out$Gender)[levels(out$Gender) == ""] <- NA
 +
    levels(out$Country)[levels(out$Country) == ""] <- NA
 +
    levels(out$Exposure_agent)[levels(out$Exposure_agent) == ""] <- NA
 +
    out@output <- fillna(out@output, c("Country", "Gender", "Exposure_agent"))
 +
   
 +
    out <- sumitem(out, "Exposure_agent", c("PCDDF","PCB"), "TEQ")
 +
    out <- sumitem(out, "Exposure_agent", c("EPA", "DHA"), "Omega3")
 +
    out <- unkeep(out, prevresults = TRUE, sources = TRUE)  + 1E-6
 +
   
 +
    # Make the background exposure uncertain rather than an index.
 +
    out <- CollapseMarginal(out, cols = "Background", fun = "sample")
 +
   
 +
    return(out)
 +
  }
 +
)
  
# Convert mother's dioxin intake (pg/d) into child's dioxin concentration (pg/g) in fat after 6 months of breast-feeding.
+
info <- Ovariable(
# For details, see [[ERF of dioxin#Dental defects]]
+
  "info",
 +
  dependencies = data.frame(Name = c("jsp","bgexposure")),
 +
  formula = function(...) {
 +
    out <- unique(jsp@output[c("Iter","Country","Gender","Ages")])
 +
    out <- merge(out, unique(bgexposure@output[c("Iter","Background")]))
 +
    out$Result <- 1
 +
    return(out)
 +
  }
 +
)
  
t0.5 <- Ovariable("t0.5", data = solet[solet$Muuttuja == "TEQ-puoliintumisaika" , ]["Result"])
+
info <- EvalOutput(info)
f_ing <- Ovariable("f_ing", data = solet[solet$Muuttuja == "TEQ-imeytymisosuus" , ]["Result"])
 
f_mtoc <- Ovariable("f_mtoc", data = solet[solet$Muuttuja == "TEQ-osuus lapseen" , ]["Result"])
 
BF <- Ovariable("BF", data = solet[solet$Muuttuja == "Imeväisen rasvamäärä" , ]["Result"])
 
BF <- EvalOutput(BF) # LISÄTTY 13.3.
 
temp <- exposure
 
temp@output <- temp@output[temp@output$Exposure_agent == "TEQ" , ]
 
temp <- log((temp * t0.5 * f_ing * f_mtoc / (log(2) * BF) ) + 1) # Actual conversion
 
temp@output$Exposure_agent <- "logTEQ"
 
temp <- unkeep(temp, prevresults = TRUE, sources = TRUE)
 
exposure@output <- orbind(exposure, temp)
 
exposure <- unkeep(exposure, prevresults = TRUE, sources = TRUE)
 
  
frexposed <- 1
+
exposure <- Ovariable(
bgexposure <- addexposure
+
  "exposure",
date()
+
  dependencies = data.frame(
######################################################### VÄESTÖ
+
    Name = c(
 +
      "expoRaw",
 +
      "dx.expo.child",
 +
      "info"
 +
    ),
 +
    Ident = c(
 +
      NA,
 +
      "Op_en7797/initiate", # [[Infant's dioxin exposure]]
 +
      NA
 +
    )
 +
  ),
 +
  formula = function(...) {
 +
    expoRaw$Exposure <- NA
 +
    dx.expo.child$Exposure <- "To child"
 +
    out <- combine(expoRaw, dx.expo.child)
 +
    out <- unkeep(out, sources=TRUE, prevresults=TRUE)
 +
    return(out * info + 1E-6)
 +
  }
 +
)
  
# Tarkastellaan totcases-laskennassa aluksi yksilöriskiä, ja vasta lopussa kerrotaan yksilötulokset yksilöiden edustamien ryhmien koolla.
+
# Limit the infant health responses to 10 % of females at age 18-45 a
 +
# (assuming 10 % probability to give birth during a year)
  
population <- Ovariable("population", data = data.frame(Result = 1))
+
frexposed <- Ovariable(
 +
  "frexposed",
 +
  dependencies = data.frame(Name = c("jsp","exposure")),
 +
  formula = function(...) {
 +
    out <- merge(
 +
      unique(jsp@output[c("Gender", "Ages", "Country", "Iter")]),
 +
      unique(exposure@output["Exposure"])
 +
    )
 +
    out$Result <- ifelse(
 +
      out$Exposure == "To child",
 +
      ifelse(
 +
        out$Gender == "Female" & out$Ages == "18-45",
 +
        0.1, # Probability of birth during a year.
 +
        0
 +
      ),
 +
      1
 +
    )
 +
    out$Result[is.na(out$Result)] <- 1
 +
    return(Ovariable(output=out, marginal = !colnames(out) %in% "Result")) # Marginal setting does not work
 +
  }
 +
)
 +
Sys.time()
 +
frexposed <- EvalOutput(frexposed)
  
# Väkimäärä. TÄTÄ KÄYTETÄÄN disincidence-ovariablen suhteuttamisessa CHD:n suhteen.
+
ERFchoice <- Ovariable(
 
+
  "ERFchoice",
#!!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
  ddata = "Op_en7748", # [[Benefit-risk assessment of Baltic herring and salmon intake]]
pop <- opbase.data("Op_en2949") # [[Population of Finland]]
+
  subset = "Exposure-response functions of interest"
#ii+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
)
 
 
pop$Obs <- NULL
 
pop$Observation <- NULL
 
age <- pop$Result[pop$Age == "0-4"]
 
pop$Result[pop$Age == "0-4"] <- 4/5 * age
 
pop <- orbind(pop, data.frame(Age = "0", Result = 1/5 * age))
 
levels(pop$Age)[levels(pop$Age) == "0-4"] <- "1-4"
 
pop <- Ovariable("pop", data = pop)
 
date()
 
###############################################################################################
 
# ANNOSVASTEET JA TAUTIRISKIT
 
# dioksiinille,
 
# omega-3-rasvahapoille,
 
# vitamiineille (D-vitamiinille)
 
# ja metyylielohopealle ja niiden vaikutuksille
 
# Kuitenkaan metyylielohopeapitoisuuksia ei ole tässä malliversiossa, joten ne tippuvat pois.
 
 
 
# Annosvasteet
 
 
 
#!!+++++++++++++++++++++++ THIS CODE REPLACES ALL POLLUTANT-SPECIFIC CODES:
 
objects.latest("Op_en2031", code_name = "initiate") # [[Exposure-response function]]
 
 
 
#!!++++++++++++++++++++++++++++++++++++++++++++++++++
 
#objects.latest("Op_en5823", code_name = "initiate") # [[ERF of dioxin]], ovariables ERF, threshold
 
#ii++++++++++++++++++++++++++++++++++++++++++++++++++
 
 
 
#temp1 <- ERF
 
#temp2 <- threshold
 
 
 
#!!++++++++++++++++++++++++++++++++++++++++++++++++++
 
#objects.latest("Op_en5830", code_name = "initiate") # [[ERF of omega-3 fatty acids]], ovariables ERF, threshold
 
#ii++++++++++++++++++++++++++++++++++++++++++++++++++
 
 
 
#temp1@data <- orbind(ERF@data, temp1@data)
 
#temp2@data <- orbind(threshold@data, temp2@data)
 
  
#!!++++++++++++++++++++++++++++++++++++++++++++++++++
+
objects.latest("Op_en2031", code_name = "initiate") # Default ERF but needs adjustment.
#objects.latest("Op_en6866", code_name = "initiate") # [[ERFs of vitamins]], ovariables ERF, threshold
 
#ii++++++++++++++++++++++++++++++++++++++++++++++++++
 
  
#temp1@data <- orbind(ERF@data, temp1@data)
+
ERF <- EvalOutput(ERF)
#temp2@data <- orbind(threshold@data, temp2@data)
+
Sys.time()
 +
ERF <- ERF[ , !colnames(ERF@output) %in% c("Age","Sex","Source")]
 +
levels(ERF$Exposure)[levels(ERF$Exposure) %in% c(
 +
  "Ingestion etc. (as it was in Seveso) as log(TCDD serum concentration+1) in fat",
 +
  "Maternal intake through placenta"
 +
)] <- "To child"
  
#!!++++++++++++++++++++++++++++++++++++++++++++++++++
+
threshold <- EvalOutput(threshold)
#objects.latest("Op_en5825", code_name = "initiate") # [[ERF of methylmercury]], ovariables ERF, threshold
+
threshold <- threshold[ , !colnames(threshold@output) %in% c("Age","Sex","Source")]
#ii++++++++++++++++++++++++++++++++++++++++++++++++++
+
levels(threshold$Exposure)[levels(threshold$Exposure) %in% c(
 +
  "Ingestion etc. (as it was in Seveso) as log(TCDD serum concentration+1) in fat",
 +
  "Maternal intake through placenta"
 +
)] <- "To child"
  
#ERF@data <- orbind(ERF@data, temp1@data)
+
cat("Exposure-responses of interest.\n")
#threshold@data <- orbind(threshold@data, temp2@data)
+
oprint(ERFchoice@output)
  
# Drop ERF rows that are not used in this assessment.
+
# Default dose but adjustments are needed before use.
 +
objects.latest("Op_en2261", code_name = "dose")
 +
dose <- unkeep(EvalOutput(dose), sources = TRUE, prevresults = TRUE)
 +
Sys.time()
 +
######################################################### POPULATION
  
erfpois <- paste(ERF@data$Exposure_agent, ERF@data$Trait, ERF@data$ERF_parameter, ERF@data$Scaling) %in%
+
population <- Ovariable(
  c(
+
  "population",  
    "MeHg Child's IQ ERS BW",
+
  data = data.frame(
    "DHA Child's intelligence ERS BW",
+
    Country = rep(c("DK",  "EST", "FI", "SWE"), each = 4),
    "Omega3 Coronary heart disease RR None",
+
     Gender = rep(c("Male","Female"), each=2, times=2),
     "Omega3 CHD Relative Hill None",
+
     Ages = rep(c("18-45",">45"),4),
    "logTEQ Developmental dental defects incl. agenesis ERS None",
+
     Result = rep(c(1200000, 250000, 1350000, 2000000), each = 4)
     "TEQ Cancer, total CSF BW",
 
     "logTEQ Tooth defect ERS None" # Poistetaan Seveso koska suomalainen ERF uskottavampi
 
 
   )
 
   )
ERF@data <- ERF@data[!erfpois , ]
+
)
  
# Drop nuisance indices because they use a lot of memory in oapply.
+
mc2dparam<- list(
dropp <- c("Response_metric", "Exposure_route", "Exposure_metric", "Exposure_unit")
+
  N2 = 100, # Number of iterations in the new Iter
ERF <- unkeep(EvalOutput(ERF), dropp, sources = TRUE)
+
  run2d = TRUE, # Should the mc2d function be used or not?
threshold <- unkeep(EvalOutput(threshold), dropp, sources = TRUE)
+
  newmarginals = c("Gender", "Ages", "Country"), # Names of columns that are non-marginals but should be sampled enough to become marginals
 
+
  method = "bootstrap", # which method to use for 2D Monte Carlo? Currently bootsrap is the only option.
 
+
  fun = mean # Function for aggregating the first Iter dimension.
######################################## Tautiriski
+
)
#!!++++++++++++++++++++++++++++++++++++++++++++++++++
 
objects.latest("Op_en5917", code_name = "initiate") # [[:op_en:Disease risk]] ovariable disincidence
 
#ii++++++++++++++++++++++++++++++++++++++++++++++++++
 
  
disincidence <- EvalOutput(disincidence) # TEMPORARY 13.3.
+
objects.latest("Op_en2261", code_name="RR") # Default RR but has to be adjusted before use.
 +
RR <- EvalOutput(RR)
 +
RR@marginal <- RR@marginal | colnames(RR@output) %in% mc2dparam$newmarginals
  
disincidence <- disincidence / 100000 # Change from 1/100000py to 1/py.
+
objects.latest("Op_en2261", code_name="casesabs") # Has to be adjusted before use.
disincidence <- unkeep(disincidence, cols = c("Age", "Sex", "Population", "Unit", "Response_metric"))
+
casesabs <- EvalOutput(casesabs)
# Näitä indeksejä ei tarvita tässä arvioinnissa.
+
casesabs@marginal <- casesabs@marginal | colnames(casesabs@output) %in% mc2dparam$newmarginals
disincidence@output <- disincidence@output[disincidence@output$Response != "CHD" , ] # Tulee ikävakioidusta alta.
 
  
############################################################################
+
disabilityweight <- Ovariable(
# Ikävakioidut kuolemansyyt
+
   "disabilityweight",
 
+
   ddata = "Op_en7748",
# Sairastuvuus (tarkemmin sanottuna [[Kuolemansyyt Suomessa]])
+
  subset = "DALYs of responses"
#!!++++++++++++++++++++++++++++++++++++++++++++++++++++
 
syy <- Ovariable(
 
   "syy",  
 
   data = opbase.data(
 
    "Op_fi4558",  
 
    subset = "2012",
 
    include = list(Kuolemansyy = c(
 
      "04-21 Syövät (C00-C97)",
 
      "27 Iskeemiset sydäntaudit (I20-I25)",
 
      "29 Aivoverisuonien sairaudet (I60-I69)"
 
    )
 
    )
 
  )
 
 
)
 
)
  
#ii++++++++++++++++++++++++++++++++++++++++++++++++++++
+
duration <- 1
syy@data$Ikä <- gsub(" ", "", syy@data$Ikä)
 
colnames(syy@data)[colnames(syy@data) == "Ikä"] <- "Age"
 
 
 
# Syöpää ei haluta linkata ikäryhmittäin ERF:iin, vaan sitä käytetään muodostamaan diskontattu elinaikainen
 
# odotettu eliniän menetys jos kuolee syöpään tietyn ikäisenä. Ks. myöhemmin.
 
  
väli <- Ovariable(output = data.frame(
+
objects.latest("Op_en7422", code_name="BoD")
  Kuolemansyy = c(
 
    rep("27 Iskeemiset sydäntaudit (I20-I25)", 2),
 
    "04-21 Syövät (C00-C97)",
 
    "29 Aivoverisuonien sairaudet (I60-I69)"
 
  ),
 
  Response = c("CHD", "CHD2", "Syövät", "Stroke"), # Syövät nimetään hassusti, koska sen EI haluta linkkautuvan ERF:iin.
 
  # Lisäksi Tehdään kaksinkertainen sydäntaululistaus, koska on kaksi ERFiä: Mozaffarian ja Cohen.
 
  Result = 1
 
))
 
  
pop <- EvalOutput(pop)
+
BoD <- EvalOutput(BoD, verbose = TRUE) # Fetches all objects
  
syyt <- syy / (pop / 2) * väli # Pop ei ole sukupuolen mukaan jaoteltu mutta syy on, joten pistetään kahtia.
+
#BoDcase <- unkeep(EvalOutput(BoDcase), sources = TRUE) # Removes NA indices
 +
# To avoid double counting, these responses must be removed.
 +
#BoDcase <- BoDcase[!BoDcase$Resp %in% c("Stroke", "Heart (CHD)") , ]
 +
#
 +
#BoD <- EvalOutput(BoD) # Re-evaluate BoD without double counting
  
disincidence <- disincidence * Ovariable(output = data.frame(Result = 1), marginal = FALSE)
+
objects.latest("Op_en6007", code_name="diagnostics")
marginals <- union(colnames(syyt@output)[syyt@marginal], colnames(disincidence@output)[disincidence@marginal])
+
Sys.time()
syyt@output <- orbind(disincidence, syyt)
+
oprint(showLoctable())
syyt@marginal <- colnames(syyt@output) %in% marginals
+
oprint(showind())
syyt <- unkeep(syyt, cols = c("Kuolemansyy", "Observation"), prevresults = TRUE, sources = TRUE)
 
syyt@output$Sukupuoli[syyt@output$Sukupuoli == "Miehet"] <- "Mies" # Ei ole faktori vaan character
 
syyt@output$Sukupuoli[syyt@output$Sukupuoli == "Naiset"] <- "Nainen"
 
  
disincidence <- syyt # Nyt sisältää sekä alkuperäisen disincidencen että ikäluokittaisen CHD:n
+
rm(wiki_username)
date()
 
###################################################################################
 
#### HIA-ovariablet
 
  
#!!++++++++++++++++++++++++++++++++++++++++++++++++++
+
objects.store(list=ls())
objects.latest("Op_en2261", code_name = "initiate") # [[:op_en:Health impact assessment]] ovariables dose, RR, totcases (AF)
+
cat("Ovariables", ls(), "stored.\n")
#ii++++++++++++++++++++++++++++++++++++++++++++++++++
+
Sys.time()
 +
</rcode>
  
dose <- unkeep(EvalOutput(dose), prevresults = TRUE, sources = TRUE)
+
==== Second part ====
  
RR <- unkeep(EvalOutput(RR), prevresults = TRUE, sources = TRUE)
+
* Model run 4.6.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=ERtBoA0X8McFJppE]
 +
* Model run 11.6.2017 with 2D Monte Carlo [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=UltzattYWmXPSaRr]
  
totcases <- EvalOutput(totcases)
+
<rcode graphics=1>
date()
+
# This is code Op_en7748/ on page [[Benefit-risk assessment of Baltic herring and salmon intake]]
 +
library(OpasnetUtils)
 +
library(ggplot2)
  
ggplot(totcases@output, aes(x = Response, weight = totcasesResult, fill = Sukupuoli))+
+
objects.latest("Op_en7748", code_name="hia") #  [[Benefit-risk assessment of Baltic herring and salmon intake]]
  geom_bar()
 
  
oprint(showLoctable())
+
cat("Units:", conc@meta$units, "\n")
 +
oprint(summary(conc,fun=c("length","mean","sd")))
 +
cat("Units: g/day\n")
 +
oprint(summary(exposure, marginal=c("Exposure", "Exposure_agent", "Country","Background"), fun=c("length","mean","sd")))
 +
oprint(summary(exposure[is.na(exposure$Exposure),], marginal=c("Exposure_agent", "Country","Background"), fun=c("length","mean","sd")))
 +
oprint(summary(RR,fun=c("length","mean","sd")))
 +
oprint(summary(casesrr,fun=c("length","mean","sd")))
 +
oprint(summary(casesabs,fun=c("length","mean","sd")))
 +
oprint(summary(BoDpaf,fun=c("length","mean","sd"))[-5])
 +
oprint(summary(BoDcase,fun=c("length","mean","sd"))[-4])
 +
oprint(summary(BoD,fun=c("length","mean","sd"))[-5])
  
##################################################################################
+
ggplot(conc@output, aes(x=concResult, colour=Exposure_agent))+stat_ecdf()+
# Tapauskohtaiset postprosessoinnit
+
  facet_wrap(~Fish)+scale_x_log10()
  
if(FALSE) {
+
ggplot(conc@output[conc$Fish %in% c("Herring", "Salmon"), ], aes(x=concResult, colour=Exposure_agent))+stat_ecdf()+
 
+
   facet_wrap(~Fish)+scale_x_log10()
### Muutetaan exposure yksikköön g /d kaikkien Exposure_agentien osalta.
 
skaala <- Ovariable(
 
  output = data.frame(
 
    Exposure_unit = "g /d",
 
    Exposure_agent = c("Vitamin_D", "EPA", "DHA", "Omega3", "PCDDF", "PCB", "TEQ", "MeHg"),
 
    Result = c(1E-6, 1E-3, 1E-3, 1E-3, 1E-12, 1E-12, 1E-12, 1E-6)),
 
   marginal = c(FALSE, TRUE, FALSE)
 
)
 
  
tiedot <- rivit * taustat * Ovariable(
+
ggplot(amount@output, aes(x=amountResult, colour=Country))+stat_ecdf()+
  output = data.frame(
+
  facet_wrap(~Fish, scales="free")+scale_x_log10()
    silakka[c("Rivi", "Sukupuoli", "Age", "Hedelm", "Ikä", "Paino", "Silakkamäärä")],
 
    Result = 1
 
  ),
 
  marginal = c(FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE)
 
)
 
tiedot <- unkeep(tiedot, cols = "Rivi", prevresults = TRUE, sources = TRUE)
 
  
date()
+
ggplot(exposure@output[is.na(exposure$Exposure) & result(exposure)>0.01,], aes(x = exposureResult, colour=Country))+
 +
  stat_ecdf() + scale_x_log10() + theme_gray(base_size = 18)+
 +
  facet_wrap(~ Exposure_agent, scales="free")+labs(title = "Exposure (DX: pg/d, O3: mg/d, VD: ug/d)")
  
exposure <- exposure * skaala * tiedot
+
ggplot(exposure@output[!is.na(exposure$Exposure) & result(exposure)>0.01,], aes(x = exposureResult, colour=Country))+
amount <- amount * tiedot
+
  stat_ecdf() + scale_x_log10() + theme_gray(base_size = 24)+
concentration <- unkeep(concentration, prevresults = TRUE, sources = TRUE) * skaala
+
  facet_wrap(~ Exposure_agent, scales="free")+labs(title = "Exposure breast feeding (DX: log(pg/g) fat in child)")
  
#Etsitään hedelmällisessä iässä olevat naiset ja lasten ÄO-vaste ja korjataan synnytyksen todennäköisyydellä.
+
ggplot(BoD@output, aes(x=Response, weight=BoDResult/openv$N, fill=Response))+geom_bar()+coord_flip()
  
indivrisk <- totcases
+
ggplot(BoD@output, aes(x=BoDResult, colour=Response))+stat_ecdf()+
 +
  scale_x_log10()
  
indivrisk <- indivrisk * tiedot
+
ggplot(ERF@output, aes(x=ERFResult, colour=Exposure_agent))+stat_ecdf()+
 +
  facet_wrap(~ Response, scales = "free_x")
  
result(indivrisk) <- result(indivrisk) * ifelse(
+
ggplot(casesabs@output, aes(x=casesabsResult, colour=Response))+stat_ecdf()+
  indivrisk@output$Trait %in% c("Child's IQ", "Tooth defect", "Dental defect"),
+
   scale_x_log10()
  ifelse(
 
    indivrisk@output$Sukupuoli == "Nainen" & indivrisk@output$Hedelm == "TRUE",
 
    0.1, # Probability of birth during a year.
 
    0
 
  ),
 
   1
 
)
 
  
#ages <- c(
+
ggplot(casesrr@output, aes(x=casesrrResult, colour=Response))+stat_ecdf()+
# "0", "1-4", "5-9", "10-14", "15-19", "20-24",
+
  scale_x_log10()
# "25-29", "30-34", "35-39", "40-44", "45-49", "50-54",
 
# "55-59", "60-64", "65-69", "70-74", "75-79"
 
#)
 
indivrisk@output$Age <- factor(indivrisk@output$Age, levels = ages, ordered = TRUE)
 
  
indivrisk@output$Iter <- as.numeric(as.character(indivrisk@output$Iter))
+
ggplot(BoDcase@output, aes(x=BoDcaseResult, colour=Response))+stat_ecdf()+
 +
  scale_x_log10()
  
#!!+++++++++++++++++++++++++++++++++++++++++++++++++
+
ggplot(BoDpaf@output, aes(x=BoDpafResult, colour=Response))+stat_ecdf()+
objects.store(indivrisk, pop, exposure, amount, ERF, threshold, silakka, disincidence, concentration, rivit)
+
  scale_x_log10()
#ii+++++++++++++++++++++++++++++++++++++++++++++++++
 
cat("indivrisk, pop, exposure, amount, ERF, threshold, silakka, disincidence, concentration, rivit stored. \n")
 
date()
 
  
####################################3
+
odag()
 
 
for(i in c("RR", "disincidence", "totcases", "ERF", "threshold")) {
 
  print(levels(get(i)@output$Response))
 
}
 
} # if(FALSE)
 
 
</rcode>
 
</rcode>
  

Latest revision as of 13:41, 8 September 2017



Scope

This assessment is part of the WP5 work in Goherr project. Purpose is to evaluate health benefits and risks caused of eating Baltic herring and salmon in four Baltic sea countries (Denmark, Estonia, Finland and Sweden). This assessment is currently on-going.

Question

What are the current population level health benefits and risks of eating Baltic herring and salmon in Finland, Estonia, Denmark and Sweden? How would the health effects change in the future, if consumption of Baltic herring and salmon changes due to actions caused by different management scenarios of Baltic sea fish stocks?

Intended use and users

Results of this assessment are used to inform policy makers about the health impacts of fish. Further, this assessment will be combined with the results of the other Goherr WPs to produce estimates of future health impacts of Baltic fish related to different policy options. Especially, results of this assessment will be used as input in the decision support model built in Goherr WP6.

Participants

  • National institute for health and welfare (THL)
  • Goherr project group

Boundaries

  • Four baltic sea countries (Denmark, Estonia, Finland, Sweden)
  • Current situation (fish use year 2016, pollutant levels in fish year 2010)
  • Estimation for future (not year specific)

Decisions and scenarios

Management scenarios developed in Goherr WP3 frames the following boundaries to the use and consumption of Baltic herring and salmon as human food. Effect of these scenarios to the dioxin levels and the human food use will be evalauted quantitatively and feed into the health benefit-risk model to assess the health effect changes.

  • Scenario 1: “Transformation to sustainability”
    • Hazardous substances, including dioxins, are gradually flushed out and the dioxin levels in Baltic herring are below or close to the maximum allowable level.
    • Fish stocks are allowed to recover to levels, which makes maximum sustainable yield possible and increases the total catches of wild caught fish. The catches of salmon by commercial fisheries has stabilized at low level, while the share of recreational catch increases slightly.
    • The use of the Baltic herring catch for food increases. A regional proactive management plan for the use of catch has increased the capacity of the fishing fleets to fish herring for food and through product development and joint marketing, have increased consumer demand for Baltic herring.
  • Scenario 2: “Business-as-usual”
    • The commercial catches of salmon continue to decrease. The demand for top predatory species, such as salmon and cod remains high, while the demand for herring decreased further as a result of demographic changes.
    • Most of the herring catch are used for fish meal and oil production in the region.
    • The use of Baltic herring from the southern parts of the Baltic Sea where the dioxin contents are not likely to exceed the maximum allowable level, are prioritised for human consumption. In the absence of the demand in many of the Baltic Sea countries, majority of the herring intended for direct human consumption are exported to Russia.
  • Scenario 3: “Inequality”
    • The nutrient and dioxins levels continue to decrease slowly.
    • The commercial catches of salmon have decreased further as the general attitudes favour recreational fishing, which has also resulted in decreased demand.
    • The herring catches have increased slightly, but the availability of herring suitable for human consumption remains low due to both, dioxin levels that remain above the maximum allowable limit in the northern Baltic Sea and the poor capacity to fish for food.
    • The use of the catch varies between countries. In Estonia, for example, where the whole catch has been traditionally used for human consumption, there is no significant change in this respect, but in Finland, Sweden and Denmark, herring fishing is predominantly feed directed.
  • Scenario 4: “Transformation to protectionism”
    • The level of hazardous substances also increases as emission sources are not adequately addressed.
    • Commercial salmon fisheries disappears almost completely from the Baltic Sea, although restocking keeps small scale fisheries going.
    • Many of the Baltic herring stocks are also fished above the maximum sustainable yield and total catches are declining.
    • Owing to the growing dioxin levels detected in herring, majority of the catch is used for aquaculture.

Timing

  • Model development during 2016 and 2017
  • First set of results in March 2017, draft publication in March 2018

Answer

This section will be updated as soon as preliminary results are available

Results

Conclusions

Rationale

Error creating thumbnail: Unable to save thumbnail to destination
Schematic picture of the health benefit-risk model for Baltic herring and salmon intake.
Error creating thumbnail: Unable to save thumbnail to destination
Detailed modelling diagram of the health benefit-risk model. Green nodes are original data, red nodes are based on scientific literature, and blue nodes are computational nodes. Those with a number are generic nodes designed to be used in several assessments. the number refers to the page identifier in Op_en wiki (this Opasnet wiki).

Stakeholders

  • Policy makers
    • Food safety authorities
    • Fisheries management
  • Researchers
    • Food safety
    • Health
  • NGO's
    • WWF
    • Active consumers
    • Marine Stewardship Council
  • Baltic sea fishers and producers?

Dependencies

Calculation of cases of disease

Calculation of DALYs:

Background exposure(-)
ObsBackgroundCountryGenderExposure_agentResultUnitDescription
1YesFIMaleVitamin D11.7µg /dFinriski 12 - 0.3 silakasta
2YesSWEMaleVitamin D11.7µg /dFinriski 12 - 0.3 silakasta
3YesESTMaleVitamin D11.7µg /dFinriski 12 - 0.3 silakasta
4YesDKMaleVitamin D11.7µg /dFinriski 12 - 0.3 silakasta
5YesFemaleVitamin D8.5µg /dFinriski 8.7 - 0.2 silakasta
6YesMaleEPA120mg /dFinriski 125 - 4.6 silakasta
7YesFemaleEPA96mg /dFinriski 100 - 3.9 silakasta
8YesMaleDHA118mg /dFinriski 125 - 6.7 silakasta
9YesFemaleDHA94mg /dFinriski 100 - 5.4 silakasta
10YesPCDDF0pg /d (TEQ)
11YesPCB0pg /d (TEQ)
12YesMeHg0µg /d
13YeslogTEQ0log(pg /g)
14No0
Exposure-response functions of interest(-)
ObsExposure_agentRespResponseER_functionScalingDummy
1TEQTooth defectYes or no dental defectERSNone1
2TEQCancerCancer morbidityCSFBW1
3TEQDioxin TDIDioxin recommendation tolerable daily intakeTDIBW1
4DHAChild's IQLoss in child's IQ pointsERSNone1
5Omega3Heart (CHD)CHD2 mortalityRelative HillNone1
6Omega3StrokeStroke mortalityRelative HillNone1
7Vitamin DVitamin D intakeVitamin D recommendationStepNone1
8MeHgChild's IQLoss in child's IQ pointsERSBW1
DALYs of responses(DALY /case)
ObsRespDALYDescription
1Heart (CHD)5 - 15Assumes DW 1 and D 10 U 50%
2Stroke5 - 15Assumes DW 1 and D 10 U 50 %
3Tooth defect0 - 0.12DW 0.001 D 60 U 100 %. Or should we use this: Developmental defect: caries or missing tooth, 0.008 (0.003 - 0.017), Periodontitis weight from IHME. D: 1. U from IHME?
4Cancer0 - 0.28DW 0.1 D 20, in addition loss of life expectancy 5 a. This comes from a lifetime exposure, so it is (linearly( assumed that 1/50 of this is caused by one-year exposure. U 100 %
5Vitamin D intake0.0001 - 0.0101DW 0.001 D 1 U 101x. 1 if not met
6Dioxin TDI0.0001 - 0.0101DW 0.001 D 1 U 101x. 1 if not met
7Child's IQ-0.0517 (-0.03 - -0.0817)Intellectual disability, mild (IQ<70): 0.031 (0.018-0.049) From IHME. D 50 U from IHME.
DW = disability weight
D = duration (a)
U = uncertainty

Analyses

Indices

  • Country (Denmark, Estonia, Finland, Sweden)
  • Year (current, future)
  • Gender
  • Age: 18-45 years or >45 years
  • Fish species (Baltic herring, Baltic salmon)
  • Health end-point, specified by name
  • Compound: TEQ (PCDD/F and PCB), Vitamin D, Omega3 (includes EPA and DHA), MeHg

Calculations

This section will have the actual health benefit-risk model (schematically described in the above figure) written with R. The code will utilise all variables listed in the above Dependencies section. Model results are presented as tables and figures when those are available.

  • 18.5.2017: Archived exposure model Op7748/exposure by Arja (used separate ovariables for salmon and herring) [1]

Health impact model (Monte Carlo)

  • Model run 13.3.2017: a simple copy of op_fi:Silakan hyöty-riskiarvio [2]
  • Model run 13.3.2017 with showLocations function [3]
  • Model run 13.3.2017 produces totcases results but are not meaningful yet [4]
  • Model run 14.3.2017 with exposure graph [5]
  • Model run 14.3.2017 bugs not fixed [6]
  • Model run 30.5.2017 [7]
  • Model run 12.6.2017 with 2D Monte Carlo [8]
  • Model run 8.9.2017 with known bugs fixed [9]

+ Show code

Second part

  • Model run 4.6.2017 [10]
  • Model run 11.6.2017 with 2D Monte Carlo [11]

+ Show code

Plot concentrations and survey

  • Requires codes Op_en7748/bayes and indirectly Op_en7748/preprocess.
  • Model run 1.3.2017 [12]

+ Show code

References


Keywords

See also

Goherr Research project 2015-2018: Integrated governance of Baltic herring and salmon stocks involving stakeholders
Error creating thumbnail: Unable to save thumbnail to destination
Goherr public website

Workpackages including task description and follow-up:
WP1 Management · WP2 Sociocultural use, value and goverrnance of Baltic salmon and herring · WP3 Scenarios and management objectives · WP4 Linking fish physiology to food production and bioaccumulation of dioxin · WP5 Linking the health of the Baltic Sea with health of humans: Dioxin · WP6 Building a decision support model for integrated governance · WP7 Dissemination

Other relevant pages in Opasnet: GOHERR assessment · Relevant literature

Relevant data: Exposure response functions of dioxins · Fish consumption in Sweden · POP concentrations in Baltic sea fish · Exposure response functions of Omega3 fatty acids

Relevant methods: Health impact assessment · OpasnetBaseUtils‎ · Modelling in Opasnet

Relevant assessments: Benefit-risk assessment of Baltic herring · Benefit-risk assessment on farmed salmon · Benefit-risk assessment of methyl mercury and omega-3 fatty acids in fish · Benefit-risk assessment of fish consumption for Beneris · Benefit-risk assessment of Baltic herring (in Finnish)

Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination

http://www.bonusportal.org/ http://www.bonusprojects.org/bonusprojects

Related files