[R] aov() usage

R. Michael Weylandt michael.weylandt at gmail.com
Mon Oct 8 09:17:26 CEST 2012


On Mon, Oct 8, 2012 at 3:49 AM, Jhope <jeanwaijang at gmail.com> wrote:
> Hi R-listers,
>
> I am wondering if the function aov() in plyr is appropriate for two
> different types of tests:
>
> 1) > summary(aov(EDI ~ VegIndex, data=data.to.analyze))
>
> AND
>
> 2) > summary(aov(HSuccess ~ VegIndex + Aeventexhumed +
> VegIndex:Aeventexhumed, data=data.to.analyze))
>
> the later inclusive of an interaction of the two explanatory variables.
>
> This is for obtaining P value and F statistics.
>
> Please advise, Jean

1) aov() is not from plyr. If you type "aov" at the prompt (no
parentheses) you'll see its clearly from stats.

2) You can write

hSuccess ~ VegIndex + Aeventexhumed + VegIndex:Aeventexhumed

more easily as

hSuccess ~ VegIndex * Aeventexhumed

3) Yes it should. Run

example(aov)

to see how.

Cheers,
Michael




More information about the R-help mailing list