I've been an lme4 user for a while but recently tried to pick up nlme to gain more flexibility and wean myself off of other commercial competitors.  As part of the transition, I've enjoyed reading through Pinheiro & Bates (2000) and digging out unknown (to me) pearls like lmList and nlsList objects.  For better or for worse, I've been trying to run P&B models in both lme4 and nlme for comparison, and this has led to the quandary below:

When plotting confidence intervals for lmList objects, I've noticed a transition among lme4 users from the older nlme intervals function to the newer lme4 confint method.  Peculiarly, these two do not play nice with each other, and I'm having difficulty understanding why.  Here is an example:

> library(lme4)
> library(nlme)
> fm1 <- lme4:::lmList(Reaction ~ Days | Subject, sleepstudy)
>
> ci1 <- confint(fm1,pool=T) #get low and high CI estimates and pooled sd
> ci2 <- nlme:::intervals(fm1,pool=T) #get low and high CI estimates, coef estimates and pooled sd
>
> all.equal(unname(ci2[,c(1,3),1]),unname(ci1[,,1])) #compare intercept CIs
[1] "Mean relative difference: 0.06869956"
> all.equal(unname(ci2[,c(1,3),2]),unname(ci1[,,2])) #compare slope CIs
[1] "Mean relative difference: 0.2868216"

Even more strange, the boundaries from confint do not always encapsulate the actual lmList estimate.  Perhaps I'm misunderstanding the pool option of confint?

> apply(merge(ci1[,,1],ci2[,2,1],by=0),1,function(x) x[4] > x[2] && x[4] < x[3]) #intercept within confint bounds?
 [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[13] FALSE FALSE FALSE FALSE FALSE FALSE
> apply(merge(ci1[,,2],ci2[,2,2],by=0),1,function(x) x[4] > x[2] && x[4] < x[3]) #slope within confint bounds?
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[13] FALSE FALSE FALSE FALSE FALSE FALSE




______________________________________
David E. Bard, Ph.D.
Assistant Professor
University of Oklahoma Health Sciences Center
College of Medicine
Developmental and Behavioral Pediatrics
940 NE 13th Street, Nicholson Tower Suite 4900
Oklahoma City, Oklahoma  73104
Phone: (405) 271-8858
Fax: (405) 271-2931


	[[alternative HTML version deleted]]

