Analysis of Variance
Analysis of variance (ANOVA) is a methodology for breaking down total variance into components.
Description
Total variance can be broken into between-group variance and within-group variance. By comparing the two components, it is possible to infer whether groups are different. That is to say, between-group variance being much larger than within-group variance suggests that the groups have differing means.
One-way ANOVA
The one-way ANOVA model is specified as:
where i indexes groups and j indexes the observations within group i.
This model can be re-expressed in the general linear model (by dummy coding the group variable), and can therefore be fit by OLS. The intercept term is the group mean for the reference group. Each coefficient is the difference between the corresponding group's mean and the reference group; the second group's mean is the sum of the intercept and the first coefficient.
The primary test applied to a one-way ANOVA is Tukey's range test. The null hypothesis is that all group means are equal.
Two-way ANOVA
The two-way ANOVA model is specified as:
where i indexes groups in the first factor, j indexes groups in the second factor, and k indexes the observations within group i,j.
There are three ways to test a two-way ANOVA model:
The type I test (sometimes referred to as sequential) considers factors in the order they are introduced into a model. Effectively this means that factor A is tested based on SS(A), then factor B is tested based on SS(B|A), and so on. In other words, the test statistics will depend on the order of factors. This can be ideal for exploratory analyses.
The type II test (variably referred to as simultaneous, hierarchical, or marginal) determines how much variance is explained by a factor given all other (main) factors. Factor A is tested based on SS(A|B) and factor B is tested based on SS(B|A). Interactions are treated secondarily, e.g. SS(A:B|A,B), so there is still a degree of sequential importance.
The type III test (sometimes also referred to as simultaneous) determines how much variance is explained by a factor given all other factors. In this case, interaction effects are treated the same as main effects. Factor A is tested based on SS(A|B,A:B), and so on.
