[R] How to mimic pdMat of lme under lmer?

Joris De Wolf joris.dewolf at cropdesign.com
Mon Sep 19 18:24:07 CEST 2005


Dear members,

I would like to switch from nlme to lme4 and try to translate some of my 
models that worked fine with lme.
I have problems with the pdMat classes.

Below a toy dataset with a fixed effect F and a random effect R. I gave 
also 2 similar lme models.
The one containing pdLogChol (lme1) is easy to translate (as it is an 
explicit notation of the default model)
The more parsimonious model with pdDiag replacing pdLogChol I cannot 
reproduce with lmer. The obvious choice for me would be my model lmer2, 
but this is yielding different result.

Somebody any idea?
Thanks,
Joris

I am using R version 2.1.0 for Linux
and the most recent downloads of Matrix and  nlme

#dataset from McLean, Sanders and Stroup
F <- factor(c(1,1,1,1,1,1,2,2,2,2,2,2))
R <- factor(c(1,1,2,2,3,3,1,1,2,2,3,3))
s <- 
c(51.43,51.28,50.93,50.75,50.47,50.83,51.91,52.43,52.26,52.33,51.58,51.23)
DS <- data.frame(F,R,s)
DS$F <- as.factor(DS$F)
DS$R <- as.factor(DS$R)

library(nlme)
lme1 <- lme(data = DS,s ~ F,random = list(R = pdLogChol(~F)))
lme2 <- lme(data = DS,s ~ F,random = list(R = pdDiag(~F)))
summary(lme1)
summary(lme2)

library(lme4)
lmer1 <- lmer(data = DS,s ~ F + (F|R))
lmer2 <- lmer(data = DS,s ~ F + (1|R) + (1|F))
summary(lmer1)
summary(lmer2)



confidentiality notice:
The information contained in this e-mail is confidential and...{{dropped}}




More information about the R-help mailing list