Re: [R] Random Effects for One-Way Anova

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Thu 01 Dec 2005 - 00:52:48 EST

Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:

> > My questions is:
> > which formula should I use if I want to use a random effects model?
> > I think I should use "lme", but I don't know how.
>
> aov() is the function for anova modelling. so you want
>
> aov(A ~ B, data = DATA) # fixed effects
> aov(A ~ Error(B), data = DATA) # random effects
>
> but a 1-way ANOVA with fixed or random effects is the same analysis, and
> only the interpretation differs.

Not quite. Only if the design is balanced and you're not looking to compute things like the variance of the estimated overall mean.

In the unbalanced case, I don't believe aov() is doing the right thing (it might not be very wrong, though, if the imbalance is slight) and lme/lmer is closer on the mark.

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
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 Thu Dec 01 01:02:25 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:25 EST