Re: [R] ANOVA tables - storing F values

From: bartjoosen <bartjoosen_at_hotmail.com>
Date: Tue, 12 Aug 2008 01:17:58 -0700 (PDT)

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

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.

______________________________________________
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.
Received on Tue 12 Aug 2008 - 08:21:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 12 Aug 2008 - 10:33:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive