multibasta: Function to run multiple BaSTA models on the same dataset.

View source: R/multibasta.R

multibastaR Documentation

Function to run multiple BaSTA models on the same dataset.

Description

These functions allow users to run models with different functional forms on the same dataset, to perform model comparison and to visualize the results of the multiple runs.

Usage

multibasta(object, studyStart, studyEnd, models, shapes, ...)
## S3 method for class 'multibasta'
summary(object, ...)
## S3 method for class 'multibasta'
print(x, ...)

Arguments

object

For function multibasta, a data.frame to be used as an input data file for BaSTA. The first column is a vector of individual unique IDs, the second and third columns are birth and death years respectively. Columns 4-(nt-1) represent the observation window of nt years. This is followed (optionally) by columns for categorical and continuous covariates (see details). For function summary, a multibasta output object of class “multibasta.”

x

a multibasta output object of class “multibasta.”

studyStart

The first year of the study.

studyEnd

The last year of the study.

models

A character vector specifying the models to be tested (e.g. “GO”, “WE”, “LO”)

shapes

A character vector specifying the shapes to be tested (e.g. “simple”, “Makeham”, “bathtub”).

...

Additional arguments to be passed to function basta (see details)

Value

runs

A list with the basta outputs for the models and shapes tested.

DICs

A matrix with the DIC values for each model, sorted from the model with lowest DIC to the model with highest DIC.

models

A summary table showing the models and shaped tested.

Author(s)

Fernando Colchero colchero@imada.sdu.dk, Owen R. Jones jones@biology.sdu.dk, and Maren Rebke maren.rebke@avitec-research.de

See Also

basta, as well as CensusToCaptHist and MakeCovMat for raw data formatting.

Examples

## Load data:
data("sim1", package = "BaSTA")

## Run short version of BaSTA on the data:
multiout <- multibasta(sim1, studyStart = 51, studyEnd = 70, 
                 models = c("GO", "WE"), shapes = "simple",
                 niter = 100, burnin = 11, thinning = 10, 
                 nsim = 1, updateJumps = FALSE, parallel = FALSE)

## Print results:
summary(multiout, digits = 3)

BaSTA documentation built on Oct. 5, 2022, 5:06 p.m.