[R-sig-ME] lme - nested - One fixed effect and another within thatas random effect
Doran, Harold
HDoran at air.org
Tue Nov 27 15:43:01 CET 2007
What do you mean by not working? Your lme and lmer code seem to be
equivalent.
> -----Original Message-----
> From: r-sig-mixed-models-bounces at r-project.org
> [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of Divaker
> Sent: Monday, November 26, 2007 9:26 PM
> To: r-sig-mixed-models at r-project.org
> Subject: [R-sig-ME] lme - nested - One fixed effect and
> another within thatas random effect
>
> Dear R mixed model Users and Dr. Bates,
>
> I am trying to work out a problem given in Nested design -
> Design of Experiments by Montgomery - p.561 using lme It is
> a mixed model with Supplier as fixed effect and batches
> within the supplier as random effects.
>
> When I tried my hands on lmer instead of lme, I get what is
> required as below.
>
> > proclme=lmer(Purity~Supplier+(1|Supplier:Batch),process)
> > print(summary(proclme))
> Linear mixed-effects model fit by REML
> Formula: Purity ~ Supplier + (1 | Supplier:Batch)
> Data: process
> AIC BIC logLik MLdeviance REMLdeviance
> 150.8 157.2 -71.42 146.9 142.8
> Random effects:
> Groups Name Variance Std.Dev.
> Supplier:Batch (Intercept) 1.7162 1.3100 Here we have
> the variance of random effect exactly as in the book
> Residual 2.6368 1.6238
> number of obs: 36, groups: Supplier:Batch, 12
>
> Fixed effects:
> Estimate Std. Error t value
> (Intercept) -0.4167 0.8055 -0.5173
> SupplierT2 0.7500 1.1391 0.6584
> SupplierT3 1.5833 1.1391 1.3900
>
> Correlation of Fixed Effects:
> (Intr) SpplT2
> SupplierT2 -0.707
> SupplierT3 -0.707 0.500
>
> But using lme, it is not working. Is there any way out.lme is
> not accepting the format random=~1|Supplier : Batch I am more
> comfortable using lme since the supporting docs are exaustive
> and we have access to many support functions for lme
>
> This code is not appropriate and also not working
> library(nlme)
> proclme=lme(Purity~Supplier,random = ~1|Supplier/Batch,process)
> summary(proclme)
> VarCorr(proclme)
>
>
> Divaker
>
> Dr. C. Divaker Durairaj, ME, Ph.D
> Professor, Farm Machinery
> Agricultural Machinery Research Centre
> Tamil Nadu Agricultural University
> Coimbatore 641003, India
> Ph: 91-422-6611204
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
More information about the R-sig-mixed-models
mailing list