predict.lmList {nlme} | R Documentation |
If the grouping factor corresponding to object
is included
in newdata
, the data frame is partitioned according to the
grouping factor levels; else, newdata
is repeated for all
lm
components. The predictions and, optionally, the standard
errors for the predictions, are obtained for each lm
component of object
, using the corresponding element of the
partitioned newdata
, and arranged into a list with as many
components as object
, or combined into a single vector or data
frame (if se.fit=TRUE
).
## S3 method for class 'lmList' predict(object, newdata, subset, pool, asList, se.fit, ...)
object |
an object inheriting from class |
newdata |
an optional data frame to be used for obtaining the
predictions. All variables used in the |
subset |
an optional character or integer vector naming the
|
asList |
an optional logical value. If |
pool |
an optional logical value indicating whether a pooled
estimate of the residual standard error should be used. Default is
|
se.fit |
an optional logical value indicating whether pointwise
standard errors should be computed along with the
predictions. Default is |
... |
some methods for this generic require additional arguments. None are used in this method. |
a list with components given by the predictions (and, optionally, the
standard errors for the predictions) from each lm
component of object
, a vector with the predictions from all
lm
components of object
, or a data frame with columns
given by the predictions and their corresponding standard errors.
José Pinheiro and Douglas Bates bates@stat.wisc.edu
fm1 <- lmList(distance ~ age | Subject, Orthodont) predict(fm1, se.fit = TRUE)