Re: [R] ANOVA vs REML approach to variance component estimation

From: Douglas Bates <dmbates_at_gmail.com>
Date: Mon 13 Jun 2005 - 09:54:42 EST

On 6/12/05, Adaikalavan Ramasamy <ramasamy@cancer.org.uk> wrote:
> Thank you for confirming this and introducing me to varcomp().
>
> I have another question that I hope you or someone else can help me
> with. I was trying to generalise my codes for variable measurement
> levels and discovered that lme() was estimating the within group
> variance even with a single measure per subject for all subjects !
>
> Here is an example where we have 12 animals but with single measurement.
>
> y <- c(2.2, -1.4, -0.5, -0.3, -2.1, 1.5,
> 1.3, -0.3, 0.5, -1.4, -0.2, 1.8)
> ID <- factor( 1:12 )
>
>
> Analysis of variance method correctly says that there is no residual
> variance and it equals to total variance.
>
> summary(aov(y ~ ID))
> Df Sum Sq Mean Sq
> ID 11 20.9692 1.9063
>
>
> However the REML method is giving me a within animal variance when there
> is no replication at animal level. It seems like I can get components of
> variance for factors that are not replicated.
>
> library(ape)
> varcomp(lme(y ~ 1, random = ~ 1 | ID))
> ID Within
> 1.6712661 0.2350218
>
> Am I reading this correct and can someone kindly explain this to me ?

It's a spurious convergence in lme. There is no check in lme for the number of observations exceeding the number of groups. There should be. I'll add this to the bug reports list.



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 Received on Mon Jun 13 10:02:23 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:33 EST