Kickstarting R - ANOVAs


For more complex hypotheses, we'll have to go to ANOVAs. As a pretty artifical example, we'll combine the test performed in the t-test example with another test in a simple ANOVA using aov(), asking if case and education and their interaction have any association with age.

> anova(aov(age~case*education,infert))
Analysis of Variance Table
Response: age
                Df Sum Sq Mean Sq F value    Pr(>F)
case             1    0.1     0.1  0.0034    0.9536
education        2  753.3   376.7 15.0456 6.938e-07
case:education   2    0.2     0.1  0.0031    0.9969
Residuals      242 6058.4    25.0 

We're getting pretty much the same answers, except that the variance has been partitioned appropriately for looking at the more complex question. anova() produces the ANOVA table from the output of aov().

For a much more detailed treatment of ANOVAs and other methods, get the VR package or Notes on the use of R..." in the Contributed documentation page.

Back to Table of Contents