[R] ANOVA tables - storing F values

bartjoosen bartjoosen at hotmail.com
Tue Aug 12 10:17:58 CEST 2008


Hi,

lets look at an example:
fit <- lm(sr ~ ., data = LifeCycleSavings)
fit.anova <- anova(fit)

you can see the structure from the anova:
str(fit.anova)

Classes ‘anova’ and 'data.frame':       5 obs. of  5 variables:
 $ Df     : int  1 1 1 1 45
 $ Sum Sq : num  204.1  53.3  12.4  63.1 650.7
 $ Mean Sq: num  204.1  53.3  12.4  63.1  14.5
 $ F value: num  14.116  3.689  0.858  4.360     NA
 $ Pr(>F) : num  0.000492 0.061125 0.359355 0.042471       NA
 - attr(*, "heading")= chr  "Analysis of Variance Table\n" "Response: sr"


Here you see that you can acces the F values by typing: fit.anova$"F value"
or by fit.anova[,"F value"]
Use the same method for your p-values.

the other way you mentioned brings you to the same methods:
attributes(fit.anova)

$names
[1] "Df"      "Sum Sq"  "Mean Sq" "F value" "Pr(>F)" 

$..........


Best regards

Bart
-- 
View this message in context: http://www.nabble.com/ANOVA-tables---storing-F-values-tp18937255p18939847.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list