In statistics, one-way analysis of variance (or one-way ANOVA) is a technique to compare whether two or more samples' means are significantly different (using the F distribution). This analysis of variance technique requires a numeric response variable "Y" and a single explanatory variable "X", hence "one-way".[1]
The ANOVA tests the null hypothesis, which states that samples in all groups are drawn from populations with the same mean values. To do this, two estimates are made of the population variance. These estimates rely on various assumptions (see below). The ANOVA produces an F-statistic, the ratio of the variance calculated among the means to the variance within the samples. If the group means are drawn from populations with the same mean values, the variance between the group means should be lower than the variance of the samples, following the central limit theorem. A higher ratio therefore implies that the samples were drawn from populations with different mean values.[1]
Typically, however, the one-way ANOVA is used to test for differences among at least three groups, since the two-group case can be covered by a t-test (Gosset, 1908). When there are only two means to compare, the t-test and the F-test are equivalent; the relation between ANOVA and t is given by F = t2. An extension of one-way ANOVA is two-way analysis of variance that examines the influence of two different categorical independent variables on one dependent variable.
The results of a one-way ANOVA can be considered reliable as long as the following assumptions are met:
If data are ordinal, a non-parametric alternative to this test should be used such as Kruskal–Wallis one-way analysis of variance. If the variances are not known to be equal, a generalization of 2-sample Welch's t-test can be used.[2]
ANOVA is a relatively robust procedure with respect to violations of the normality assumption.[3]
The one-way ANOVA can be generalized to the factorial and multivariate layouts, as well as to the analysis of covariance.
It is often stated in popular literature that none of these F-tests are robust when there are severe violations of the assumption that each population follows the normal distribution, particularly for small alpha levels and unbalanced layouts.[4] Furthermore, it is also claimed that if the underlying assumption of homoscedasticity is violated, the Type I error properties degenerate much more severely.[5]
However, this is a misconception, based on work done in the 1950s and earlier. The first comprehensive investigation of the issue by Monte Carlo simulation was Donaldson (1966).[6] He showed that under the usual departures (positive skew, unequal variances) "the F-test is conservative", and so it is less likely than it should be to find that a variable is significant. However, as either the sample size or the number of cells increases, "the power curves seem to converge to that based on the normal distribution". Tiku (1971) found that "the non-normal theory power of F is found to differ from the normal theory power by a correction term which decreases sharply with increasing sample size."[7] The problem of non-normality, especially in large samples, is far less serious than popular articles would suggest.
The current view is that "Monte-Carlo studies were used extensively with normal distribution-based tests to determine how sensitive they are to violations of the assumption of normal distribution of the analyzed variables in the population. The general conclusion from these studies is that the consequences of such violations are less severe than previously thought. Although these conclusions should not entirely discourage anyone from being concerned about the normality assumption, they have increased the overall popularity of the distribution-dependent statistical tests in all areas of research."[8]
For nonparametric alternatives in the factorial layout, see Sawilowsky.[9] For more discussion see ANOVA on ranks.
The normal linear model describes treatment groups with probability distributions which are identically bell-shaped (normal) curves with different means. Thus fitting the models requires only the means of each treatment group and a variance calculation (an average variance within the treatment groups is used). Calculations of the means and the variance are performed as part of the hypothesis test.
The commonly used normal linear models for a completely randomized experiment are:[10]
yi,j=\muj+\varepsiloni,j
yi,j=\mu+\tauj+\varepsiloni,j
i=1,...c,I
j=1,...c,J
Ij
I=\sumjIj
yi,j
\muj
\mu
\tauj
\sum\tauj=0
\muj=\mu+\tauj
\varepsilon\thicksimN(0,\sigma2)
\varepsiloni,j
The index
i
i
i
j
One form of organizing experimental observations
yij
Lists of Group Observations | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
I1 | I2 | I3 | ...o | Ij | |||||||||||||||||||||||
1 | y11 | y12 | y13 | y1j | |||||||||||||||||||||||
2 | y21 | y22 | y23 | y2j | |||||||||||||||||||||||
3 | y31 | y32 | y33 | y3j | |||||||||||||||||||||||
\vdots | \vdots | ||||||||||||||||||||||||||
i | yi1 | yi2 | yi3 | ...o | yij | ||||||||||||||||||||||
Group Summary Statistics | Grand Summary Statistics | ||||||||||||||||||||||||||
| I1 | I2 | ...o | Ij | ...o | IJ |
| I=\sumIj | |||||||||||||||||||
Sum | \sumiyij | Sum | \sumj\sumiyij | ||||||||||||||||||||||||
Sum Sq | \sumi(yij)2 | Sum Sq | \sumj\sumi(yij)2 | ||||||||||||||||||||||||
Mean | m1 | ...o | mj | ...o | mJ | Mean | m | ||||||||||||||||||||
Variance |
| ...o |
| ...o |
| Variance | s2 |
Comparing model to summaries:
\mu=m
\muj=mj
Given the summary statistics, the calculations of the hypothesis test are shown in tabular form. While two columns of SS are shown for theirexplanatory value, only one column is required to display results.
MSError
\sigma2
The core ANOVA analysis consists of a series of calculations. The data is collected in tabular form. Then
If the experiment is balanced, all of the
Ij
In a more complex experiment, where the experimental units (or environmental effects) are not homogeneous, row statistics are also used in the analysis. The model includes terms dependent on
i
Consider an experiment to study the effect of three different levels of a factor on a response (e.g. three levels of a fertilizer on plant growth). If we had 6 observations for each level, we could write the outcome of the experiment in a table like this, where a1, a2, and a3 are the three levels of the factor being studied.
a1 | a2 | a3 | |
---|---|---|---|
6 | 8 | 13 | |
8 | 12 | 9 | |
4 | 9 | 11 | |
5 | 11 | 8 | |
3 | 6 | 7 | |
4 | 8 | 12 |
The null hypothesis, denoted H0, for the overall F-test for this experiment would be that all three levels of the factor produce the same response, on average. To calculate the F-ratio:
Step 1: Calculate the mean within each group:
\begin{align} \overline{Y}1&=
1 | |
6 |
\sumY1i=
6+8+4+5+3+4 | |
6 |
=5\\ \overline{Y}2&=
1 | |
6 |
\sumY2i=
8+12+9+11+6+8 | |
6 |
=9\\ \overline{Y}3&=
1 | |
6 |
\sumY3i=
13+9+11+8+7+12 | |
6 |
=10 \end{align}
Step 2: Calculate the overall mean:
\overline{Y}=
\sumi\overline{Y | |
i}{a} |
=
\overline{Y | |
1 |
+\overline{Y}2+\overline{Y}3}{a}=
5+9+10 | |
3 |
=8
where a is the number of groups.
Step 3: Calculate the "between-group" sum of squared differences:
\begin{align} SB&=
2 | |
n(\overline{Y} | |
1-\overline{Y}) |
+
2 | |
n(\overline{Y} | |
2-\overline{Y}) |
+
2 | |
n(\overline{Y} | |
3-\overline{Y}) |
\\[8pt] &=6(5-8)2+6(9-8)2+6(10-8)2=84 \end{align}
where n is the number of data values per group.
The between-group degrees of freedom is one less than the number of groups
fb=3-1=2
so the between-group mean square value is
MSB=84/2=42
Step 4: Calculate the "within-group" sum of squares. Begin by centering the data in each group
a1 | a2 | a3 | |
---|---|---|---|
6−5=1 | 8−9=−1 | 13−10=3 | |
8−5=3 | 12−9=3 | 9−10=−1 | |
4−5=−1 | 9−9=0 | 11−10=1 | |
5−5=0 | 11−9=2 | 8−10=−2 | |
3−5=−2 | 6−9=−3 | 7−10=−3 | |
4−5=−1 | 8−9=−1 | 12−10=2 |
The within-group sum of squares is the sum of squares of all 18 values in this table
\begin{align} SW=&(1)2+(3)2+(-1)2+(0)2+(-2)2+(-1)2+\\ &(-1)2+(3)2+(0)2+(2)2+(-3)2+(-1)2+\\ &(3)2+(-1)2+(1)2+(-2)2+(-3)2+(2)2\\ =& 1+9+1+0+4+1+1+9+0+4+9+1+9+1+1+4+9+4\\ =& 68\\ \end{align}
The within-group degrees of freedom is
fW=a(n-1)=3(6-1)=15
Thus the within-group mean square value is
MSW=SW/fW=68/15 ≈ 4.5
Step 5: The F-ratio is
F=
MSB | |
MSW |
≈ 42/4.5 ≈ 9.3
The critical value is the number that the test statistic must exceed to reject the test. In this case, Fcrit(2,15) = 3.68 at α = 0.05. Since F=9.3 > 3.68, the results are significant at the 5% significance level. One would not accept the null hypothesis, concluding that there is strong evidence that the expected values in the three groups differ. The p-value for this test is 0.002.
After performing the F-test, it is common to carry out some "post-hoc" analysis of the group means. In this case, the first two group means differ by 4 units, the first and third group means differ by 5 units, and the second and third group means differ by only 1 unit. The standard error of each of these differences is
\sqrt{4.5/6+4.5/6}=1.2
Note F(x, y) denotes an F-distribution cumulative distribution function with x degrees of freedom in the numerator and y degrees of freedom in the denominator.