[R] extracting p-values from Anova objects (from the car library)

Sarah Goslee sarah.goslee at gmail.com
Mon Aug 23 23:49:01 CEST 2010


I didn't follow the earlier replies, but since you still can't seem to
get p-values, what about this:
(I also couldn't run your sample code, so this is a toy example;
and do you mean anova() - I'm not familiar with Anova(), and
didn't see anything with ??Anova)

> x <- runif(100)
> y <- runif(100)
> xy.anova <- anova(lm(y ~ x))
> xy.anova
Analysis of Variance Table

Response: y
          Df Sum Sq  Mean Sq F value Pr(>F)
x          1 0.0001 0.000086   0.001 0.9745
Residuals 98 8.2018 0.083692
> names(xy.anova)
[1] "Df"      "Sum Sq"  "Mean Sq" "F value" "Pr(>F)"
> xy.anova$"Pr(>F)"
[1] 0.9745443        NA


Sarah

On Mon, Aug 23, 2010 at 5:35 PM, Johan Steen <johan.steen at gmail.com> wrote:
> Thanks for your replies,
>
> but unfortunately none of them seem to help.
> I do get p-values in the output, but can't seem to locate them anywhere in
> these objects via the str() function. I also get very different output using
> str() than you obtained from the lm help page
>



-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list