Re: [R] anova p value extraction

2008-05-08 Thread Gavin Simpson
quote the variable name or index the results from anova as a dataframe using [. Someone (Prof. Ripley IIRC, apologies if I got this wrong) once told me that backticks ` are the preferred, portable way of doing this, but in this case " quotes work as well. > example(anova.lm) ## produces fit > tmp

Re: [R] anova p value extraction

2008-05-07 Thread H. Paul Benton
yep That worked Jorge. Thanks! summary(pb)$"Pr(>F)1" NULL > summ<-summary(pb) > class(unlist(summ)) [1] "numeric" > unlist(summ)["Pr(>F)1"] Pr(>F)1 0.02533637 > names(summ) NULL Jorge Ivan Velez wrote: > > Hi Paul, > > Perhaps > > # Data set > set.seed(123) > x=rnorm(100) > y=x+2*rnorm(10

Re: [R] anova p value extraction

2008-05-07 Thread Abhijit Dasgupta
What works, amazingly, is summary(pb)$"Pr(>F)" [note the quotes] Abhijit On Wed, 07 May 2008 18:17:09 -0700 "H. Paul Benton" <[EMAIL PROTECTED]> wrote: > Yea the anova object seems to be odd. It's not S4 so that's why I tried > originally the attr() funtion but > > summary(pb)$Pr(>F) > >

Re: [R] anova p value extraction

2008-05-07 Thread Jorge Ivan Velez
Hi Paul, Perhaps # Data set set.seed(123) x=rnorm(100) y=x+2*rnorm(100) # ANOVA AOV=anova(lm (y ~ x)) p1=AOV$"Pr(>F)"[1] p1 or # ANOVA 2 AOV1=aov(y ~ x) p2=unlist(summary(AOV1))["Pr(>F)1"] p2 HTH, Jorge On Wed, May 7, 2008 at 8:47 PM, Paul Benton <[EMAIL PROTECTED]> wrote: > hello all,

Re: [R] anova p value extraction

2008-05-07 Thread H. Paul Benton
Yea the anova object seems to be odd. It's not S4 so that's why I tried originally the attr() funtion but summary(pb)$Pr(>F) Error: unexpected '>' in "summary(pb)$Pr(>" > summary(pb)$Pr NULL > summary(pb)@Pr(>F) Error: unexpected '>' in "summary(pb)@Pr(>" > summary(pb)@Pr(F) Error: no slo

[R] anova p value extraction

2008-05-07 Thread Paul Benton
hello all, Quick question, how do I get the p value out of the anova? Thanks, Paul > pb<-aov(as.numeric(diff[5,16:33]) ~ grF) > summary(pb) Df Sum SqMean Sq F value Pr(>F) grF 3 2.7860e+10 9.2867e+09 4.2236 0.02534 * Residuals 14 3.0783e+10 2.1988e+09 --- Signif