[R] RE: 1-way anova, nested model

Federico Calboli f.calboli at ucl.ac.uk
Wed May 19 16:14:58 CEST 2004


>From what I gather you have 

2 treatments
6 samples nested in treatment
12 replicates in sample.

I do not know what your dependent veriable is, but I would:

code the two treatments as T1 and T2
code the 6 samples as a, b, c, d, e, f so the first three samples
belonging to T1 are not confused with the other three (coding them as
1,2,3 for T1 and 1,2,3 for T2 is a bad idea)
code the replicates as a1, a2, b1, b2....

here I am being extra paranoid in the coding, btw, but it helps and
saves grief later on, in my experience.

The model would be:

library(nlme) # needed!
mod<-lme(response ~ treatment, random = ~ 1|sample/replicate, mydata)

An anova test would give only one F test for the fixed factor, with 1
and 4 df (if I am not mistaken, double check!)

Federico
-- 



=================================

Federico C. F. Calboli

Dipartimento di Biologia
Via Selmi 3
40126 Bologna
Italy

tel (+39) 051 209 4187
fax (+39) 051 209 4286

f.calboli at ucl.ac.uk
fcalboli at alma.unibo.it




More information about the R-help mailing list