[R] nested anova

Federico Calboli f.calboli at ucl.ac.uk
Fri Feb 7 16:57:16 CET 2003

Hi All,

I would like to ask a clarification about a nested anova.

I did an experiment where I check for size differencies in flies. I have:

4 selection lines 
3 cage nested in each selection line (12 cages overall)
5 vials nested within each cage (15 vials per line, 60 overall)

I started out with the code:

aov(area ~ selection + cage:selection + vial:cage:selection, scf)

which does not exactly do what I would want (but gives me a fast reading of
the SS I should expect)

The code:

aov(area ~ selection/cage/vial+ Error(selection/cage/vial),scf)

does the trick (althought does not calculate the F value for me)

(BTW, the slighty shorted code

aov(area ~ selection/cage+ Error(selection/cage/vial),scf)

gives the same results).

Now, the question:

assuming that "selection" is a fixed effect and "cage" and "vial" are
random,  how do I do the same analysis using lme?  I tried to no avail.

Federico Calboli


Federico C.F. Calboli

Department of Biology
University College London
Room 327
Darwin Building
Gower Street

Tel: (+44) 020 7679 4395 
Fax (+44) 020 7679 7096
f.calboli at ucl.ac.uk

More information about the R-help mailing list