data
argument is split according to the levels of the grouping
factor g
and individual lm
or glm
fits are
obtained for each data
partition, using the model defined in
object
.lmList(formula, data, family, subset, weights,
na.action, offset, pool, ...)
y ~ x1+...+xn | g
. In the formula object, y
represents
the response, x1,...,xn
the covariates, and g
the
grouping factor specifying the partitioning of theobject
.NA
s. The default is set by
the na.action
setting of options
, and is
pool
in calculations of standard deviations or standard errors
for summaries."lmList "
, which is a list of
lm
objects with as many components as the number of groups
defined by the grouping factor.lm
(fm1 <- lmList(Reaction ~ Days | Subject, sleepstudy))
Run the code above in your browser using DataLab