[R] ANCOVA with random factor

David Semmens d.semmens at pgrad.unimelb.edu.au
Thu Mar 16 07:48:30 CET 2006


I would like to know if there is a way of directly calculating the 
F-ratio of a random effect using the "aov" function. I have 2 factors 
in my model, "population" which is random and "length" which is the 
length of female fish within each population. The dependent variable is 
"diam" which is the average diameter of eggs produced by each female. 
At present I set up the model like this:

 >model <- aov(diam~population*length, data=data)
 >anova(model)

then using the output:

 >ratio=MS-population/MS-interaction
 >1-pf(ratio, df-population,df-interaction)

Is there a way of getting r to calculate the correct F-ratio for a 
random factor and present it in the original output?

Thanks,
David Semmens.




More information about the R-help mailing list