[R] ANCOVA with random factor

Spencer Graves spencer.graves at pdf.com
Mon Mar 20 18:10:02 CET 2006

	  I don't understand:  I just ran the first example in the "aov" help 
page, and it produced F ratios and p values.

	  If this does not answer your question, I suggest you read Pinheiro 
and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer) if you 
haven't already and try to use lme for what you want.  If all your 
applications are perfectly balanced, then aov may be fine for you. 
However, the function "aov" codified routine practice for this kind of 
problem as of ~1980.  However, there have been substantive developments 
in this area since then, and Pinheiro and Bates is the best reference I 
know on both the theory and the application -- as of 2000.

	  hope this helps.
	  spencer graves

David Semmens wrote:

> 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.
> ______________________________________________
> R-help at 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

More information about the R-help mailing list