| nlmer {lme4} | R Documentation |
Fit a nonlinear mixed model with nested or crossed grouping factors for the random effects.
nlmer(formula, data, control, start, verbose,
subset, weights, na.action, contrasts,
model, ...)
formula |
a three part formula object describing the response,
the nonlinear model and the fixed and random effects in the model.
In the fixed and random effects specification the vertical bar
character "|" separates an expression for a model matrix and
a grouping factor. At present evaluation of the nonlinear model
function must return a gradient attribute. |
data |
an optional data frame containing the variables named in
formula. By default the variables are taken from the
environment from which nlmer is called. |
control |
a list of control parameters. See below for details. |
start |
a named numeric vector of starting values for the fixed
effects parameters or a list that contains an element called
"fixef" that has this form. Optionally the list may contain
an element called "ST" providing a starting value for the
ST slot. |
verbose |
logical scalar - TRUE indicates verbose output
from the iterations during the optimization process (highly
recommended when difficulties are encountered). Default is FALSE. |
subset, weights, na.action, contrasts |
further model
specification arguments as in lm; see there for
details. |
model |
logical indicating if the model component
should be returned (in slot frame). |
... |
potentially further arguments for methods. Currently none are used. |
This is a revised version of the nlme 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.
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.NAs. The default action (na.fail) causes
lme to print an error message and terminate if there are any
incomplete observations.maxIter:lme
optimization algorithm. Default is 50.tolerance:lme optimization algorithm. Default is
sqrt(.Machine$double.eps).msMaxIter:nlminb optimization step inside the lme
optimization. Default is 200.msVerbose:trace argument to nlminb (see documentation on
that function). Default is getOption("verbose").niterEM:EMverbose:getOption("verbose").PQLmaxIt:usePQL:method = "Laplace"? Default is FALSE.TRUE the corresponding
components of the fit (the model frame, the model matrices)
are returned.
An object of class "nlmer".
There are many methods applicable to "nlmer" objects, see the
above help page.
The nlmer class
(fm1 <- lme4:::nlmer(circumference ~ SSlogis(age, Asym, xmid, scal) ~ Asym|Tree,
Orange, verb = 1,
start = c(Asym = 192.6872, xmid = 728.7544, scal = 353.5320)))
(fm2 <- lme4:::nlmer(conc ~ SSfol(Dose, Time,lKe, lKa, lCl) ~ (lKe+lKa+lCl|Subject),
Theoph, start = c(lKe = -2.5, lKa = 0.5, lCl = -3), verb = 1))
(fm3 <- lme4:::nlmer(conc ~ SSfol(Dose, Time,lKe, lKa, lCl) ~
(lKe|Subject) + (lKa|Subject) + (lCl|Subject), Theoph,
start = c(lKe = -2.5, lKa = 0.5, lCl = -3), verb = 1))
(fm4 <- lme4:::nlmer(conc ~ SSfol(Dose, Time,lKe, lKa, lCl) ~
(lKa+lCl|Subject), Theoph,
start = c(lKe = -2.5, lKa = 0.5, lCl = -3), verb = 1))
(fm5 <- lme4:::nlmer(conc ~ SSfol(Dose, Time,lKe, lKa, lCl) ~
(lKa|Subject) + (lCl|Subject), Theoph,
start = c(lKe = -2.5, lKa = 0.5, lCl = -3), verb = 1))