| predict.lme.morph | R Documentation |
Calculates model predictions for the true size of a dimension based on true values for any subset of the remaining dimensions. Predictions for multiple individuals are available from a single call to the function.
## S3 method for class 'lme.morph'
predict(object, y.dim, newdata = NULL, type = c("lm", "pca"), ...)
object |
An object of class |
y.dim |
Integer specifying which dimension to predict |
newdata |
A data frame of other dimensions to use for prediction. Column names must be of the form "dimX" where X is the dimension number. |
type |
Either |
... |
Additional arguments passed to methods |
This function computes estimated coefficients for the
appropriate linear function (as per summary.lme.morph()
with type = "betas-lm" or type = "betas-pca"), and then
evaluates the function for the provided newdata. For type = "pca", only a single column can be provided in newdata.
A matrix with estimated true sizes and standard errors. Note that these are standard errors, not prediction errors.
morphErrThere are three key differences between predict.lme.morph() and predictblup().
predict.lme.morph() only generates estimates for one
dimension based on true values for other dimensions, whereas
predictblup() can generate estimates from true values, observed
values (i.e., subject to measurement error), or a combination of
both.
predict.lme.morph() can generate estimates for multiple
individuals, whereas predictblup() only provides estimates for
a single individual.
predict.lme.morph() provides standard errors, but
predictblup() does not.
predictblup()
## Fitting model to manta ray data.
fit <- fit.morph(manta)
## Predicting dimension 2 for a single individual with a true value
## of 90 for dimension 3.
predict(fit, y.dim = 2, newdata = data.frame(dim3 = 90))
## Predicting dimension 1 from dimensions 2 and 3 for two
## individuals, one with true values of 130 and 60 for dimensions 2
## and 3, respectively, and one with true values of 140 and 70.
predict(fit, y.dim = 1, newdata = data.frame(dim2 = c(130, 140),
dim3 = c(60, 70)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.