| lmList | R Documentation |
Fit a list of lm or glm objects with a
common model for different subgroups of the data.
lmList(formula, data, family, subset, weights, na.action,
offset, pool = !isGLM || .hasScale(family2char(family)),
warn = TRUE, ...)
formula |
a linear |
family |
an optional |
data |
an optional data frame containing the
variables named in |
subset |
an optional expression indicating the
subset of the rows of |
weights |
an optional vector of ‘prior
weights’ to be used in the fitting process. Should be
|
na.action |
a function that indicates what should
happen when the data contain |
offset |
this can be used to specify an a
priori known component to be included in the linear
predictor during fitting. This should be |
pool |
logical scalar indicating if the variance estimate should
pool the residual sums of squares. By default true if the model has
a scale parameter (which includes all linear, |
warn |
indicating if errors in the single fits should signal a
“summary” |
... |
additional, optional arguments to be passed to the model function or family evaluation. |
While data is optional, the package authors
strongly recommend its use, especially when later applying
methods such as update and drop1 to the fitted model
(such methods are not guaranteed to work properly if
data is omitted). If data is omitted, variables will
be taken from the environment of formula (if specified as a
formula) or from the parent frame (if specified as a character vector).
Since lme4 version 1.1-16, if there are errors (see
stop) in the single (lm() or glm())
fits, they are summarized to a warning message which is returned as
attribute "warnMessage" and signalled as warning()
when the warn argument is true.
In previous lme4 versions, a general (different) warning had been signalled in this case.
an object of class lmList4 (see
there, notably for the methods defined).
lmList4
fm.plm <- lmList(Reaction ~ Days | Subject, sleepstudy)
coef(fm.plm)
fm.2 <- update(fm.plm, pool = FALSE)
## coefficients are the same, "pooled or unpooled":
stopifnot( all.equal(coef(fm.2), coef(fm.plm)) )
(ci <- confint(fm.plm)) # print and rather *see* :
plot(ci) # how widely they vary for the individuals
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.