nlme (version 3.1-86)

predict.nlme: Predictions from an nlme Object

Description

The predictions at level $i$ are obtained by adding together the contributions from the estimated fixed effects and the estimated random effects at levels less or equal to $i$ and evaluating the model function at the resulting estimated parameters. If group values not included in the original grouping factors are present in newdata, the corresponding predictions will be set to NA for levels greater or equal to the level at which the unknown groups occur.

Usage

## S3 method for class 'nlme':
predict(object, newdata, level, asList, na.action,
naPattern, \dots)

Arguments

Value

if a single level of grouping is specified in level, the returned value is either a list with the predictions split by groups (asList = TRUE) or a vector with the predictions (asList = FALSE); else, when multiple grouping levels are specified in level, the returned object is a data frame with columns given by the predictions at different levels and the grouping factors.

See Also

nlme, fitted.lme

Examples

Run this code
fm1 <- nlme(height ~ SSasymp(age, Asym, R0, lrc),
            data = Loblolly,
            fixed = Asym + R0 + lrc ~ 1,
            random = Asym ~ 1,
            start = c(Asym = 103, R0 = -8.5, lrc = -3.3))
newLoblolly <- data.frame(age = c(5,10,15,20,25,30),
                    Seed = rep(301,6))
predict(fm1, newLoblolly, level = 0:1)

Run the code above in your browser using DataCamp Workspace