List of glm Objects with a Common Model

DESCRIPTION:

Data is partitioned according to the levels of grouping factor and individual glm fits are obtained for each data partition, using the model defined in object.

USAGE:

glmList(object, data, family, level, weights, subset, na.action,
        pool, control) 

REQUIRED ARGUMENTS:

object
either a linear formula object of the form y ~ x1+...+xn | g or a groupedData object. In the formula object, y represents the response, x1,...,xn the covariates, and g the grouping factor specifying the partitioning of the data according to which different glm fits should be performed. The grouping factor g may be omitted from the formula, in which case the grouping structure will be obtained from data, which must inherit from class groupedData. The method function glmList.groupedData is documented separately.
data
a data frame in which to interpret the variables named in object.
family
afamily object - a list of functions and expressions for definingthe link and variance functions, initialization and iterative weights. Families supported are gaussian, binomial, poisson, Gamma, inverse.gaussian and quasi. Functions like binomialproduce a family object, but can be given without the parentheses. Family functions can take arguments, as in binomial(link=probit). Defaults to gaussian.
level
an optional integer specifying the level of grouping to be used when multiple nested levels of grouping are present.
weights
an optional expression defining the weights for the fitting criterion in the glm fits. Equal weights are used by default.
subset
an optional expression indicating the subset of the rows of data that should be used in the fit. This can be a logical vector, or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included. All observations are included by default.
na.action
a function that indicates what should happen when the data contain NAs. The default action ( na.fail) causes lmListto print an error message and terminate if there are any incomplete observations.
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.
control
alist of control values for the estimation algorithm to replace the default values returned by the function glm.control. Defaults to an empty list.

VALUE:

an object of class glmList, also inheriting from class lmList, corresponding to a list of glm objects with as many components as the number of groups defined by the grouping factor. Generic functions such as coef, fixef , lme , pairs, plot , predict, ranef , summary, and update have methods that can be applied to a glmList object.

SEE ALSO:

, .

EXAMPLES:

fm1<- glmList(resp ~ trt | clinic, Clinic, family=binomial)