| sim.morph | R Documentation |
Simulates multiple datasets and fits a model to each one.
sim.morph(
n.sims,
n.animals = NULL,
n.photos = NULL,
data = NULL,
mus,
sigmas,
rhos,
psis,
phis,
log.transform = FALSE,
method = "REML",
control = list(maxIter = 1e+05, msMaxIter = 1e+05),
progressbar = TRUE,
n.cores = 1
)
n.sims |
Integer. The number of data sets to simulate. |
n.animals |
Integer. The number of animals in the sample. |
n.photos |
Integer vector. If there are |
data |
A data frame with columns |
mus |
A vector with an element for each dimension, providing the means of the true dimension sizes in the population. |
sigmas |
A vector with an element for each dimension, providing the standard deviations for true dimension sizes in the population. |
rhos |
A vector, with one element for each pair of dimensions, providing the pairwise correlations between true dimension sizes in the population. See 'Details' for the correct order for the correlations. |
psis |
A vector with an element for each dimension, providing the standard deviations of measurement errors for the dimensions. |
phis |
A vector, with one element for each pair of dimensions, providing the pairwise correlations between measurement errors for the dimensions. See 'Details' for the correct order for the correlations. |
log.transform |
Logical. If |
method |
A character string indicating the objective function
used to fit the model. Either |
control |
A list of control values for the estimation
algorithm to replace the default values returned by the
function |
progressbar |
Logical. If |
n.cores |
Integer. The number of cores for parallel processing. |
An object of class lme.morph.sim. The best way to extract
results from this object is to use extract.sim.morph(). See
the example below.
extract.sim.morph() to extract results from the object
returned by this function.
## Running a small simulation study.
sim.fits <- sim.morph(n.sims = 5,
n.animals = 10,
n.photos = 3,
mus = c(315, 150, 100),
sigmas = c(25, 15, 10),
rhos = c(0.85, 0.80, 0.75),
psis = c(10, 6, 4),
phis = c(0.5, 0.4, 0.3),
method = "REML",
progressbar = FALSE,
n.cores = 1)
## Extracting p-values from tests for isometry from each model
## fit.
iso.p <- function(x) summary(x, type = "isometric-pca")[, 3]
extract.sim.morph(sim.fits, FUN = iso.p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.