[R] Random or fixed factors

CG Pettersson cg.pettersson at evp.slu.se
Wed Jan 15 19:25:03 CET 2003

I work right now with my first real job in R. 
It´s a series of 12 fertilizer trials with three repetations. The treatments can be broken down to 2 x 2 factors (Product and Application).
Experimenting both with lm() and aov() makes me a little confused as I don´t get any differences in the sum of squares.

With aov() I have used a command of this type:   aov(Yield ~ Product * Application + Error(Trial/Block))
With lm() I have used something like: lm(Yield ~ Trial/Block + Product * Application) 

The placing of the term Trial/Block in the lm() statement doesn´t seem to matter. 
How do I tell R that the Trial term should be random in the lm() statement? It´s quite obvious that the Error term in aov() is random, but in the lm()? 
Is that implied of the fact that it has a nested term inside?
If so, and I don´t have plotwise data, how do I mark Trial as Random?

CG Pettersson
cg.pettersson at evp.slu.se

More information about the R-help mailing list