Solving a One-Way ANOVA Problem
A one-way analysis of variance (ANOVA) tests whether the means of several independent groups can reasonably be treated as equal. Its central calculation compares variation among the group means with variation within the groups. A careful solution must do more than calculate an F statistic: it must select the right sums of squares, use the corresponding degrees of freedom, check whether the model assumptions are credible, and state what the test does—and does not—establish.
The method below is aligned with the SOA VEE Mathematical Statistics syllabus. The examples use hypothetical studies and focus on the overall test of equal means, not on identifying which particular group means differ.
Write \(n_i\) for the size of group \(i\), \(N=\sum_{i=1}^{k}n_i\) for the total sample size, \(\bar{Y}_i\) for group \(i\)'s sample mean, and \(\bar{Y}\) for the grand mean across all observations. The sums of squares measure variation around these means.
The between-group sum of squares measures how far the observed group means lie from the grand mean, weighted by their group sizes. The within-group sum of squares measures how far observations lie from their own group mean. The degrees of freedom are \(k-1\) between groups, \(N-k\) within groups, and \(N-1\) in total. Dividing each sum of squares by its degrees of freedom gives its mean square. The test statistic is the between-group mean square divided by the within-group mean square.
Why the Sums of Squares Add
The partition is not an extra assumption; it follows from splitting each observation’s deviation from the grand mean into two parts:
When the square of this expression is summed over observations, the cross-product terms add to zero. For each group, \(\sum_j(Y_{ij}-\bar{Y}_i)=0\), so the cross-product involving the group mean’s deviation has a factor of zero. The remaining squared terms are exactly the within-group and between-group sums of squares. This identity is a useful check: if the two components do not add to the total, a calculation or transcription is wrong.
A Reliable Exam Workflow
There is one response and one categorical grouping factor. The null says all group means are equal; the alternative says at least one is different.
Use group sizes and means for the between-group component. Use deviations from each group mean, or supplied within-group sums of squares, for the within-group component.
Confirm that total sum of squares is the sum of its two components and that the degrees of freedom add to \(N-1\).
Use within-group mean square in the denominator. Compare the result with a critical value or obtain its upper-tail P-value, then evaluate the design and residual evidence.
Say whether the data provide evidence against equal means, at the stated significance level. Do not claim that every mean differs or that the test identifies which means differ.
Worked Example: Testing Three Hypothetical Calibration Methods
A laboratory compares the average measurement error from three hypothetical calibration methods. The measurements are independent, the methods were assigned to experimental units at random, and the residual plots show no pronounced skewness or extreme outliers. The group summaries are:
Method A: \(n_1=4\), \(\bar{Y}_1=10\), within-group sum of squares \(4\). Method B: \(n_2=5\), \(\bar{Y}_2=12\), within-group sum of squares \(8\). Method C: \(n_3=3\), \(\bar{Y}_3=14\), within-group sum of squares \(4\). Test equality of the three means at the 5% significance level.
Method and hypotheses. Use the one-way fixed-effects ANOVA F test. The null is \(\mu_1=\mu_2=\mu_3\); the alternative is that at least one method mean differs. Here \(k=3\) and \(N=4+5+3=12\).
Grand mean. The group totals are \(4(10)=40\), \(5(12)=60\), and \(3(14)=42\). Thus the total is \(142\), and
Between-group sum of squares. Weight each squared difference from the grand mean by its group size:
Within-group and total sums of squares. Add the supplied within-group values: \(SS_{\text{within}}=4+8+4=16\). Therefore \(SS_{\text{total}}=27.6667+16=43.6667\).
Degrees of freedom and mean squares. Between groups, \(df=3-1=2\); within groups, \(df=12-3=9\); total, \(df=11\). They check because \(2+9=11=N-1\). The mean squares are \(MS_{\text{between}}=27.6667/2=13.8333\) and \(MS_{\text{within}}=16/9=1.7778\).
For \(2\) and \(9\) degrees of freedom, the upper-tail P-value is approximately \(0.0109\). Since \(0.0109<0.05\), reject the null hypothesis. The data provide evidence that not all three method means are equal. The assumption check is reasonably supportive: the stated design supports independence, the residual plots raise no stated normality concern, and the estimated group variances are \(4/3=1.3333\), \(8/4=2\), and \(4/2=2\). These estimates are not identical, but are not sharply separated in this small example. This check does not prove the assumptions.
Check and trap avoided. The sums of squares add to \(43.6667\), and the degrees of freedom add to \(11\). A common error is to use \(SS_{\text{total}}\) in the denominator of the F ratio. The correct denominator is \(MS_{\text{within}}=SS_{\text{within}}/9\), because it estimates the common within-group error variance under the model.
Completing the Test and Avoiding a Denominator Error
The F statistic is large when the observed separation among group means is large relative to the variation among observations within groups. Under the null hypothesis and the stated model assumptions, its reference distribution is an F distribution with \(k-1\) numerator and \(N-k\) denominator degrees of freedom. A small upper-tail P-value indicates that a statistic at least this large would be unusual if the group means were all equal and the model held.
Worked Example: Finding the Correct Error Term
A hypothetical materials study compares three production settings, with four independent specimens measured under each setting. The sample means are \(5\), \(6\), and \(9\) units. The within-group sums of squares are \(12\), \(12\), and \(12\). Assume the randomization and residual checks support the one-way ANOVA assumptions. Test equality of the means at the 5% level.
Method and grand mean. This is a one-way ANOVA with \(k=3\) groups and \(N=12\). Each group has the same size, so the grand mean is \((5+6+9)/3=20/3=6.6667\).
Between-group sum of squares. Each group has size four:
The within-group sum of squares is \(12+12+12=36\), so the total is \(34.6667+36=70.6667\). The degrees of freedom are \(2\), \(9\), and \(11\), respectively. The mean squares are \(34.6667/2=17.3333\) between groups and \(36/9=4\) within groups.
The upper-tail P-value for \(F=4.3333\) with \(2\) and \(9\) degrees of freedom is approximately \(0.0481\). Since \(0.0481<0.05\), reject equal means at the 5% level. The result is just below the stated significance threshold, so it should not be described as overwhelming evidence.
Common mistake and correction. An incorrect calculation might divide the between-group mean square by the total mean square, \(70.6667/11=6.4242\), giving \(17.3333/6.4242\approx2.698\). That is not the ANOVA test statistic: total variation contains both between- and within-group variation. The correct error term is the within-group mean square, \(36/9=4\), giving \(F=4.3333\). The components also pass the check \(34.6667+36=70.6667\).
Assumptions and Interpretation Are Part of the Answer
A correct arithmetic result is not automatically a sound inference. The standard one-way F test assumes independent observations, normally distributed errors within groups, and a common error variance across groups. Independence is primarily supported by the sampling or experimental design; a residual plot cannot repair dependence caused by repeated measurements or clustered observations. Normality and equal variance are assessed using the observations or residual diagnostics, with particular care when group sizes are small.
The F test is an overall test. Rejecting the null supports the conclusion that at least one population mean differs, but it does not show that all means differ or identify the differing groups. Failing to reject means the data do not provide sufficient evidence against equality at the chosen significance level; it does not prove that the means are equal. Any follow-up comparison requires an appropriate method beyond this overall test.
A practical warning is that markedly different group variances can undermine the standard F reference distribution, particularly when sample sizes are also unequal. In that situation, report the diagnostic concern and qualify the conventional test result rather than presenting its P-value as unconditionally reliable.
Worked Example: Interpreting a Test With Unequal Variability
A hypothetical field study compares a response under three monitoring protocols. The groups are independent, but the residual summary indicates substantial differences in spread. The group sizes are \(3,6,3\), the means are \(8,10,12\), and the within-group sums of squares are \(1,30,1\). Calculate the conventional ANOVA statistic, assess the assumption, and state an appropriate conclusion at the 5% level.
Method and grand mean. There are \(N=12\) observations. The group totals are \(3(8)=24\), \(6(10)=60\), and \(3(12)=36\), for a total of \(120\). Hence \(\bar{Y}=120/12=10\).
Sums of squares. The between-group sum of squares is
The within-group sum of squares is \(1+30+1=32\), so the total is \(24+32=56\). The degrees of freedom are \(2\) between groups, \(9\) within groups, and \(11\) total. Thus \(MS_{\text{between}}=24/2=12\) and \(MS_{\text{within}}=32/9=3.5556\), giving
The nominal upper-tail P-value for \(F=3.375\) with \(2\) and \(9\) degrees of freedom is approximately \(0.0806\), which exceeds \(0.05\). But the group sample variances are \(1/2=0.5\), \(30/5=6\), and \(1/2=0.5\); the largest is 12 times the smallest. This is a substantial warning about the equal-variance assumption, especially with these small, unequal group sizes.
Conclusion and trap avoided. The conventional calculation does not reject equal means at 5%, but the variance evidence makes its usual reference distribution questionable. It would be a mistake to conclude that the population means are equal or to report the nominal P-value without qualification. The sum-of-squares check passes (\(24+32=56\)); the concern is the model assumption, not the arithmetic.
Final Checks Before Reporting
- Use the within-group sum of squares—not the total sum of squares—as the F-test error component.
- Confirm that the between- and within-group degrees of freedom sum to \(N-1\).
- Check that \(SS_{\text{between}}+SS_{\text{within}}=SS_{\text{total}}\).
- State the significance level and interpret the result as evidence for or against the overall equality of means.
- Describe assumption concerns explicitly; a numerical F statistic does not establish that the model is appropriate.
Check Your Understanding
For each problem, identify the correct ANOVA quantities and keep the conclusion within the scope of the overall test.
- A hypothetical study has three groups of size \(3\), with means \(4,5,7\), and within-group sums of squares \(2,2,2\). Find \(SS_{\text{between}}\), \(SS_{\text{within}}\), and the F statistic. (Answer: \(SS_{\text{between}}=14\), \(SS_{\text{within}}=6\), \(F=7\) with \(2\) and \(6\) degrees of freedom.)
- Two independent groups have sizes \(4\) and \(4\), means \(20\) and \(22\), and within-group sums of squares \(6\) and \(10\). Find the overall F statistic. (Answer: \(SS_{\text{between}}=8\), \(SS_{\text{within}}=16\), and \(F=3\) with \(1\) and \(6\) degrees of freedom.)
- Three groups each have size \(5\), with means \(3,5,7\) and total within-group sum of squares \(20\). Find the F statistic and decide at the 5% level, using the approximate upper-tail P-value. (Answer: \(SS_{\text{between}}=40\), \(F=12\) with \(2\) and \(12\) degrees of freedom, \(P\approx0.0014\); reject equal means.)
- Three groups each have size \(4\), with within-group sums of squares \(3,30,3\). What are the estimated group variances, and what assumption issue should be reported before relying on the standard F test? (Answer: \(1,10,1\); the marked variance difference raises concern about the equal-variance assumption.)