[R] Problems extracting p-value from summary(aov(...))

2010-09-29 Thread syrvn
Hi, I did a aov and used summary to obtain the p-value. I tried many ways to extract the p-value from the summary result but failed. Among others I tried the following: test.summary - summary(aov(data[,1]~time.points+Error(subject/time.points))) test.summary Error: subject Df

Re: [R] Problems extracting p-value from summary(aov(...))

2010-09-29 Thread Dennis Murphy
Hi: Try this: test.summary[[1]][, 5] It should return a vector of p-values, the last being NA. In your case, since there is only one non-NA p-value, it is enough to do test.summary[[1]][, 5][1] You mean that wasn't obvious? :) Explanation: summary(aovobj) actually returns a list, but

Re: [R] Problems extracting p-value from summary(aov(...))

2010-09-29 Thread peter dalgaard
On Sep 29, 2010, at 14:25 , Dennis Murphy wrote: test.summary[[1]][, 5][1] You mean that wasn't obvious? :) Worse, it doesn't actually work... test.summary - summary(npk.aovE) test.summary[[1]][, 5] Error in `[.default`(test.summary[[1]], , 5) : incorrect number of dimensions

Re: [R] Problems extracting p-value from summary(aov(...))

2010-09-29 Thread Dennis Murphy
Hi: On Wed, Sep 29, 2010 at 5:56 AM, peter dalgaard pda...@gmail.com wrote: On Sep 29, 2010, at 14:25 , Dennis Murphy wrote: test.summary[[1]][, 5][1] You mean that wasn't obvious? :) Worse, it doesn't actually work... test.summary - summary(npk.aovE) test.summary[[1]][, 5]

Re: [R] Problems extracting p-value from summary(aov(...))

2010-09-29 Thread Dennis Murphy
Hi: Someone off-list (Josh Wiley - thank you) mentioned the Error() term in the OP's ANOVA, which I missed in responding to the post - sorry for the misinformation. Using the npk example with code that Josh showed me, we have, for the following model, npk.aov2 - aov(yield ~ N*P*K +