Learn R Programming

lme4 (version 0.999999-2)

lmList: List of lm Objects with a Common Model

Description

The 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.

Usage

lmList(formula, data, family, subset, weights,
       na.action, offset, pool, ...)

Arguments

formula
a linear formula object of the form 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 the
data
a data frame in which to interpret the variables named in object.
family
an optional family specification for a generalized linear model.
weights
an optional vector of weights to be used in the fitting process.
subset
an optional vector specifying a subset of observations to be used in the fitting process.
na.action
a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is
offset
this can be used to specify an a priori known component to be included in the linear predictor during fitting.
pool
an optional logical value that is preserved as an attribute of the returned value. This will be used as the default for pool in calculations of standard deviations or standard errors for summaries.
...
optional arguments to be passed to the model-fitting function.

Value

  • an object of class "lmList", which is a list of lm objects with as many components as the number of groups defined by the grouping factor.

See Also

lm

Examples

Run this code
(fm1 <- lmList(Reaction ~ Days | Subject, sleepstudy))

Run the code above in your browser using DataLab