as.paleoTS {paleoTS} | R Documentation |
Make a Paleontological Time-series object
Description
Combines information into an object of class paleoTS
Usage
as.paleoTS(
mm,
vv,
nn,
tt,
MM = NULL,
genpars = NULL,
label = NULL,
start.age = NULL,
oldest = c("first", "last"),
reset.time = TRUE
)
Arguments
mm |
vector of sample means |
vv |
vector of sample variances |
nn |
vector of sample sizes |
tt |
vector of sample ages |
MM |
vector of true means (simulated data) |
genpars |
generating parameters (simulated data) |
label |
optional, label for time-series |
start.age |
optional, age of oldest sample |
oldest |
value indicating if the oldest sample is first or last in the sequence |
reset.time |
logical; if TRUE, then change time scale to start at t=0
and adjust |
Details
This function combines data into a paleoTS
object. For
empirical data it may be more convenient to use read.paleoTS
.
If sample ages decrease through the sequence, as if given in millions of
years ago, tt
will automatically be converted to time elapsed from
the beginning of the sequence as long as reset.time
= TRUE.
Value
a paleoTS
object
Note
All model-fitting functions estimate the contribution of sampling
noise to the observed differences between samples. They do this assuming
that the trait is represented by sample means, which have sampling
variances equal to variance divided by sample size, vv/nn
. If one
is interested in analyzing statistics other than the sample mean (medians,
quantiles, or other statistics), use the the following procedure: set the
statistic in question as the mm
values, replace vv
with a
vector of the squared standard errors for each estimate (generated by other
means, for example bootstrapping), and set all values of nn
to one.
When fitting such time-series, be sure to set the argument pool = FALSE
.
See Also
Examples
x <- as.paleoTS(mm = rnorm(20), vv = rep(1, 20), nn = rep(25, 20), tt=0:19)
plot(x) # easier to use sim.Stasis()