ExamSaathi learning library · Government exams · SSC CGL quantitative foundations; published syllabus labelled 2024 · Quantitative aptitude
One-way analysis of variance: comparing several group means
Test whether three or more group means are equal with one F test: split the total sum of squares into between-groups and within-groups parts, lay out the one-way ANOVA table and compare the F ratio with a stated critical value.
Status: original pilot lesson. Teacher review is pending. It is not a complete course or official exam material.
You will learn to
- Explain why a one-way analysis of variance compares several group means with one F test instead of many separate t tests.
- Calculate the correction factor, the total sum of squares and the between-groups and within-groups sums of squares for one-way classified data.
- Set out a one-way ANOVA table with degrees of freedom k - 1, N - k and N - 1, the mean squares and the F ratio.
- Decide whether the group means differ by comparing the one-way F ratio with a stated 5 percent or 1 percent critical value of F.
- Simplify one-way ANOVA arithmetic by subtracting a constant from every value, and state the assumptions behind the test.
Before you start
This lesson assumes you can find a mean, square small numbers and follow a hypothesis test that ends with a critical value. One-way classified data come in k groups that differ in just one factor, such as three wheat varieties or three teaching methods, with N values in all. The groups need not be the same size. For each group write T for its total and n for its number of values, and write G for the grand total of all N values. The letter x is kept for multiplication, so no value is called x. The null hypothesis H0 says that the k population means are all equal; the alternative H1 says that they are not all equal. Every data set here is invented for practice.
The idea: one test for several means
Why not run a t test on every pair of groups? Three groups make 3 pairs and four groups make 6. Each test at the 5 percent level carries its own risk of a false alarm, so over many tests the chance of at least one wrong rejection climbs well above 5 percent. One-way ANOVA asks a single question with a single test. It splits the spread of all the values about the grand mean into two parts. The between-groups part comes from the group means sitting apart from one another. The within-groups part comes from values scattering about their own group mean, which is chance variation only. Each part, divided by its degrees of freedom, becomes a mean square. If H0 is true, both mean squares estimate the same population variance, so their ratio F tends to be close to 1. Real differences among the means swell the between-groups mean square, so only a large F counts against H0, and the test uses the upper tail of the F distribution.
Sums of squares and the ANOVA table
Here SS stands for sum of squares and MS for mean square. Work in this order. 1. Correction factor: CF = G^2 / N. 2. Total SS = (sum of the squares of all N values) - CF. 3. Between-groups SS = sum of (T^2 / n) over the groups - CF; square each group total and divide it by that group's own size. 4. Within-groups SS = total SS - between-groups SS. The degrees of freedom are k - 1 between groups, N - k within groups and N - 1 in total, and the first two add up to the third. Each mean square is a sum of squares divided by its degrees of freedom: MSB = between-groups SS / (k - 1) and MSW = within-groups SS / (N - k). Then F = MSB / MSW, with (k - 1, N - k) degrees of freedom, numerator first. Write the table line by line. Between groups: SS, df, MS, F. Within groups: SS, df, MS. Total: SS, df. Reject H0 when F is larger than the stated upper critical value; otherwise do not reject H0. No sum of squares can be negative, so a negative within-groups SS points to an arithmetic slip.
Coding the data, unequal groups and assumptions
Large values make the squares heavy, so first subtract a convenient constant, such as a round number near the middle of the data, from every value. Each value then shifts by the same amount, the group means and the grand mean shift by that amount too, and every deviation stays as it was. So the total, between-groups and within-groups sums of squares, the mean squares and F are all unchanged. Only the group totals, G, CF and the raw sum of squares change, and some coded values may be negative. The constant must come off every value, never just some of them. When the groups have different sizes, use each group's own n in T^2 / n; nothing else changes. The test rests on three assumptions: each group is a random sample from a normal population, these populations share the same variance, and the samples are independent of one another. A significant F says only that the means are not all equal; it does not say which groups differ.
Common mistakes
Taking G^2 itself as the correction factor instead of G^2 / N, or forgetting to subtract CF at all. Dividing each squared group total by the number of groups instead of by that group's own size. Using N - 1 or k as the within-groups degrees of freedom; it is N - k. Putting MSW on top of the ratio; the between-groups mean square always goes on top. Reading the critical value for (N - k, k - 1) instead of (k - 1, N - k). Comparing the sums of squares directly without first turning them into mean squares. Rejecting H0 just because F is above 1. Treating do not reject H0 as proof that the means are equal, or treating a rejection as proof that every pair of means differs. Subtracting the coding constant from only some of the values.
A routine for one-way ANOVA
1. State H0 (all k means equal) and H1 (not all equal), and note k and N. 2. If the values are large, subtract a convenient constant from every one. 3. Find each group total T, its size n, the grand total G and CF = G^2 / N. 4. Total SS: square every value, add, and subtract CF. 5. Between-groups SS: add T^2 / n over the groups and subtract CF. 6. Within-groups SS = total SS - between-groups SS. 7. Degrees of freedom k - 1, N - k and N - 1, then the mean squares and F = MSB / MSW. 8. Compare F with the stated upper critical value for (k - 1, N - k) and write the decision in words. 9. Sense-check: no sum of squares is negative, and the degrees of freedom add up to N - 1.
Worked examples
Wheat yields (kg per plot) of three varieties, each grown on 4 equal plots near Ludhiana in Punjab, were: variety A 11, 12, 13, 14; variety B 7, 10, 11, 12; variety C 5, 6, 9, 10. Test at the 5 percent level whether the three varieties have the same mean yield. The 5 percent point of F with (2, 9) degrees of freedom is 4.26.
- H0: the three mean yields are equal; H1: they are not all equal. Here k = 3 and N = 12.
- Group totals: A 50, B 40, C 30, so G = 120 and CF = 120^2 / 12 = 14400 / 12 = 1200.
- Squares of the values: A 121 + 144 + 169 + 196 = 630, B 49 + 100 + 121 + 144 = 414, C 25 + 36 + 81 + 100 = 242, sum 1286. Total SS = 1286 - 1200 = 86.
- Between-groups SS = (50^2 + 40^2 + 30^2) / 4 - 1200 = 5000 / 4 - 1200 = 1250 - 1200 = 50. Within-groups SS = 86 - 50 = 36.
- Between groups: SS 50, df 2, MS 50 / 2 = 25, F = 25 / 4 = 6.25.
- Within groups: SS 36, df 9, MS 36 / 9 = 4. Total: SS 86, df 11.
- 6.25 is larger than 4.26, the 5 percent point of F(2, 9).
Answer: F = 6.25, above the critical value 4.26, so reject H0: the three varieties do not all have the same mean yield (their means are 12.5, 10 and 7.5 kg per plot).
Marks out of 100 of 12 students taught by three methods at a coaching centre in Jaipur were: lectures 61, 63, 65; group work 64, 65, 67, 68; online practice 59, 60, 63, 65, 68. Subtract 60 from every mark and test at the 5 percent level whether the three methods give the same mean mark. The 5 percent point of F(2, 9) is 4.26.
- Coded marks (mark - 60): lectures 1, 3, 5 (T = 9, n = 3); group work 4, 5, 7, 8 (T = 24, n = 4); online practice -1, 0, 3, 5, 8 (T = 15, n = 5). G = 48 and N = 12.
- CF = 48^2 / 12 = 2304 / 12 = 192.
- Squares of the coded marks: 1 + 9 + 25 = 35, 16 + 25 + 49 + 64 = 154 and 1 + 0 + 9 + 25 + 64 = 99, sum 288. Total SS = 288 - 192 = 96.
- Between-groups SS = 9^2 / 3 + 24^2 / 4 + 15^2 / 5 - 192 = 27 + 144 + 45 - 192 = 24. Within-groups SS = 96 - 24 = 72.
- Between groups: SS 24, df 2, MS 12, F = 12 / 8 = 1.5. Within groups: SS 72, df 9, MS 8. Total: SS 96, df 11.
- Coding changed G and CF but none of the sums of squares, so the original marks give the same F.
Answer: F = 1.5, below the critical value 4.26, so do not reject H0: these marks give no evidence that the three methods differ in mean mark (the means are 63, 66 and 63).
A dairy near Karnal tries four cattle feeds, each on 5 cows, and records each cow's daily milk yield in litres. The one-way analysis gives a between-feeds SS of 60 and a total SS of 140. Complete the ANOVA table and test at the 5 percent and the 1 percent levels. For F with (3, 16) degrees of freedom, the 5 percent point is 3.24 and the 1 percent point is 5.29.
- k = 4 and N = 20, so the degrees of freedom are 3 between feeds, 16 within feeds and 19 in total.
- Within-groups SS = 140 - 60 = 80.
- Between feeds: SS 60, df 3, MS 60 / 3 = 20. Within feeds: SS 80, df 16, MS 80 / 16 = 5. Total: SS 140, df 19.
- F = 20 / 5 = 4.
- At 5 percent, 4 is larger than 3.24, so reject H0. At 1 percent, 4 is smaller than 5.29, so do not reject H0.
Answer: F = 4 with (3, 16) degrees of freedom: reject H0 at the 5 percent level but do not reject H0 at the 1 percent level, so the feeds seem to differ, though the evidence is not strong enough for the stricter test.
Practice checks
- A factory in Coimbatore counts the defective items in three batches from each of three machines: machine P 4, 5, 6; machine Q 7, 8, 9; machine R 5, 6, 7. What is the between-groups (between machines) sum of squares?
- Five brands of LED bulbs are compared, with 4 bulbs of each brand. A one-way analysis gives a between-brands SS of 36 and a within-brands SS of 60. The 5 percent point of F(4, 15) is 3.06. Which statement is correct?
- Four groups of grocery shops in Bhopal, with 6, 5, 5 and 4 shops, are compared by one-way ANOVA. Which degrees of freedom does the F ratio have?
- Daily output (units) of three shifts at a Pune plant on three days was: morning 102, 104, 106; evening 105, 107, 109; night 101, 103, 105. Subtract 100 from every value and find F. The 5 percent point of F(2, 6) is 5.14. Which is correct?
- A researcher wants to compare the mean scores of four groups. Why is one ANOVA F test preferred to a separate t test on every pair of groups?
Sources checked
- SSC CGL Scheme and Syllabus, labelled 2024 — Tier-II Paper-II Statistics (Analysis of Variance: analysis of one-way classified data); not verified as the full 2026-cycle syllabus
- NIST/SEMATECH e-Handbook of Statistical Methods — Section 7.4.3.3, The ANOVA table and tests of hypotheses about means: treatment and error sums of squares, their degrees of freedom and mean squares, and the F ratio used to test whether the treatment means are equal; mathematical relationships only
- NIST/SEMATECH e-Handbook of Statistical Methods — Section 7.4.3.4, 1-Way ANOVA calculations: the correction for the mean from the grand total, the total sum of squares, the treatment sum of squares from treatment totals, the error sum of squares by subtraction, and the mean squares and F ratio; mathematical relationships only
- OpenStax, Introductory Statistics 2e — Section 13.1, the purpose of one-way ANOVA, testing whether several group means are equal, and its assumptions; ideas only