I performed an aov() analysis and got the following results: Df Sum Sq Mean Sq F value Pr(>F) block 1 0.0040 0.0040 0.3282 0.5672 Residuals 269 3.2766 0.0122 Can anyone tell me how to extract the F value column and Pr(>F) column from the summary output of aov analysis? Many thanks in advance, Liqing Eco. Evol. Biol. UCIrvine -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Liqing Zhang <lzhang at ea.oac.uci.edu> writes:> I performed an aov() analysis and got the following results: > > Df Sum Sq Mean Sq F value Pr(>F) > block 1 0.0040 0.0040 0.3282 0.5672 > Residuals 269 3.2766 0.0122 > > Can anyone tell me how to extract the F value column and Pr(>F) column > from the summary output of aov analysis?Slightly tricky because there's really a list of tables involved, due to the multistratum aspect of aov: summary(npk.aov)[[1]]$"F value" etc. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Liqing Zhang <lzhang at ea.oac.uci.edu> writes:> >I performed an aov() analysis and got the following results: > > Df Sum Sq Mean Sq F value Pr(>F) >block 1 0.0040 0.0040 0.3282 0.5672 >Residuals 269 3.2766 0.0122 > >Can anyone tell me how to extract the F value column and Pr(>F) column >from the summary output of aov analysis?I thought that would be easy but the summary() object of aov() seems to be an odd beast. Fiddling around I came up with this: data(warpbreaks) LZ.aov <- summary(aov(breaks ~ wool + tension, data = warpbreaks)) LZ.aov.fp <- cbind(LZ.aov[[1]]$"F value", LZ.aov[[1]]$"Pr(>F)") colnames(LZ.aov.fp) <- c("F", "p") All we need now is to get the right row-names. I suppose that will require a function that will extract the variable names from the formula. Mark -- Mark Myatt -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 22 May 2001, Mark Myatt wrote:> Liqing Zhang <lzhang at ea.oac.uci.edu> writes: > > > >I performed an aov() analysis and got the following results: > > > > Df Sum Sq Mean Sq F value Pr(>F) > >block 1 0.0040 0.0040 0.3282 0.5672 > >Residuals 269 3.2766 0.0122 > > > >Can anyone tell me how to extract the F value column and Pr(>F) column > >from the summary output of aov analysis? >eg data(warpbreaks) LZ.aov <- summary(aov(breaks ~ wool + tension, data = warpbreaks)) as.data.frame(LZ.aov[[1]][,4:5]) F value Pr(>F) wool 3.339316 0.073613669 tension 7.536651 0.001377778 Residuals NA NA This is for an aov() with a single response. The complicated structure is because you can have multiple responses, which would give a list of anova tables as the summary. -thomas Thomas Lumley Asst. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._