lme4 (version 0.95-10)

lmer: Fit linear mixed-effects models

Description

This generic function fits a linear mixed-effects model with nested or crossed grouping factors for the random effects.

Usage

lmer(formula, data, family,
     method = c("REML", "ML", "PQL", "Laplace", "AGQ"),...)

Arguments

formula
a two-sided linear formula object describing the fixed-effects part of the model, with the response on the left of a ~ operator and the terms, separated by + operators, on the right. The vertical bar character
data
an optional data frame containing the variables named in formula. By default the variables are taken from the environment from which lmer is called.
family
a GLM family, see glm. If family is missing then a linear mixed model is fit; otherwise a generalized linear mixed model is fit.
method
a character string. For a linear mixed model the default is "REML" indicating that the model should be fit by maximizing the restricted log-likelihood. The alternative is "ML" indicating that the log-likelihood shou
...
Optional arguments for methods. Currently none are used.

Value

synopsis

lmer(formula, data, family, method = c("REML", "ML", "PQL", "Laplace", "AGQ"), control = list(), subset, weights, na.action, offset, model = TRUE, x = FALSE, y = FALSE, ...)

Details

This is a revised version of the lme function from the nlme package. This version uses a different method of specifying random-effects terms and allows for fitting generalized linear mixed models as well as linear mixed models. Additional standard arguments to model-fitting functions can be passed to lmer. [object Object],[object Object],[object Object],[object Object]

See Also

lmer-class, lm

Examples

Run this code
(fm1 <- lmer(decrease ~ treatment + (1|rowpos) + (1|colpos),
             OrchardSprays))

Run the code above in your browser using DataCamp Workspace