### Regional status compared to the `r detAC` (`r detAClabel`) {.tabset}

<p class = "startsmall">
The first `r if (detFixedEffect) 3 else 4` tabs show:
</p>


```{r echo = FALSE, include = FALSE}
plottype <- "status"
```

```{r child = "meta_analysis_plottypes.rmd"}
```

<p class = "botsmall">
The symbols in all the plots have the following interpretation:
</p>

<ul type = "disc">
<li>blue: the mean concentration is significantly (p < 0.05) below the Background Assessment Concentration (BAC)</li>
<li>`r greenID`: the mean concentration is significantly (p < 0.05) below the `r detAClabel`</li>
```{asis, echo = params$compartment == "sediment" & params$detGroup == "PAH (parent)"}
<li>orange: there is no `r detAClabel` and the mean concentration is not significantly below the BAC</li>
```
<li class = "last">red: the estimate of the mean concentration is not significantly below the `r detAClabel`</li>
</ul>

<p class = "botbig">
Note that to see why some points are coloured blue, it is necessary to look ahead to the next section, where status is compared to the BAC.  Unfortunately, it isn't easy to present the assessment of status relative to the `r detAClabel` with the assessment of status relative to the BAC because the ratio of the BAC to the `r detAClabel` can vary between `r detLabel`s, between regions and, for biota, between species.
</p>

```{r include = FALSE, echo = FALSE}
txt <- if(detFixedEffect) "" else
  paste0("regional status (averaged over ", detLabel, "s) and the ")
```

<p class = "startsmall">
The final `r if (detFixedEffect) "tab" else "2 tabs"` show the estimates of the `r txt`regional status by `r detLabel`.
</p>

<br>


```{asis, echo = !detFixedEffect}
#### Regional status
```

```{r, echo = FALSE, eval = !detFixedEffect, message = FALSE, warning = FALSE, fig.width = 9, fig.height = 5}
plotStatusResults(assessment, "region", detAClabel, greenID)
```

```{asis, echo = !detFixedEffect}
<br>
```

#### Regional status by `r detLabel`

```{r, echo = FALSE, message = FALSE, warning = FALSE, fig.width = 9, fig.height = 5}
plotStatusResults(assessment, "region by determinand", detAClabel, greenID)
```

<br>

#### Regional status by region

```{r, echo = FALSE, message = FALSE, warning = FALSE, fig.width = 9, fig.height = 5}
plotStatusResults(assessment, "determinand by region", detAClabel, greenID)
```

<br>

#### Individual time series

```{r, echo = FALSE, message = FALSE, warning = FALSE, fig.width = 9, fig.height = 5}
plotStatus(assessment, detAClabel, greenID)
```

<br>


```{asis, echo = !detFixedEffect}
#### Estimates by region 

<p class = "startsmall">
This table shows the estimates of the regional status:  
</p>

<ul type = "disc">
<li>status: the estimated mean log concentration minus the log `r detAClabel`</li>
<li>se: the corresponding standard error</li>
<li>upper: the corresponding pointwise upper one-sided 95% confidence limit</li>
<li>concentration: the estimated mean concentration relative to the `r detAClabel`</li>
<li>conc upper: the corresponding pointwise upper one-sided 95% confidence limit</li>
</ul>

<br>
```

```{r echo = FALSE, message = FALSE, results = "asis", eval = !detFixedEffect}
tab <- tableStatus(assessment, AC = detAClabel, purpose = purpose, type = "region", detLabel = detLabel)
tab <- xtable::xtable(tab)
print(tab, type = "html", include.rownames = FALSE) 
```

<br>


#### Estimates by region and `r detLabel` 

<p class = "startsmall">
This table shows the estimates of regional status by determinand:  
</p>

<ul type = "disc">
<li>status: the estimated mean log concentration minus the log `r detAClabel`</li>
<li>se: the corresponding standard error</li>
<li>upper: the corresponding pointwise upper one-sided 95% confidence limit</li>
<li>concentration: the estimated mean concentration relative to the `r detAClabel`</li>
<li>conc upper: the corresponding pointwise upper one-sided 95% confidence limit</li>
</ul>

<br>

```{r echo = FALSE, message = FALSE, results = "asis"}
tab <- tableStatus(assessment, AC = detAClabel, purpose = purpose, type = "region determinand", 
                   detLabel = detLabel)
tab <- xtable::xtable(tab)
print(tab, type = "html", include.rownames = FALSE) 
```


<br>


### Regional status compared to the Background Assessment Concentration (BAC) {.tabset}

<p class = "startsmall">
The first `r if (detFixedEffect) 3 else 4` tabs show:
</p>

```{r echo = FALSE, include = FALSE}
plottype <- "status"
```

```{r child = "meta_analysis_plottypes.rmd"}
```


<p class = "botsmall">
The symbols in all 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>`r greenID`: the mean concentration is significantly (p < 0.05) below the `r detAC` (`r detAClabel`)</li>
```{asis, echo = params$compartment == "sediment" & params$detGroup == "PAH (parent)"}
<li>orange: there is no `r detAClabel` and the mean concentration is not significantly below the BAC</li>
```
<li class = "last">red: the estimate of the mean concentration is not significantly below the `r detAClabel`</li>
</ul>

```{r include = FALSE, echo = FALSE}
txt <- if(detFixedEffect) "" else
  paste0("regional status (averaged over ", detLabel, "s) and the ")
```

<p class = "startsmall">
The final `r if (detFixedEffect) "tab" else "2 tabs"` show the estimates of the `r txt`regional status by `r detLabel`.
</p>




<br>

```{asis, echo = !detFixedEffect}
#### Regional status
```

```{r, echo = FALSE, eval = !detFixedEffect, message = FALSE, warning = FALSE, fig.width = 9, fig.height = 5}
plotStatusResults(assessment, "region", "BAC", greenID)
```

```{asis, echo = !detFixedEffect}
<br>
```

#### Regional status by `r detLabel`

```{r, echo = FALSE, message = FALSE, warning = FALSE, fig.width = 9, fig.height = 5}
plotStatusResults(assessment, "region by determinand", "BAC", greenID)
```

<br>

#### Regional status by region

```{r, echo = FALSE, message = FALSE, warning = FALSE, fig.width = 9, fig.height = 5}
plotStatusResults(assessment, "determinand by region", "BAC", greenID)
```

<br>

#### Individual time series

```{r, echo = FALSE, message = FALSE, warning = FALSE, fig.width = 9, fig.height = 5}
plotStatus(assessment, "BAC", greenID)
```

<br>


```{asis, echo = !detFixedEffect}
#### Estimates by region 

<p class = "startsmall">
This table shows the estimates of the regional status:  
</p>

<ul type = "disc">
<li>status: the estimated mean log concentration minus the log `r detAClabel`</li>
<li>se: the corresponding standard error</li>
<li>upper: the corresponding pointwise upper one-sided 95% confidence limit</li>
<li>concentration: the estimated mean concentration relative to the `r detAClabel`</li>
<li>conc upper: the corresponding pointwise upper one-sided 95% confidence limit</li>
</ul>

<br>
```

```{r echo = FALSE, message = FALSE, results = "asis", eval = !detFixedEffect}
tab <- tableStatus(assessment, AC = "BAC", purpose = purpose, type = "region", detLabel = detLabel)
tab <- xtable::xtable(tab)
print(tab, type = "html", include.rownames = FALSE) 
```

<br>


#### Estimates by region and `r detLabel` 

<p class = "startsmall">
This table shows the estimates of regional status by determinand:  
</p>

<ul type = "disc">
<li>status: the estimated mean log concentration minus the log BAC</li>
<li>se: the corresponding standard error</li>
<li>upper: the corresponding pointwise upper one-sided 95% confidence limit</li>
<li>concentration: the estimated mean concentration relative to the BAC</li>
<li>conc upper: the corresponding pointwise upper one-sided 95% confidence limit</li>
</ul>

<br>

```{r echo = FALSE, message = FALSE, results = "asis"}
tab <- tableStatus(assessment, AC = "BAC", purpose = purpose, type = "region determinand", detLabel = detLabel)
tab <- xtable::xtable(tab)
print(tab, type = "html", include.rownames = FALSE) 
```

<br>

