Learn R Programming

BaSTA (version 1.9.1)

multibasta: 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, \dots)
## S3 method for class 'multibasta':
print(x, \dots)

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) repres
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

  • runsA list with the basta outputs for the models and shapes tested.
  • DICsA matrix with the DIC values for each model, sorted from the model with lowest DIC to the model with highest DIC.
  • modelsA summary table showing the models and shaped tested.

See Also

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

Examples

Run this code
## 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 = 200, burnin = 11, thinning = 10, 
                 nsim = 1, updateJumps = FALSE, parallel = FALSE)

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

Run the code above in your browser using DataLab