Data is partitioned according to the levels of the grouping
factor g and individual lm fits are obtained for each
data partition, using the model defined in object.lmList(object, data, level, na.action, pool)y ~ x1+...+xn | g
or a groupedData object. In the formula object, y
represents the response, x1,...,xn the covariates, and
g the groupiobject.NAs. The default action (na.fail) causes
lmList to print an error message and terminate if there are any
incomplete observations.pool in
calculations of standard deviations or standard errors for summaries.lm objects with as many components as the number of
groups defined by the grouping factor. Generic functions such as
coef, fixed.effects, lme, pairs,
plot, predict, random.effects, summary,
and update have methods that can be applied to an lmList
object.lm, lme.lmList.data(Orthodont)
fm1 <- lmList(distance ~ age | Subject, Orthodont)
summary(fm1)Run the code above in your browser using DataLab