Difference between revisions of "EU-kalat"

From Testiwiki
Jump to: navigation, search
(Calculations)
(Calculations: bayes model moved to Goherr: Fish consumption study)
Line 58: Line 58:
 
=== Calculations ===
 
=== Calculations ===
  
Model run 25.1.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=wzisMQHAqcF30zcl]
+
* Preprocess model 22.2.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=p53h4gxtFfDMOtHz]
 +
* Model run 25.1.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=wzisMQHAqcF30zcl]
  
<rcode graphics=1>
+
<rcode name="preprocess" label="Preprocess" graphics=1>
# This is code Op_en3104/ on page [[EU-kalat]]
+
# This is code Op_en3104/preprocess on page [[EU-kalat]]
 
library(rjags)
 
library(rjags)
 
library(OpasnetUtils)
 
library(OpasnetUtils)
Line 71: Line 72:
 
eu@output <- eu@output[c(1:4, 18, 19)] # THL code, Matrix, Congener, Fish species
 
eu@output <- eu@output[c(1:4, 18, 19)] # THL code, Matrix, Congener, Fish species
 
eu@marginal <- eu@marginal[c(1:4, 18, 19)]
 
eu@marginal <- eu@marginal[c(1:4, 18, 19)]
eu@output <- eu@output[result(eu) != 0 , ] # Zeros cannot be used in ratio estimates
+
colnames(eu@output) <- c("THLcode", "Matrix", "Congener", "Fish", "euResult", "euSource")
colnames(eu@output)[colnames(eu@output) == "POP"] <- "Congener"
 
colnames(eu@output)[colnames(eu@output) == "Fish_species"] <- "Fish"
 
  
 
#> unique(eu@output$Congener)
 
#> unique(eu@output$Congener)
Line 95: Line 94:
 
eut <- eu
 
eut <- eu
 
eut@output <- eut@output[
 
eut@output <- eut@output[
   eut@output$Congener == "2378TCDD" & eut@output$Matrix == "Muscle" , ]
+
   eut@output$Congener == "2378TCDD" & eut@output$Matrix == "Muscle" & result(eut) != 0 , ] # Zeros cannot be used in ratio estimates
 
eut@output$Congener <- NULL
 
eut@output$Congener <- NULL
 
eut@marginal[colnames(eut@output) == "Congener"] <- NULL
 
eut@marginal[colnames(eut@output) == "Congener"] <- NULL
Line 112: Line 111:
 
#8 Baltic herrings, 8 sprats, 3 rainbow trouts.
 
#8 Baltic herrings, 8 sprats, 3 rainbow trouts.
 
# Conclusion: this is ok. Total 2292 rows.
 
# Conclusion: this is ok. Total 2292 rows.
 +
 +
ggplot(eu@output, aes(x = euResult, colour = Fish))+geom_density()+
 +
  facet_wrap(~ Congener) + scale_x_log10()
  
 
ggplot(eut, aes(x = Result, colour = Fish))+geom_density()+
 
ggplot(eut, aes(x = Result, colour = Fish))+geom_density()+
 
   facet_wrap(~ Congener)  
 
   facet_wrap(~ Congener)  
  
modf <- textConnection("
+
objects.store(eu,eut)
  model{
+
cat("Ovariable eu and data.frame eut stored.\n")
    for(i in 1:N) { # i = observation
 
      eutt[i] ~ dnorm(mu[con[i],fis[i]], tau[con[i],fis[i]])
 
    }
 
    for(j in 1:J) { # j = congener
 
      for(k in 1:K) { # k = fish species
 
        mu[j,k] ~ dunif(-3,3)
 
        tau[j,k] <- pow(sigma[j,k], -2)
 
        sigma[j,k] ~ dunif(0, 10)
 
        pred[j,k] ~ dnorm(mu[j,k], tau[j,k]) # Model prediction
 
      }
 
    }
 
  }
 
")
 
 
 
# A binomial distribution is assumed for bins of answer choices.
 
jags <- jags.model(
 
  modf,
 
  data = list(
 
    N = nrow(eut),
 
    J = length(conl),
 
    K = length(fisl),
 
    eutt = eut$Result,
 
    con = match(eut$Congener, conl),
 
    fis = match(eut$Fish, fisl)
 
  ),
 
  n.chains = 4,
 
  n.adapt = 100
 
)
 
 
 
update(jags, 1000)
 
 
 
samps <- jags.samples(jags, c('mu', 'pred'), 1000)
 
pl <- melt(array(samps$pred, dim = c(length(conl), length(fisl), 1000, 4),
 
  dimnames = list(
 
  Congener = conl,
 
  Fish = fisl,
 
  Iter = 1:1000,
 
  Seed = 1:4
 
  )
 
))
 
 
 
ggplot(pl, aes(x = value, colour = Fish))+geom_density(size = 1) +
 
  facet_wrap(~ Congener, scale = "free_y") + coord_cartesian(xlim = c(-1.5,1.5))
 
 
 
ggplot(pl[pl$Fish %in% c("Baltic herring", "Rainbow trout", "Pike-perch", "Pike", "Salmon", "Sprat") , ], aes(x = value, colour = Fish))+geom_density(size = 1) +
 
  facet_wrap(~ Congener, scale = "free_y") + coord_cartesian(xlim = c(-1.5,1.5))
 
 
 
samps.coda <- coda.samples(jags, c('mu', 'pred'), 1000)
 
 
 
out <- data.frame(
 
  Congener = conl,
 
  Fish = rep(fisl, each = length(conl)),
 
  Param = rep(c("mu", "pred"), each = length(conl)*length(fisl)),
 
  Value = (summary(samps.coda)[[1]][,1])
 
)
 
 
 
oprint(out)
 
 
 
ggplot(out[out$Param == "mu", ], aes(x = Congener, y = Value, colour = Fish, group = Fish)) +
 
  geom_line() + labs(title = "Congener amounts in fish compared with TCDD", y = "Log_10 ratio")
 
 
 
if(FALSE){
 
  tef <- Ovariable("tef", ddata = "Op_en4017", subset = "TEF values")
 
  tef <- EvalOutput(tef)
 
 
 
  #levels(eu$Congener) <- gsub("HCDD", "HxCDD", levels(eu$Congener))
 
  #levels(eu$Congener) <- gsub("HCDF", "HxCDF", levels(eu$Congener))
 
  #levels(eu$Congener) <- gsub("CoPCB", "PCB", levels(eu$Congener))
 
  euteq <- eu * tef
 
} # IF FALSE
 
 
</rcode>
 
</rcode>
  

Revision as of 07:36, 22 February 2017


EU-kalat is a study, where concentrations of PCDD/Fs, PCBs, PBDEs and heavy metals have been measured from fish

Question

The scope of EU-kalat study was to measure concentrations of persistent organic pollutants (POPs) including dioxin (PCDD/F), PCB and BDE in fish from Baltic sea and Finnish inland lakes and rivers. [1] [2] [3].

Answer

The original sample results can be acquired from Opasnet base. The study showed that levels of PCDD/Fs and PCBs depends especially on the fish species. Highest levels were on salmon and large sized herring. Levels of PCDD/Fs exceeded maximum level of 4 pg TEQ/g fw multiple times. Levels of PCDD/Fs were correlated positively with age of the fish.

Mean congener concentrations as WHO2005-TEQ in Baltic herring can be printed out with the Run code below.

+ Show code

Rationale

Data

Data was collected between 2009-2010. The study contains years, tissue type, fish species, and fat content for each concentration measurement. Number of observations is 285.

There is a new study EU-kalat 3, which will produce results in 2016.

Calculations

  • Preprocess model 22.2.2017 [4]
  • Model run 25.1.2017 [5]

+ Show code

See also

References

  1. A. Hallikainen, H. Kiviranta, P. Isosaari, T. Vartiainen, R. Parmanne, P.J. Vuorinen: Kotimaisen järvi- ja merikalan dioksiinien, furaanien, dioksiinien kaltaisten PCB-yhdisteiden ja polybromattujen difenyylieettereiden pitoisuudet. Elintarvikeviraston julkaisuja 1/2004. [1]
  2. E-R.Venäläinen, A. Hallikainen, R. Parmanne, P.J. Vuorinen: Kotimaisen järvi- ja merikalan raskasmetallipitoisuudet. Elintarvikeviraston julkaisuja 3/2004. [2]
  3. Anja Hallikainen, Riikka Airaksinen, Panu Rantakokko, Jani Koponen, Jaakko Mannio, Pekka J. Vuorinen, Timo Jääskeläinen, Hannu Kiviranta. Itämeren kalan ja muun kotimaisen kalan ympäristömyrkyt: PCDD/F-, PCB-, PBDE-, PFC- ja OT-yhdisteet. Eviran tutkimuksia 2/2011. ISSN 1797-2981 ISBN 978-952-225-083-4 [3]