delphine.fontaine at genexion.com
2008-Jan-02 19:49 UTC
[R] extracting pvalue from ANOVA with repeated measures
I made an ANOVA with repeated mesures (aov(Mesure~Distance*Genre*Correct+Error(Sujet/(Distance*Genre*Correct)), data)) and I would like to extract the pvalues. The output is: ----------------------------------------------------------- Error: Sujet Df Sum Sq Mean Sq F value Pr(>F) Residuals 21 97.082 4.623 Error: Sujet:Distance Df Sum Sq Mean Sq F value Pr(>F) Distance 1 0.043 0.043 0.0162 0.9 Residuals 21 56.283 2.680 Error: Sujet:Genre Df Sum Sq Mean Sq F value Pr(>F) Genre 1 0.026 0.026 0.0055 0.9416 Residuals 21 98.849 4.707 Error: Sujet:Correct Df Sum Sq Mean Sq F value Pr(>F) Correct 1 3.208 3.208 0.9564 0.3392 Residuals 21 70.435 3.354 Error: Sujet:Distance:Genre Df Sum Sq Mean Sq F value Pr(>F) Distance:Genre 1 0.322 0.322 0.0975 0.7579 Residuals 21 69.388 3.304 Error: Sujet:Distance:Correct Df Sum Sq Mean Sq F value Pr(>F) Distance:Correct 1 0.108 0.108 0.0271 0.8709 Residuals 21 83.536 3.978 Error: Sujet:Genre:Correct Df Sum Sq Mean Sq F value Pr(>F) Genre:Correct 1 0.510 0.510 0.103 0.7515 Residuals 21 103.972 4.951 Error: Sujet:Distance:Genre:Correct Df Sum Sq Mean Sq F value Pr(>F) Distance:Genre:Correct 1 7.677 7.677 2.1301 0.1592 Residuals 21 75.686 3.604 Error: Within Df Sum Sq Mean Sq F value Pr(>F) Residuals 176 671.91 3.82 ----------------------------------------------------------- Each table is a list of length 1. So I can't extract the Pvalue because I can't split each element. Any idea ? thanks ! Delphine
Henrique Dallazuanna
2008-Jan-02 20:01 UTC
[R] extracting pvalue from ANOVA with repeated measures
Try this: lapply(lapply(your_object, "[[", 1), "[[", "Pr(>F)") where the object is of class summary.aovlist -- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O On 02/01/2008, delphine.fontaine at genexion.com <delphine.fontaine at genexion.com> wrote:> I made an ANOVA with repeated mesures > (aov(Mesure~Distance*Genre*Correct+Error(Sujet/(Distance*Genre*Correct)), > data)) and I would like to extract the pvalues. > > The output is: > ----------------------------------------------------------- > Error: Sujet > Df Sum Sq Mean Sq F value Pr(>F) > Residuals 21 97.082 4.623 > > Error: Sujet:Distance > Df Sum Sq Mean Sq F value Pr(>F) > Distance 1 0.043 0.043 0.0162 0.9 > Residuals 21 56.283 2.680 > > Error: Sujet:Genre > Df Sum Sq Mean Sq F value Pr(>F) > Genre 1 0.026 0.026 0.0055 0.9416 > Residuals 21 98.849 4.707 > > Error: Sujet:Correct > Df Sum Sq Mean Sq F value Pr(>F) > Correct 1 3.208 3.208 0.9564 0.3392 > Residuals 21 70.435 3.354 > > Error: Sujet:Distance:Genre > Df Sum Sq Mean Sq F value Pr(>F) > Distance:Genre 1 0.322 0.322 0.0975 0.7579 > Residuals 21 69.388 3.304 > > Error: Sujet:Distance:Correct > Df Sum Sq Mean Sq F value Pr(>F) > Distance:Correct 1 0.108 0.108 0.0271 0.8709 > Residuals 21 83.536 3.978 > > Error: Sujet:Genre:Correct > Df Sum Sq Mean Sq F value Pr(>F) > Genre:Correct 1 0.510 0.510 0.103 0.7515 > Residuals 21 103.972 4.951 > > Error: Sujet:Distance:Genre:Correct > Df Sum Sq Mean Sq F value Pr(>F) > Distance:Genre:Correct 1 7.677 7.677 2.1301 0.1592 > Residuals 21 75.686 3.604 > > Error: Within > Df Sum Sq Mean Sq F value Pr(>F) > Residuals 176 671.91 3.82 > ----------------------------------------------------------- > > Each table is a list of length 1. So I can't extract the Pvalue because I > can't split each element. Any idea ? > > thanks ! > > Delphine > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >