---
output: 
  html_document:
    css: help.css
    
params:
  compartment: sediment
---

```{r setup, include = FALSE, echo = FALSE}

library(knitr)
knit_engines$set(asis = function(options) {
  if (options$echo && options$eval) knit_child(text = options$code)
})

options(width = 110)

source("report functions.R")

load(file.path("meta analysis objects", "regional data.RData"))
assessment <- get(params$compartment)
```

## Screening of individual time series `r params$compartment`

<p class = "startsmall">
This document helps to screen the individual time series that will be used for the regional assessments by plotting:
</p>

<ul type = "disc">
<li>the individual time series estimates of trend and their standard errors</li>
<li class = "last">the corresponding estimates of mean concentration in the final monitoring year (relative to the EAC where one exists) and their standard errors</li>
</ul> 

<br>


### Trend estimates {.tabset}

<p class = "startsmall">
Here are individual time series estimates of trend.  The symbols in the plots have the following interpretation:
</p>

<ul type = "disc">
<li>downward triangle: the mean concentration is significantly decreasing (p < 0.05)</li>
<li>circle: there is no change in mean concentration (p > 0.05)</li>
<li class = "last">upward triangle: the mean concentration is significantly increasing (p < 0.05)</li>
</ul>

<p class = "botsmall">
Extreme % yearly changes in concentration should be questioned.  An 8% yearly change corresonds to a doubling or halving of concentrations in ten years, for example, so trends of more than 8% might be considered unlikely.
</p>

<br>


```{r include = FALSE}
out <- NULL
isTrend <- TRUE
estPlot <- TRUE
for (groupID in names(assessment)) {
  out <- c(out, knit_child('screening_by_group.Rmd'))
}
```

```{r, echo=FALSE, results="asis"}
cat(paste(out, collapse = '\n'))
```

<br>


### Trend standard errors {.tabset}

<p class = "startsmall">
And now for the standard errors on the trend estimates.  Positive / negative standard errors means that the trend estimates are positive / negative respectively. The symbols are the same as for the trend estimates.  Standard errors > 10 suggest suspiciously large variability in the data.  
</p>


```{r include = FALSE}
out <- NULL
estPlot <- FALSE
for (groupID in names(assessment)) {
  out <- c(out, knit_child('screening_by_group.Rmd'))
}
```

```{r, echo=FALSE, results="asis"}
cat(paste(out, collapse = '\n'))
```


### Status estimates {.tabset}

<p class = "startsmall">
Here are individual time series estimates of status.  The symbols in the plots have the following interpretation:
</p>

<ul type = "disc">
<li>blue: the mean concentration is significantly (p < 0.05) below the BAC</li>
<li>green: the mean concentration is significantly (p < 0.05) below the EAC (or equivalent)</li>
<li>orange: the estimate of the mean concentration is below the EAC, but not signficantly so (p > 0.05)</li>
<li class = "last">red: the estimate of the mean concentration is above the EAC</li>
</ul>

<p class = "botsmall">
Not much to look at here, unless it is very different from the rest. 
</p>

<br>


```{r include = FALSE}
out <- NULL
isTrend <- FALSE
estPlot <- TRUE
for (groupID in names(assessment)) {
  out <- c(out, knit_child('screening_by_group.Rmd'))
}
```

```{r, echo=FALSE, results="asis"}
cat(paste(out, collapse = '\n'))
```

<br>



### Status standard errors {.tabset}

<p class = "startsmall">
And now for the standard errors on the status estimates.  The symbols are coloured black to cover all the time series (because some AC are not available for some timeseries).  The standard errors are presented as approximate cvs (%).  Values > 50% suggest that something has gone badly awry.
</p>

<br>


```{r include = FALSE}
out <- NULL
isTrend <- FALSE
estPlot <- FALSE
for (groupID in names(assessment)) {
  out <- c(out, knit_child('screening_by_group.Rmd'))
}
```

```{r, echo=FALSE, results="asis"}
cat(paste(out, collapse = '\n'))
```

<br>
