[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?

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 <- 
DS <- data.frame(F,R,s)
DS$F <- as.factor(DS$F)
DS$R <- as.factor(DS$R)

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

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

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

More information about the R-help mailing list