nlme (version 3.1-86)

getVarCov: Extract variance-covariance matrix

Description

Extract the variance-covariance matrix from a fitted model, such as a mixed-effects model.

Usage

getVarCov(obj, ...)
## S3 method for class 'lme':
getVarCov(obj, individuals,
    type = c("random.effects", "conditional", "marginal"), ...)
## S3 method for class 'gls':
getVarCov(obj, individual = 1, \dots)

Arguments

Value

A variance-covariance matrix or a list of variance-covariance matrices.

See Also

lme, gls

Examples

Run this code
fm1 <- lme(distance ~ age, data = Orthodont, subset = Sex == "Female")
getVarCov(fm1)
getVarCov(fm1, individual = "F01", type = "marginal")
getVarCov(fm1, type = "conditional")
fm2 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary,
           correlation = corAR1(form = ~ 1 | Mare))
getVarCov(fm2)

Run the code above in your browser using DataLab