lme.lmList.Rd
If the random effects names defined in random
are a subset of
the lmList
object coefficient names, initial estimates for the
covariance matrix of the random effects are obtained (overwriting any
values given in random
). formula(fixed)
and the
data
argument in the calling sequence used to obtain
fixed
are passed as the fixed
and data
arguments
to lme.formula
, together with any other additional arguments in
the function call. See the documentation on lme.formula
for a
description of that function.
# S3 method for class 'lmList'
lme(fixed, data, random, correlation, weights, subset, method,
na.action, control, contrasts, keep.data)
an object inheriting from class "lmList."
,
representing a list of lm
fits with a common model.
this argument is included for consistency with the generic function. It is ignored in this method function.
an optional one-sided linear formula with no conditioning
expression, or a pdMat
object with a formula
attribute. Multiple levels of grouping are not allowed with this
method function. Defaults to a formula consisting of the right hand
side of formula(fixed)
.
an optional corStruct
object describing the
within-group correlation structure. See the documentation of
corClasses
for a description of the available corStruct
classes. Defaults to NULL
,
corresponding to no within-group correlations.
an optional varFunc
object or one-sided formula
describing the within-group heteroscedasticity structure. If given as
a formula, it is used as the argument to varFixed
,
corresponding to fixed variance weights. See the documentation on
varClasses
for a description of the available varFunc
classes. Defaults to NULL
, corresponding to homoscedastic
within-group errors.
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.
a character string. If "REML"
the model is fit by
maximizing the restricted log-likelihood. If "ML"
the
log-likelihood is maximized. Defaults to "REML"
.
a function that indicates what should happen when the
data contain NA
s. The default action (na.fail
) causes
lme
to print an error message and terminate if there are any
incomplete observations.
a list of control values for the estimation algorithm to
replace the default values returned by the function lmeControl
.
Defaults to an empty list.
an optional list. See the contrasts.arg
of model.matrix.default
.
logical: should the data
argument (if supplied
and a data frame) be saved as part of the model object?
an object of class lme
representing the linear mixed-effects
model fit. Generic functions such as print
, plot
and
summary
have methods to show the results of the fit. See
lmeObject
for the components of the fit. The functions
resid
, coef
, fitted
, fixed.effects
, and
random.effects
can be used to extract some of its components.
The computational methods follow the general framework of Lindstrom
and Bates (1988). The model formulation is described in Laird and Ware
(1982). The variance-covariance parametrizations are described in
Pinheiro and Bates (1996). The different correlation structures
available for the correlation
argument are described in Box,
Jenkins and Reinse (1994), Littel et al (1996), and Venables and
Ripley, (2002). The use of variance functions for linear and nonlinear
mixed effects models is presented in detail in Davidian and Giltinan
(1995).
Box, G.E.P., Jenkins, G.M., and Reinsel G.C. (1994) "Time Series Analysis: Forecasting and Control", 3rd Edition, Holden–Day.
Davidian, M. and Giltinan, D.M. (1995) "Nonlinear Mixed Effects Models for Repeated Measurement Data", Chapman and Hall.
Laird, N.M. and Ware, J.H. (1982) "Random-Effects Models for Longitudinal Data", Biometrics, 38, 963–974.
Lindstrom, M.J. and Bates, D.M. (1988) "Newton-Raphson and EM Algorithms for Linear Mixed-Effects Models for Repeated-Measures Data", Journal of the American Statistical Association, 83, 1014–1022.
Littel, R.C., Milliken, G.A., Stroup, W.W., and Wolfinger, R.D. (1996) "SAS Systems for Mixed Models", SAS Institute.
Pinheiro, J.C. and Bates., D.M. (1996) "Unconstrained Parametrizations for Variance-Covariance Matrices", Statistics and Computing, 6, 289–296.
Venables, W.N. and Ripley, B.D. (2002) "Modern Applied Statistics with S", 4th Edition, Springer-Verlag.
fm1 <- lmList(Orthodont)
fm2 <- lme(fm1)
summary(fm1)
#> Call:
#> Model: distance ~ age | Subject
#> Data: Orthodont
#>
#> Coefficients:
#> (Intercept)
#> Estimate Std. Error t value Pr(>|t|)
#> M16 16.95 3.288173 5.1548379 3.695247e-06
#> M05 13.65 3.288173 4.1512411 1.181678e-04
#> M02 14.85 3.288173 4.5161854 3.458934e-05
#> M11 20.05 3.288173 6.0976106 1.188838e-07
#> M07 14.95 3.288173 4.5465974 3.116705e-05
#> M08 19.75 3.288173 6.0063745 1.665712e-07
#> M03 16.00 3.288173 4.8659237 1.028488e-05
#> M12 13.25 3.288173 4.0295930 1.762580e-04
#> M13 2.80 3.288173 0.8515366 3.982319e-01
#> M14 19.10 3.288173 5.8086964 3.449588e-07
#> M09 14.40 3.288173 4.3793313 5.509579e-05
#> M15 13.50 3.288173 4.1056231 1.373664e-04
#> M06 18.95 3.288173 5.7630783 4.078189e-07
#> M04 24.70 3.288173 7.5117696 6.081644e-10
#> M01 17.30 3.288173 5.2612799 2.523621e-06
#> M10 21.25 3.288173 6.4625549 3.065505e-08
#> F10 13.55 3.288173 4.1208291 1.306536e-04
#> F09 18.10 3.288173 5.5045761 1.047769e-06
#> F06 17.00 3.288173 5.1700439 3.499774e-06
#> F01 17.25 3.288173 5.2460739 2.665260e-06
#> F05 19.60 3.288173 5.9607565 1.971127e-07
#> F07 16.95 3.288173 5.1548379 3.695247e-06
#> F02 14.20 3.288173 4.3185072 6.763806e-05
#> F08 21.45 3.288173 6.5233789 2.443813e-08
#> F03 14.40 3.288173 4.3793313 5.509579e-05
#> F04 19.65 3.288173 5.9759625 1.863600e-07
#> F11 18.95 3.288173 5.7630783 4.078189e-07
#> age
#> Estimate Std. Error t value Pr(>|t|)
#> M16 0.550 0.2929338 1.8775576 6.584707e-02
#> M05 0.850 0.2929338 2.9016799 5.361639e-03
#> M02 0.775 0.2929338 2.6456493 1.065760e-02
#> M11 0.325 0.2929338 1.1094659 2.721458e-01
#> M07 0.800 0.2929338 2.7309929 8.511442e-03
#> M08 0.375 0.2929338 1.2801529 2.059634e-01
#> M03 0.750 0.2929338 2.5603058 1.328807e-02
#> M12 1.000 0.2929338 3.4137411 1.222240e-03
#> M13 1.950 0.2929338 6.6567951 1.485652e-08
#> M14 0.525 0.2929338 1.7922141 7.870160e-02
#> M09 0.975 0.2929338 3.3283976 1.577941e-03
#> M15 1.125 0.2929338 3.8404587 3.247135e-04
#> M06 0.675 0.2929338 2.3042752 2.508117e-02
#> M04 0.175 0.2929338 0.5974047 5.527342e-01
#> M01 0.950 0.2929338 3.2430540 2.030113e-03
#> M10 0.750 0.2929338 2.5603058 1.328807e-02
#> F10 0.450 0.2929338 1.5361835 1.303325e-01
#> F09 0.275 0.2929338 0.9387788 3.520246e-01
#> F06 0.375 0.2929338 1.2801529 2.059634e-01
#> F01 0.375 0.2929338 1.2801529 2.059634e-01
#> F05 0.275 0.2929338 0.9387788 3.520246e-01
#> F07 0.550 0.2929338 1.8775576 6.584707e-02
#> F02 0.800 0.2929338 2.7309929 8.511442e-03
#> F08 0.175 0.2929338 0.5974047 5.527342e-01
#> F03 0.850 0.2929338 2.9016799 5.361639e-03
#> F04 0.475 0.2929338 1.6215270 1.107298e-01
#> F11 0.675 0.2929338 2.3042752 2.508117e-02
#>
#> Residual standard error: 1.31004 on 54 degrees of freedom
#>
summary(fm2)
#> Linear mixed-effects model fit by REML
#> Data: Orthodont
#> AIC BIC logLik
#> 454.6367 470.6173 -221.3183
#>
#> Random effects:
#> Formula: ~age | Subject
#> Structure: General positive-definite, Log-Cholesky parametrization
#> StdDev Corr
#> (Intercept) 2.327036 (Intr)
#> age 0.226428 -0.609
#> Residual 1.310040
#>
#> Fixed effects: distance ~ age
#> Value Std.Error DF t-value p-value
#> (Intercept) 16.761111 0.7752462 80 21.62037 0
#> age 0.660185 0.0712533 80 9.26533 0
#> Correlation:
#> (Intr)
#> age -0.848
#>
#> Standardized Within-Group Residuals:
#> Min Q1 Med Q3 Max
#> -3.223104747 -0.493761213 0.007316586 0.472150966 3.916033386
#>
#> Number of Observations: 108
#> Number of Groups: 27