ABSTRACT

Analysis of variance, ANOVA, is a method of comparing means across samples based on variations from the mean. A one-way analysis of variance is a generalization of the t-test for two independent samples, allowing us to compare population means for several independent samples. The calculations to perform an analysis of variance need not be so complicated, as R has functions to compute the values desired. These functions use model formulas. The alternative aov function will also perform an analysis of variance. It returns a model object similar to lm but has different-looking outputs for the print and summary extractor functions. The mathematics behind analysis of variance is the same as that behind linear regression. Namely, it uses least-squares estimates based on a linear model. When analysis of variance is performed with lm, the output of summary displays numerous statistical tests.