get_bmaBUGScode: Extract BMA BUGS code

View source: R/get_bmaBUGScode.R

get_bmaBUGScodeR Documentation

Extract BMA BUGS code

Description

Gets a copy of the BUGS code and writes it to the screen and (optionally) to a text file

Usage

get_bmaBUGScode(
  option = "smooth",
  print.screen = FALSE,
  save.local = FALSE,
  incl.2deriv = FALSE,
  Y1perfect = FALSE,
  seFromData = FALSE
)

Arguments

option

text string defining which particular variant is desired

print.screen

Logical, should the code be printed to the console?

save.local

Logical, should text file of the BUGS code be produced?

incl.2deriv

Logical, Should there be a calculation of the indicator's second derivative?

Y1perfect

Logical, should the first year for each species be assumed to be known without error ('TRUE')

seFromData

Logical, Should the standard errors be read in from data ('TRUE') or estimated ('FALSE')

Details

There are a number of model to choose from:

  • "smooth" The default option. Indicator defined by Growth rates, with Ruppert smoother, allowing for species to join late. Error on the first year of each species' time-series is assumed to be zero. The indicator is the expected value of the geometric mean across species (with missing species imputed). Includes three options: 'seFromData' 'Y1perfect' and 'incl.2deriv'. See bayesian_meta_analysis for mode details. Using the default values 'seFromData = FALSE' and 'Y1perfect = TRUE' are the options used in Freeman et al. (2020).

  • "smooth_det2" Equivalent to smooth with 'seFromData = TRUE' and 'Y1perfect = FALSE'. Retained for backwards compatability. Choosing this option will overwrite user-entered options for 'seFromData' and 'Y1perfect'.

  • "smooth_det_sigtheta" Equivalent to smooth with 'seFromData = FALSE' and 'Y1perfect = FALSE'. Retained for backwards compatability. Choosing this option will overwrite user-entered options for 'seFromData' and 'Y1perfect'.

  • "smooth_det" Specific variant of smooth_det2 - deprecated but retained here for backward compatibility

Examples

get_bmaBUGScode(option="smooth", print.screen=TRUE, save.local=FALSE)
get_bmaBUGScode(option="smooth_JABES", print.screen=TRUE, save.local=FALSE)
get_bmaBUGScode(option="smooth_det", print.screen=TRUE, save.local=FALSE)
get_bmaBUGScode(option="smooth_det2", print.screen=TRUE, save.local=FALSE)
get_bmaBUGScode(option="smooth_det_sigtheta", print.screen=TRUE, save.local=FALSE)

BiologicalRecordsCentre/BRCindicators documentation built on April 22, 2024, 2:32 p.m.