Description Usage Arguments Details Value Examples

Use a bayesian meta-analysis to create an indicator from species index values and standard error.

1 2 3 |

`data` |
a data.frame with 4 columns in this order: species, year, index, se (standard error) |

`plot` |
Logical, should a trace plot be plotted? |

`model` |
The type of model to be used. See details. |

`parallel` |
if |

`incl.model` |
if |

`n.iter` |
The number of iterations of the model to run. Defaults to 10,000 to avoid long run times though much longer runs are usually required to reach convergence |

`m.scale` |
The measurement scale of the data. The scale of the data is assumed to be logarithmic. Here you specify which log scale the data is on ('loge', 'log10', or 'logit'). Defaults to 'loge'. |

`num.knots` |
If using either of the smooth models this specifies the number of knots. |

`rescaleYr1` |
Logical, should all iterations be scaled so that the first year is equal? If TRUE year one will have 0 error. |

There are a number of model to choose from:

`"random_walk"`

- Also known as BMA3, strongly recommended.`"uniform"`

- Also known as BMA2.`"uniform_noeta"`

- Also known as BMA1.`"FNgr"`

- Indicator defined by Growth rates, as in Freeman & Newson.`"smooth_stoch"`

- Indicator defined by Growth rates, with Ruppert smoother (stochastic version).`"smooth_det"`

- Indicator defined by Growth rates, with Ruppert smoother (deterministic version).`"FNgr2"`

- Variant where species can join the series late and error on the first year is 0 (check with Nick and Steve).`"smooth_stoch2"`

- Variant where species can join the series late and error on the first year is 0 (check with Nick and Steve).`"smooth_det2"`

- Variant where species can join the series late and error on the first year is 0 (check with Nick and Steve).

Returns a dataframe with 4 columns: Year, Index, lower2.5, upper97.5. The last two columns are the credible intervals

1 2 3 4 5 6 7 8 9 10 11 12 | ```
# Create some example data in the format required
data <- data.frame(species = rep(letters, each = 50),
year = rep(1:50, length(letters)),
index = runif(n = 50 * length(letters), min = 0, max = 1),
se = runif(n = 50 * length(letters), min = 0.01, max = .1))
# Run the Bayesian meta-analysis
bma_indicator <- bma(data)
# Plot the resulting indicator
plot_indicator(indicator = bma_indicator[,'Index'],
CIs = bma_indicator[,c(3,4)])
``` |

BiologicalRecordsCentre/BRCindicators documentation built on May 6, 2019, 7:55 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.