| fit.morph | R Documentation |
Fits the model described by Stevenson, Smit, and Setyawan (2026) to morphometric data.
fit.morph(
data,
log.transform = FALSE,
method = "REML",
control = list(maxIter = 1e+05, msMaxIter = 1e+05)
)
data |
A data frame containing the morphometric data. See the section below on the correct formatting of this argument. |
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 |
This is a special case of a linear mixed-effects model, and is
fitted via a call to nlme::lme(). Some arguments of
fit.morph() are directly passed to nlme::lme().
An object of classes lme.morph (specific to this package)
and lme (inherited from nlme::lme()). The object is the
list returned by nlme::lme() with a couple of additional
components.
Rather than inspecting the object directly, the best way to extract
understandable output from the object is using the S3 methods
summary.lme.morph(), plot.lme.morph(), and
predict.lme.morph() via the generic functions summary(),
plot(), and predict(). Other S3 methods for the lme class are
availble via nlme, such as nlme::coef.lme().
To fit a model to log-transformed measurement data, provide the
untransformed measurements in the data argument and specify
log.transform = TRUE. This will allow the S3 method
plot.lme.morph() to plot the original data with
back-transformed estimates, and the S3 method
summary.lme.morph() to carry out the correct test for isometric
growth.
data argumentThe manta object is an example of a correctly formatted
data argument. It must be a data frame with the following
columns:
animal.idAn individual identification number. Rows
with the same animal.id correspond to
measurements of the saime individual manta ray.
photo.idA photo identification number. Rows with
the same photo.id correspond to
measurements taken from the same image.
photo.idAn integer indicating the dimension the measurement is for.
measurementThe corresponding measurement.
Stevenson, B. C., Smit, E., and Setyawan, E. (2026) Measurement error models for morphometric data. Annals of Applied Statistics, 20: 945–962.
## Fitting model to manta ray data.
fit <- fit.morph(manta)
## Using maximum likelihood instead of REML.
fit <- fit.morph(manta, method = "ML")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.