Re: [R] lmer multilevel

2006-03-31 Thread Spencer Graves
Hi, Doug:

  I just confirmed a discrepancy (reported by Paul Cossens) between the 
output of lme and lmer using the Oxide example in Pinheiro and Bates, 
pp. 167-170.  It appears that coef(lmer(...)) adds only the ranef for 
Wafer and omits the one for Lot.

  Consider the following:

library(nlme)
Oxide - Oxide
#data(Oxide,package=nlme)
fit.lme - lme(Thickness~1,Oxide)
coef.lme - coef(fit.lme)

exit R, restart
library(lme4)
fm3Oxide-lmer(Thickness~ (1|Lot)+(1|Lot:Wafer),data=Oxide)
coef.lme4 - coef(fm3Oxide)

The following matches the first 3 numbers in coef.lme but not in 
coef.lme4:

fixef(fm3Oxide)+ranef(fm3Oxide)[[2]][1]+ranef(fm3Oxide)[[1]][1:3]

  Best Wishes,
  spencer graves

Paul Cossens wrote:

 My question relates to problems that I'm having matching lme and lmer
 examples in PB. 
 using Matix 0.995
  
 In the Oxide example in p167-170 I can't get the level 2 coefficient
 estimates to match 
 the fm1Oxide model in lme is 
  
 data(Oxide,package=nlme)
 lme(Thickness~1,Oxide)
 
 which I translate in Lmer syntax to 
  
 fm3Oxide-lmer(Thickness~ (1|Lot)+(1|Lot:Wafer),data=Oxide)
 #or alternatively which gives the same result
 Oxide$LW-with(Oxide,Lot:Wafer)[drop=TRUE]
 fm4Oxide-lmer(Thickness~ (1|Lot)+(1|LW),data=Oxide)
  
 however if you look at say Lot 8, lme gives
  
 81993.767
 
 8/11993.677
 8/21995.170
 8/31990.693
 
  
 while  lmer gives 
 coef(fm3Oxide)
 
 81993.767
 8:1 2000.062
 
 8:2 2001.555
 
 8:3 1997.078
 
 To me this looks like lmer in not including the lot random effect (8=
 -6.385129, Intercept 2000.153 ). Is this because I'm not specifying the
 model correctly?
 
 Thanks Paul
 
  
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] lmer multilevel

2006-03-28 Thread Paul Cossens
My question relates to problems that I'm having matching lme and lmer
examples in PB. 
using Matix 0.995
 
In the Oxide example in p167-170 I can't get the level 2 coefficient
estimates to match 
the fm1Oxide model in lme is 
 
data(Oxide,package=nlme)
lme(Thickness~1,Oxide)

which I translate in Lmer syntax to 
 
fm3Oxide-lmer(Thickness~ (1|Lot)+(1|Lot:Wafer),data=Oxide)
#or alternatively which gives the same result
Oxide$LW-with(Oxide,Lot:Wafer)[drop=TRUE]
fm4Oxide-lmer(Thickness~ (1|Lot)+(1|LW),data=Oxide)
 
however if you look at say Lot 8, lme gives
 
81993.767

8/11993.677
8/21995.170
8/31990.693

 
while  lmer gives 
coef(fm3Oxide)

81993.767
8:1 2000.062

8:2 2001.555

8:3 1997.078

To me this looks like lmer in not including the lot random effect (8=
-6.385129, Intercept 2000.153 ). Is this because I'm not specifying the
model correctly?

Thanks Paul

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html