[R] access elements of summary.aov?

Liviu Andronic landronimirc at gmail.com
Mon Oct 19 14:41:42 CEST 2009


Dear all
How do I access individual elements of a "summary.aov" object?
> data(iris)
> AnovaModel.1 <- aov(Sepal.Length ~ Species, data=iris)
> tmp <- summary(AnovaModel.1)
> tmp
             Df Sum Sq Mean Sq F value Pr(>F)
Species       2   63.2    31.6     119 <2e-16 ***
Residuals   147   39.0     0.3
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> str(tmp)
List of 1
 $ :Classes 'anova' and 'data.frame':	2 obs. of  5 variables:
  ..$ Df     : num [1:2] 2 147
  ..$ Sum Sq : num [1:2] 63.2 39
  ..$ Mean Sq: num [1:2] 31.606 0.265
  ..$ F value: num [1:2] 119 NA
  ..$ Pr(>F) : num [1:2] 1.67e-31 NA
 - attr(*, "class")= chr [1:2] "summary.aov" "listof"
> tmp$1
Error: unexpected numeric constant in "tmp$1"
> tmp$"1"
NULL
> tmp$""
NULL

Thank you
Liviu




-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail




More information about the R-help mailing list