Learn R Programming

predictmeans (version 1.0.9)

varcomp: Calculate SE and CI of variance components for lmer or lme model

Description

This function calculates SE and CI of variance components for lmer or lme model.

Usage

varcomp(model, ci=TRUE, level=0.95)

Value

Variance components table.

Arguments

model

Model object returned by lmer or lme.

ci

a logical value to indicates wheather or not to simulate a confidence interval for lmer model, the default value is TRUE.

level

level of confidence of CI, the default value is 0.95.

Author

Dongwen Luo, Siva Ganesh and John Koolaard

Examples

Run this code
library(predictmeans)
Oats$nitro <- factor(Oats$nitro) 
fm <- lmer(yield ~ nitro*Variety+(1|Block/Variety), data=Oats)
if (FALSE) varcomp(fm)
fm1 <- lme(yield ~ nitro*Variety, random=~1|Block/Variety, data=Oats)
varcomp(fm1)

data(Orthodont, package="nlme")
mod <- lmer(distance ~ age + (age|Subject), data=Orthodont)
if (FALSE) varcomp(mod)
mod1 <- lme(distance ~ age, random=~age|Subject, data=Orthodont)
varcomp(mod1)

Run the code above in your browser using DataLab