Advanced Quantitative Methods 360-301 • CEGEP, Montreal

Corrected exercises: one-way analysis of variance (360-301)

These ten corrected exercises cover one-way analysis of variance (ANOVA) for Advanced Quantitative Methods, 360-301: the partition of the sums of squares, the complete ANOVA table, the F statistic, eta squared and post hoc multiple comparisons.

The thread of the set fits in one sentence: all the variation in the data splits exactly in two, what separates the groups and what remains inside them, and the test simply compares these two pieces once each has been brought back to its degrees of freedom.

Three traps are named outright: mean squares added up as if they were sums of squares, the mean of the means taken for the grand mean when the group sizes differ, and an omnibus rejection read as if every group differed from every other.

10 corrected exercises • 100 points • 150 minutes

This chapter is part of 360-301, every chapter with its set and sheet Before you start Revision sheet: the traps and the method for this chapter

Self-checking set Type your answers and check them question by question: the page tells you right or wrong before you open the solution. With an account, every answer right on the first try earns points, and your right answers stay filled in when you come back.

Course recap

  • • Number of pairwise comparisons: k(k−1)2\dfrac{k(k-1)}{2}. The overall risk is 1−(1−α)m1-\left(1-\alpha\right)^{m} for mm independent tests.
  • • H0H_{0}: all the means are equal. H1H_{1}: at least one differs. The test is OMNIBUS and does not say which one.
  • • SSbetween=∑nj(x‾j−x‾)2SS_{between}=\sum n_{j}\left(\overline{x}_{j}-\overline{x}\right)^{2}; SSwithin=∑(nj−1)sj2SS_{within}=\sum \left(n_{j}-1\right)s_{j}^{2}; SStotal=SSbetween+SSwithinSS_{total}=SS_{between}+SS_{within}.
  • • Degrees of freedom: k−1k-1 for the factor, N−kN-k for the residual, N−1N-1 in total. They add up, the MEAN SQUARES do not.
  • • MS=SSdfMS=\dfrac{SS}{df} and F=MSbetweenMSwithinF=\dfrac{MS_{between}}{MS_{within}}. The test is always right-tailed.
  • • With two groups, F=t2F=t^{2}: analysis of variance generalizes the t-test.
  • • η2=SSbetweenSStotal\eta^{2}=\dfrac{SS_{between}}{SS_{total}}: the share of the variance explained. Benchmarks 0.01 small, 0.06 medium, 0.14 large. It does NOT depend on the sample size.
  • • η2\eta^{2} is biased upward on small samples; ω2=SSbetween−(k−1)MSwithinSStotal+MSwithin\omega^{2}=\dfrac{SS_{between}-\left(k-1\right)MS_{within}}{SS_{total}+MS_{within}} corrects it.
  • • Assumptions: independence (never negotiable), normality (forgiving), homogeneity of variances (ratio of the extremes up to 4 if the sample sizes are equal).
  • • Post hoc comparisons: SE=MSwithin(1n1+1n2)SE=\sqrt{MS_{within}\left(\dfrac{1}{n_{1}}+\dfrac{1}{n_{2}}\right)}, with a corrected threshold, Bonferroni αm\dfrac{\alpha}{m} or Tukey's test.
  • • Unequal sample sizes: the grand mean must be WEIGHTED by the sample sizes, and the assumptions stop being forgiving.
  • • Repeated measures on the same subjects: this is no longer one-way analysis of variance but repeated-measures analysis of variance.

Part A: the basics (/50)

Exercise 1: Why analysis of variance rather than three t-tests

As soon as there are more than two groups, comparing the means two at a time multiplies the tests, and with them the false positives. Analysis of variance asks one single question at once: does at least one of the means differ from the others?

Three programs, five students each. A: 72, 75, 78, 80, 85. B: 65, 68, 70, 72, 75. C: 60, 64, 66, 69, 71.

566064687276808488ABC
  • a) How many pairwise comparisons would be needed with 3 groups? With 5 groups?
  • b) At the 5% level, what is the risk of reaching a wrong conclusion at least once with 5 groups?
  • c) State the hypotheses of one-way analysis of variance.
  • d) Compute the three group means and the grand mean.
  • e) The analysis of variance rejects the null hypothesis. What exactly do we know then, and what do we not know?

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 3×22=3\dfrac{3\times 2}{2}=3 pairs, and 5×42=10\dfrac{5\times 4}{2}=10 pairs
  • b) 1−0.9510≈0.40131-0.95^{10}\approx 0.4013, that is 40%40\% instead of the 5%5\% announced
  • c) H0H_{0}: μA=μB=μC\mu_{A}=\mu_{B}=\mu_{C}. H1H_{1}: at least one mean differs. Omnibus test
  • d) 7878, 7070, 6666, and grand mean 1,07015≈71.333\dfrac{1{,}070}{15}\approx 71.333
  • e) That at least one pair differs; not which, nor how many, nor by how much, hence η2\eta^{2} and the post hoc tests
a)

The number of pairs is k(k−1)2\dfrac{k(k-1)}{2}. With 3 groups: 3×22=3\dfrac{3\times 2}{2}=3 comparisons. With 5 groups: 5×42=10\dfrac{5\times 4}{2}=10 comparisons.

b)

If the five groups came from the same population, each test would have a 95% chance of not rejecting, so the probability of making no mistake in any of the ten is 0.9510≈0.59870.95^{10}\approx 0.5987. The risk of at least one wrong conclusion is therefore 1−0.5987≈0.40131-0.5987\approx 0.4013, that is 40%. We think we are working at a 5% risk and we are actually working at 40%: this is the inflation of the Type I error rate, and it is the reason analysis of variance exists.

c)

NULL hypothesis: μA=μB=μC\mu_{A}=\mu_{B}=\mu_{C}, the three programs have the same mean in the population. ALTERNATIVE hypothesis: at least one mean differs from the others. Note the cautious wording of the alternative: it says neither which one, nor how many, nor in which direction. This is what is called an OMNIBUS test, which answers a global question with a yes or a no.

d)

x‾A=72+75+78+80+855=3905=78\overline{x}_{A}=\dfrac{72+75+78+80+85}{5}=\dfrac{390}{5}=78. x‾B=3505=70\overline{x}_{B}=\dfrac{350}{5}=70. x‾C=3305=66\overline{x}_{C}=\dfrac{330}{5}=66. Grand mean: 390+350+33015=1,07015≈71.333\dfrac{390+350+330}{15}=\dfrac{1{,}070}{15}\approx 71.333. Since the groups have equal sizes, the grand mean is also the mean of the three means, which is no longer true when the sizes differ.

e)

We know that the three means are not all equal in the population: at least one pair differs. We do NOT know which pair, how many pairs, or in which direction. Answering those questions takes a second step, post hoc multiple comparisons, with a corrected threshold. And above all, a rejection says nothing about the SIZE of the differences: a measure such as η2\eta^{2} is needed, which gives the share of the variance in the marks explained by the program.

Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.

Exercise 2: Partitioning the variation: between and within

The idea of analysis of variance fits in one equality: all the variation in the marks splits exactly into two pieces, what separates the groups and what remains inside them.

The graph below shows the data.

566064687276808488ABCgrand mean
  • a) Compute the sum of squares BETWEEN groups, SSbetween=∑nj(x‾j−x‾)2SS_{between}=\sum n_{j}\left(\overline{x}_{j}-\overline{x}\right)^{2}.
  • b) Compute the sum of squares WITHIN groups, by adding the squared deviations from each group's own mean.
  • c) Check that their sum gives the total variation, and compute the latter directly as a check.
  • d) Give the degrees of freedom of each term and check that they add up too.
  • e) What does each of the two pieces measure, in one sentence per piece?

Type your answers, the page tells you right or wrong 0/12

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) SSbetween=5×74.667≈373.33SS_{between}=5\times 74.667\approx 373.33
  • b) 98+58+74=23098+58+74=230
  • c) 373.33+230=603.33373.33+230=603.33, found again directly: the equality is a theorem
  • d) 22, 1212 and 1414: the degrees of freedom split too
  • e) The between part measures what separates the groups, the within part the residual noise that serves as the reference
a)

Deviations of the group means from the grand mean: 78−71.333=6.66778-71.333=6.667; 70−71.333=−1.33370-71.333=-1.333; 66−71.333=−5.33366-71.333=-5.333. Their squares: 44.44444.444; 1.7781.778; 28.44428.444, with sum 74.66774.667. Each group having 5 students: SSbetween=5×74.667≈373.33SS_{between}=5\times 74.667\approx 373.33.

b)

Group A, deviations from 78: −6-6, −3-3, 0, 2, 7; squares 36, 9, 0, 4, 49, sum 98. Group B, deviations from 70: −5-5, −2-2, 0, 2, 5; squares 25, 4, 0, 4, 25, sum 58. Group C, deviations from 66: −6-6, −2-2, 0, 3, 5; squares 36, 4, 0, 9, 25, sum 74. Total: 98+58+74=23098+58+74=230.

c)

373.33+230=603.33373.33+230=603.33. Direct check: computing the fifteen deviations from the grand mean 71.333 and adding their squares, we do get 603.33. The equality SStotal=SSbetween+SSwithinSS_{total}=SS_{between}+SS_{within} is exact, not approximate: it is a theorem, and it holds whatever the group sizes.

d)

Degrees of freedom: between, k−1=3−1=2k-1=3-1=2; within, N−k=15−3=12N-k=15-3=12; total, N−1=15−1=14N-1=15-1=14. We check that 2+12=142+12=14. The degrees of freedom therefore split exactly like the sums of squares, which is the second half of the theorem.

e)

The sum of squares BETWEEN measures what the groups have that is DIFFERENT: it is zero if the three means coincide and grows as they move apart. The sum of squares WITHIN measures the RESIDUAL variability, the variability that remains between students of the same program, and which serves as the reference: it is the noise against which the signal will be judged.

total variation: 603.33between: 373.33within: 230widths proportional to the sums of squares

Exercise 3: The ANOVA table and the F statistic

Sums of squares cannot be compared directly: they have to be brought back to their degrees of freedom. The ratio of the two mean squares is the FF statistic.

1234567891011120.20.40.60.81F(2, 12)3.885 (5%)6.927 (1%)F
  • a) Compute the two mean squares and draw up the complete table of the analysis.
  • b) Compute FF and conclude, the critical value with 2 and 12 degrees of freedom being 3.885 at the 5% level and 6.927 at the 1% level.
  • c) Why is the test always right-tailed?
  • d) What would FF be if the three means were identical? And if the within-group variability were zero?
  • e) With only two groups, what is the relationship between FF and the tt of the previous chapter?

Type your answers, the page tells you right or wrong 0/11

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) MSbetween≈186.67MS_{between}\approx 186.67 and MSwithin≈19.167MS_{within}\approx 19.167
  • b) F=186.6719.167≈9.739>6.927F=\dfrac{186.67}{19.167}\approx 9.739>6.927: we reject at the 1%1\% level
  • c) Because the numerator is a sum of squares: it can only grow when the means move apart
  • d) F=0F=0 if the means coincide; FF tends to infinity if the internal noise is zero
  • e) F=t2F=t^{2} exactly: analysis of variance generalizes the t-test
a)

Mean square BETWEEN: 373.332≈186.67\dfrac{373.33}{2}\approx 186.67. Mean square WITHIN: 23012≈19.167\dfrac{230}{12}\approx 19.167. Table: source between, SS=373.33SS=373.33, df=2df=2, MS=186.67MS=186.67; source within, SS=230.00SS=230.00, df=12df=12, MS=19.167MS=19.167; total, SS=603.33SS=603.33, df=14df=14. Careful: the mean squares do NOT add up, unlike the sums of squares and the degrees of freedom.

b)

F=186.6719.167≈9.739F=\dfrac{186.67}{19.167}\approx 9.739. Since 9.739>6.9279.739>6.927, we reject the hypothesis of equal means at the 1% level, and a fortiori at the 5% level. The p-value is below 0.01; software would give about 0.003. The conclusion is written: the three programs do not have the same mean, F(2,12)=9.74F(2, 12)=9.74, p < 0.01.

c)

Because the numerator can only GROW when the means move apart, never shrink: the sum of squares between is a sum of squares, hence positive or zero. An FF close to zero means that the group means resemble each other more than chance would make them, which is no argument against the null hypothesis. The whole rejection region therefore lies on the right, and there is no two-tailed version of the test.

d)

If the three means were identical, the sum of squares between would be zero and F=0F=0. If the within-group variability were zero, every student in a program having exactly the same mark, the denominator would be zero and FF would tend to infinity: any gap between groups would then be infinitely significant, which is consistent, since without internal noise the slightest gap is certain.

e)

With two groups, F=t2F=t^{2}, exactly. The F test and the two-sided t-test then give strictly the same decision, and the critical values correspond: 1.962=3.841.96^{2}=3.84, which is indeed the critical value of FF with 1 and infinitely many degrees of freedom. Analysis of variance is therefore a GENERALIZATION of the t-test, not a competing tool.

1234567891011120.20.40.60.81F(2, 12)3.885 (5%)6.927 (1%)observed F: 9.74F

Exercise 4: Strength of effect: eta squared

As everywhere, a significant test says nothing about the size of the effect. The strength measure of analysis of variance is η2=SSbetweenSStotal\eta^{2}=\dfrac{SS_{between}}{SS_{total}}, the share of the total variation explained by the factor.

  • a) Compute η2\eta^{2} for the three programs and interpret it.
  • b) What extreme values can η2\eta^{2} take, and what do they mean?
  • c) Usual benchmarks: 0.01 small, 0.06 medium, 0.14 large. Where does the result fall?
  • d) The sample sizes are tripled without changing the means or the within-group spread. What happens to FF and to η2\eta^{2}?
  • e) η2\eta^{2} has a known flaw on small samples. What is it, and what correction exists?

Type your answers, the page tells you right or wrong 0/15

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) η2=373.33603.33≈0.619\eta^{2}=\dfrac{373.33}{603.33}\approx 0.619: the program explains 61.9%61.9\% of the variation
  • b) Between 00, no difference between the means, and 11, no within-group variability
  • c) Well beyond the 0.140.14 threshold; but five students per group, chosen for the exercise
  • d) FF rises to 34.0934.09 and η2\eta^{2} stays at 0.6190.619
  • e) Biased upward; omega squared corrects it and gives 0.5380.538 here
a)

η2=373.33603.33≈0.6188\eta^{2}=\dfrac{373.33}{603.33}\approx 0.6188. The program therefore explains about 61.9% of the total variation in the marks, which is considerable. In other words, knowing a student's program already accounts for three fifths of the spread in the results; only 38% of the variation remains to be explained by everything else.

b)

η2\eta^{2} ranges from 0 to 1. It is 0 when all the group means coincide, so when the factor explains nothing. It is 1 when the within-group variability is zero, that is, when knowing the group lets you predict the mark exactly. These two bounds are the same as those of the coefficient of determination of a regression, and this is no accident: η2\eta^{2} IS a coefficient of determination, that of predicting a mark by the mean of its group.

c)

At 0.619, we are far beyond the 0.14 threshold that marks a large effect: the effect here is massive. It must be tempered, however: these data have five students per group, chosen for the exercise, and such ratios are rare in real social science data, where an η2\eta^{2} of 0.10 is already a fine result.

d)

With 15 students per group instead of 5, all the sums of squares are multiplied by 3: SSbetween=1,120SS_{between}=1{,}120, SSwithin=690SS_{within}=690. The degrees of freedom become 2 and 42, so MSbetween=560MS_{between}=560 and MSwithin≈16.43MS_{within}\approx 16.43, whence F≈34.09F\approx 34.09: FF has more than tripled. On the other hand η2=11201810≈0.6188\eta^{2}=\dfrac{1120}{1810}\approx 0.6188, strictly UNCHANGED. This is exactly the contrast of the previous chapter between significance and strength.

e)

η2\eta^{2} is BIASED UPWARD on small samples: even under the null hypothesis, the group means never coincide perfectly, so SSbetweenSS_{between} is strictly positive and so is η2\eta^{2}. Its expected value under the null hypothesis is about k−1N−1\dfrac{k-1}{N-1}, here 214≈0.143\dfrac{2}{14}\approx 0.143, which is not negligible. The usual correction is omega squared, ω2=SSbetween−(k−1)MSwithinSStotal+MSwithin\omega^{2}=\dfrac{SS_{between}-\left(k-1\right)MS_{within}}{SS_{total}+MS_{within}}, which here equals 373.33−2×19.167603.33+19.167=335.0622.5≈0.538\dfrac{373.33-2\times 19.167}{603.33+19.167}=\dfrac{335.0}{622.5}\approx 0.538, eight points lower.

Exercise 5: The assumptions of ANOVA

Analysis of variance rests on three assumptions. They are not equally important, and knowing which one is forgiving is as useful as knowing which one is not.

  • a) State the three assumptions.
  • b) The standard deviations of the three groups are 4.95, 3.81 and 4.30. Check homogeneity with the ratio of the extreme variances.
  • c) Which of the three assumptions is the most forgiving, and why?
  • d) Which one is never forgiving? Give an example of a violation.
  • e) What should be done if the assumptions clearly fail?

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) Independence of the observations, normality in each population, homogeneity of the variances
  • b) 24.5014.52≈1.688\dfrac{24.50}{14.52}\approx 1.688, well below the tolerated ratio of 4
  • c) Normality, protected by the central limit theorem and by the robustness of FF
  • d) Independence: measuring the same subjects three times and treating the measurements as independent
  • e) Welch if homogeneity fails, Kruskal-Wallis if normality fails, repeated measures if independence fails
a)

First assumption, INDEPENDENCE of the observations: each student appears in one group only, and the results are not linked to each other. Second assumption, NORMALITY of the variable in each population. Third assumption, HOMOGENEITY of the variances, called homoscedasticity: the kk populations have the same variance.

b)

Variances: 4.952=24.504.95^{2}=24.50; 3.812=14.523.81^{2}=14.52; 4.302=18.494.30^{2}=18.49. Ratio of the extremes: 24.5014.52≈1.688\dfrac{24.50}{14.52}\approx 1.688. The most widely used rule of thumb tolerates a ratio of up to 4 when the sample sizes are equal; with 1.69, homogeneity is amply acceptable. Levene's test, which formalizes the check, would certainly not reject.

c)

NORMALITY is the most forgiving, for two reasons. First, the test is about group MEANS, whose sampling distribution tends toward the normal by the central limit theorem even if the raw variable is not normal. Second, FF is known to be robust to moderate departures from normality, especially when the sample sizes are equal. Marked skewness on very small groups remains a problem, however, and in that case we look at the residuals rather than at the raw variable.

d)

INDEPENDENCE is never forgiving. Example of a violation: measuring the same students three times under three conditions and treating the fifteen measurements as fifteen independent observations. The variability between individuals is then counted in the denominator when it should be removed, exactly as in the paired case of the previous chapter, and the conclusion can be wrong in either direction. Another frequent violation: students from the same class, who resemble each other, treated as an independent draw.

e)

Three routes. If only homogeneity fails, use WELCH's analysis of variance, which adjusts the degrees of freedom the way Welch's t-test does. If normality fails badly on small groups, switch to the nonparametric KRUSKAL-WALLIS test, which works on ranks. If independence fails because the same subjects are measured several times, the model must change: REPEATED-MEASURES analysis of variance, which isolates the variability between subjects exactly as pairing did for two groups.

Part B: problems and reasoning (/50)

Exercise 6: After the rejection: multiple comparisons

Analysis of variance says that at least one mean differs. It remains to find out which ones, and this is where control of the overall risk becomes the central problem again.

  • a) Compute the standard error of a difference of two means, with SE=MSwithin(1n1+1n2)SE=\sqrt{MS_{within}\left(\dfrac{1}{n_{1}}+\dfrac{1}{n_{2}}\right)}.
  • b) Compute the three tt statistics of the pairwise comparisons.
  • c) Apply the Bonferroni correction: the threshold becomes 0.053\dfrac{0.05}{3}, whose critical value with 12 degrees of freedom is 2.779. Conclude for each pair.
  • d) Translate the critical threshold into a minimum detectable difference, in points.
  • e) Why use MSwithinMS_{within} rather than the standard deviation of each pair of groups?

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) SE=19.167×0.4≈2.769SE=\sqrt{19.167\times 0.4}\approx 2.769, the same for the three pairs
  • b) A against C: 4.3344.334. A against B: 2.8892.889. B against C: 1.4451.445
  • c) A stands apart from B and from C; B and C cannot be told apart (2.7792.779 corrected threshold)
  • d) 2.779×2.769≈7.692.779\times 2.769\approx 7.69 points: the study is blind below that
  • e) Because it estimates the common variance on all fifteen observations, with 1212 degrees of freedom instead of 88
a)

SE=19.167(15+15)=19.167×0.4=7.6667≈2.7689SE=\sqrt{19.167\left(\dfrac{1}{5}+\dfrac{1}{5}\right)}=\sqrt{19.167\times 0.4}=\sqrt{7.6667}\approx 2.7689. This standard error is the same for the three pairs, since the sample sizes are equal and the common variance is estimated on the whole.

b)

A minus C: 78−662.7689=122.7689≈4.334\dfrac{78-66}{2.7689}=\dfrac{12}{2.7689}\approx 4.334. A minus B: 82.7689≈2.889\dfrac{8}{2.7689}\approx 2.889. B minus C: 42.7689≈1.445\dfrac{4}{2.7689}\approx 1.445.

c)

With the corrected critical value of 2.779: A against C, 4.334>2.7794.334>2.779, SIGNIFICANT difference. A against B, 2.889>2.7792.889>2.779, also significant, but only just. B against C, 1.445<2.7791.445<2.779, NOT significant. We conclude that program A stands apart from the other two, and that B and C cannot be told apart. Without the correction, the critical value would have been 2.179: A against B would have passed with room to spare instead of only just, and B against C would still not have been significant. This shows the real effect of the correction.

d)

The minimum detectable difference is 2.779×2.7689≈7.6942.779\times 2.7689\approx 7.694 points. Any difference between means below 7.7 points will be declared not significant in this study, whatever the pair. This is very useful information to publish: it says right away that the study, with five students per group, is blind to any gap of less than eight points.

e)

Because MSwithinMS_{within} estimates the common variance on all FIFTEEN observations, hence with 12 degrees of freedom, whereas a single pair would provide only 8. The estimate is more stable, the critical value lower, and the test more powerful. This is one of the advantages of analysis of variance: it pools the information from all the groups to estimate the noise, even for comparisons that do not directly involve them. The price of this gain is that it assumes homogeneity of the variances, an assumption that therefore had to be checked beforehand.

12A vs C8A vs B4B vs Ccutoff: 7.69

Exercise 7: Unequal group sizes and a factor with several levels

Real groups are never the same size. Nothing changes in principle, everything changes in the arithmetic, and two traps appear.

Three programs: 40 students with mean 74.0; 25 students with mean 70.4; 15 students with mean 66.0.

  • a) Compute the grand mean. Why is it not the mean of the three means?
  • b) Compute the sum of squares between groups.
  • c) The sum of squares within is 5,940. Draw up the table and compute FF, the critical value with 2 and 77 degrees of freedom being 3.12.
  • d) Compute η2\eta^{2} and comment on the gap with the result of the test.
  • e) What two traps do unequal sample sizes introduce?

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 5,71080=71.375\dfrac{5{,}710}{80}=71.375, against 70.13370.133 for the simple mean: it must be weighted
  • b) SSbetween≈732.75SS_{between}\approx 732.75
  • c) F=366.37577.143≈4.749>3.12F=\dfrac{366.375}{77.143}\approx 4.749>3.12: we reject
  • d) η2=732.756,672.75≈0.110\eta^{2}=\dfrac{732.75}{6{,}672.75}\approx 0.110: the program explains 11%11\% of the variation
  • e) The grand mean to weight, and the increased sensitivity to unequal variances
a)

Grand mean: 40×74.0+25×70.4+15×66.080=2,960+1,760+99080=5,71080=71.375\dfrac{40\times 74.0+25\times 70.4+15\times 66.0}{80}=\dfrac{2{,}960+1{,}760+990}{80}=\dfrac{5{,}710}{80}=71.375. This is not the mean of the three means, which would be 74.0+70.4+66.03≈70.133\dfrac{74.0+70.4+66.0}{3}\approx 70.133, because the grand mean WEIGHTS each group by its size: the group of 40 students counts two and a half times as much as the group of 15. The gap of 1.24 points between the two calculations is exactly the kind of error that throws off a whole ANOVA table.

b)

Deviations from 71.375: 2.6252.625; −0.975-0.975; −5.375-5.375. SSbetween=40×2.6252+25×0.9752+15×5.3752=40×6.8906+25×0.950625+15×28.8906=275.625+23.7656+433.359≈732.75SS_{between}=40\times 2.625^{2}+25\times 0.975^{2}+15\times 5.375^{2}=40\times 6.8906+25\times 0.950625+15\times 28.8906=275.625+23.7656+433.359\approx 732.75.

c)

Degrees of freedom: between 3−1=23-1=2; within 80−3=7780-3=77; total 79. Mean squares: 732.752=366.375\dfrac{732.75}{2}=366.375 and 5,94077≈77.143\dfrac{5{,}940}{77}\approx 77.143. F=366.37577.143≈4.749F=\dfrac{366.375}{77.143}\approx 4.749. Since 4.749>3.124.749>3.12, we reject: the three programs do not have the same mean, F(2,77)=4.75F\left(2, 77\right)=4.75, p < 0.05.

d)

SStotal=732.75+5,940=6,672.75SS_{total}=732.75+5{,}940=6{,}672.75, so η2=732.756,672.75≈0.1098\eta^{2}=\dfrac{732.75}{6{,}672.75}\approx 0.1098. The program therefore explains only 11% of the variation in the marks, which is a medium to large effect by the benchmarks but leaves 89% of the spread to be explained by something else. The contrast with the example of five students per group is instructive: there, FF was 9.74 for an η2\eta^{2} of 0.62; here, FF is 4.75 for an η2\eta^{2} six times smaller. It is the total of 80 students that makes a far more modest effect significant.

e)

First trap, the GRAND MEAN: it must be weighted by the sample sizes, and taking the mean of the means throws off every sum of squares that follows from it. Second trap, SENSITIVITY TO THE ASSUMPTIONS: when the sample sizes are equal, analysis of variance tolerates unequal variances well; when they are unequal, it becomes seriously misleading, in one direction or the other depending on whether the large group carries the large variance. With unbalanced sample sizes, checking homogeneity stops being a formality, and Welch's version becomes the cautious choice.

Exercise 8: Five statements to correct

Each of the following five statements is FALSE. Say why and give the correct statement.

  • 1) “The analysis of variance is significant: the three programs all differ from one another.”
  • 2) “With three groups, we might as well run three t-tests: it is simpler and comes to the same thing.”
  • 3) “The total mean square is the sum of the other two mean squares.”
  • 4) “Our FF is 34: the effect of the program is therefore enormous.”
  • 5) “We measured the same 20 students under three conditions and ran a one-way analysis of variance on the 60 measurements.”

Type your answers, the page tells you right or wrong 0/11

1)
2)
3)
4)
5)
Show the solution

Answers

  • 1) FALSE: the test is omnibus; here A stands apart from B and from C, but B and C cannot be told apart
  • 2) FALSE: three t-tests bring the risk to 14.3%14.3\%, and each loses degrees of freedom
  • 3) FALSE: 186.67+19.17=205.83186.67+19.17=205.83 whereas the total mean square is ≈43.1\approx 43.1
  • 4) FALSE: tripling the sample sizes takes FF to 34.0934.09 with nothing changed; η2\eta^{2} stays 0.6190.619
  • 5) FALSE: independence is violated; a repeated-measures analysis of variance is needed
1)

FALSE. The test is OMNIBUS: it indicates that at least one pair of means differs, without saying which or how many. In the example of the chapter, A stands apart from B and from C, but B and C cannot be told apart. Correct statement: at least one mean differs from the others; post hoc multiple comparisons, with a corrected threshold, identify which.

2)

FALSE. Three t-tests at the 5% level bring the overall risk to about 1−0.953≈0.1431-0.95^{3}\approx 0.143, that is 14% instead of 5%, and the problem quickly gets worse: ten comparisons give 40%. Moreover, each t-test would use only two groups to estimate the residual variance, with 8 degrees of freedom instead of 12, hence less power. Correct statement: analysis of variance controls the overall risk and estimates the noise on all the groups at once.

3)

FALSE. The SUMS OF SQUARES add up, and so do the DEGREES OF FREEDOM, but the mean squares are quotients and do not add up. Here, 186.67+19.17=205.83186.67+19.17=205.83, whereas the total mean square is 603.3314≈43.1\dfrac{603.33}{14}\approx 43.1. Correct statement: only the sums of squares and the degrees of freedom split additively.

4)

FALSE. FF depends on the sample size as much as on the size of the gap: in the example of the chapter, tripling the sample sizes takes FF from 9.74 to 34.09 although nothing has changed in the data. The strength measure is η2\eta^{2}, which stayed at 0.619. Correct statement: the effect is very clearly established; its strength is read from η2\eta^{2}, which is 0.62.

5)

FALSE. The three measurements are on the same people: they are not independent, and the first assumption of analysis of variance is violated. The variability between individuals, which should be removed, ends up in the denominator and drowns the signal. Correct statement: a REPEATED-MEASURES analysis of variance is needed, which isolates the variability between subjects, exactly as the paired t-test does for two conditions.

Exercise 9: Problem: three teaching methods

A department compares three methods of teaching the same course. The students were assigned at random. Results: method 1, n=18n=18, mean 68.5, standard deviation 9.2; method 2, n=20n=20, mean 74.1, standard deviation 8.7; method 3, n=22n=22, mean 71.8, standard deviation 9.6.

The graph below shows the data.

5560657075808590n = 18Method 1n = 20Method 2n = 22Method 3
  • a) Compute the weighted grand mean.
  • b) Compute the sum of squares between groups.
  • c) Compute the sum of squares within from the standard deviations, using SSj=(nj−1)sj2SS_{j}=\left(n_{j}-1\right)s_{j}^{2}.
  • d) Draw up the table, compute FF and conclude, the critical value with 2 and 57 degrees of freedom being 3.16.
  • e) Compute η2\eta^{2} and write the complete conclusion.

Type your answers, the page tells you right or wrong 0/14

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 4,294.660≈71.577\dfrac{4{,}294.6}{60}\approx 71.577
  • b) SSbetween≈298.82SS_{between}\approx 298.82
  • c) 1,438.88+1,438.11+1,935.36≈4,812.351{,}438.88+1{,}438.11+1{,}935.36\approx 4{,}812.35
  • d) F=149.4184.43≈1.770<3.16F=\dfrac{149.41}{84.43}\approx 1.770<3.16: we do not reject
  • e) η2≈0.0585\eta^{2}\approx 0.0585, close to a MEDIUM effect: the study lacked power, the effect was not absent
a)

N=18+20+22=60N=18+20+22=60. Grand mean: 18×68.5+20×74.1+22×71.860=1,233+1,482+1,579.660=4,294.660≈71.577\dfrac{18\times 68.5+20\times 74.1+22\times 71.8}{60}=\dfrac{1{,}233+1{,}482+1{,}579.6}{60}=\dfrac{4{,}294.6}{60}\approx 71.577.

b)

Deviations from 71.577: −3.077-3.077; 2.5232.523; 0.2230.223. SSbetween=18×9.4661+20×6.3665+22×0.0498=170.39+127.33+1.10≈298.82SS_{between}=18\times 9.4661+20\times 6.3665+22\times 0.0498=170.39+127.33+1.10\approx 298.82.

c)

SS1=17×9.22=17×84.64=1,438.88SS_{1}=17\times 9.2^{2}=17\times 84.64=1{,}438.88. SS2=19×8.72=19×75.69=1,438.11SS_{2}=19\times 8.7^{2}=19\times 75.69=1{,}438.11. SS3=21×9.62=21×92.16=1,935.36SS_{3}=21\times 9.6^{2}=21\times 92.16=1{,}935.36. Total: SSwithin≈4,812.35SS_{within}\approx 4{,}812.35. This is the formula to remember: it lets you rebuild an analysis of variance from published statistics alone, without the raw data.

d)

Degrees of freedom: 2 and 60−3=5760-3=57. Mean squares: 298.822≈149.41\dfrac{298.82}{2}\approx 149.41 and 4,812.3557≈84.427\dfrac{4{,}812.35}{57}\approx 84.427. F=149.4184.427≈1.770F=\dfrac{149.41}{84.427}\approx 1.770. Since 1.770<3.161.770<3.16, we DO NOT REJECT: the data do not allow us to conclude that the three methods differ at the 5% level.

e)

SStotal=298.82+4,812.35=5,111.17SS_{total}=298.82+4{,}812.35=5{,}111.17, so η2=298.825,111.17≈0.0585\eta^{2}=\dfrac{298.82}{5{,}111.17}\approx 0.0585, which is close to a MEDIUM effect against the benchmarks (0.06). Conclusion: “The means of the three methods are 68.5, 74.1 and 71.8. The analysis of variance does not allow us to conclude that they differ, F(2,57)=1.77F\left(2, 57\right)=1.77; p > 0.05. The share of the variance associated with the method, η2=0.059\eta^{2}=0.059, nevertheless comes close to a medium effect, and the gap of 5.6 points between methods 1 and 2 remains appreciable: with 20 students per group, the study did not have the power to detect it. A replication with about 50 students per group would be needed before concluding that the methods are equivalent.” This shows the whole value of reporting the effect size even when the test does not reject: it turns a null result into an informative one.

Exercise 10: Problem: reading a published ANOVA table

A paper publishes the following table, without the data: source “region”, SS=1,842SS=1{,}842, df=4df=4; source “residual”, SS=27,630SS=27{,}630, df=295df=295. The text claims: “region has a highly significant effect on the sense of belonging (p<0.001p<0.001), which confirms the importance of territorial roots”.

  • a) How many regions were compared? What is the total sample size?
  • b) Compute the mean squares and FF, then check the significance, the critical value with 4 and 295 degrees of freedom being about 2.40 at the 5% level and 3.38 at the 1% level.
  • c) Compute η2\eta^{2} and set it against the author's claim.
  • d) Is the word “effect” justified?
  • e) Rewrite the concluding sentence.

Type your answers, the page tells you right or wrong 0/13

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) k=5k=5 regions and N=300N=300 respondents
  • b) F=460.593.66≈4.917>3.38F=\dfrac{460.5}{93.66}\approx 4.917>3.38: significant at the 1%1\% level
  • c) η2=1,84229,472≈0.0625\eta^{2}=\dfrac{1{,}842}{29{,}472}\approx 0.0625: region explains 6.25%6.25\%, and 93.75%93.75\% escapes it
  • d) No in the causal sense: region was not assigned, age, schooling and rurality are not controlled
  • e) Report the effect size, drop the word “effect”, name the missing control variables
a)

The factor has df=k−1=4df=k-1=4, so k=5k=5 regions. The residual degrees of freedom are N−k=295N-k=295, so N=295+5=300N=295+5=300 respondents. Reconstructing these two numbers from the degrees of freedom alone is the first reflex when reading an ANOVA table.

b)

Mean square of the factor: 1,8424=460.5\dfrac{1{,}842}{4}=460.5. Residual mean square: 27,630295≈93.66\dfrac{27{,}630}{295}\approx 93.66. F=460.593.66≈4.917F=\dfrac{460.5}{93.66}\approx 4.917. Since 4.917>3.384.917>3.38, the result is indeed significant at the 1% level; the p-value is about 0.0008, which justifies the “p < 0.001” announced.

c)

SStotal=1,842+27,630=29,472SS_{total}=1{,}842+27{,}630=29{,}472, so η2=1,84229,472≈0.0625\eta^{2}=\dfrac{1{,}842}{29{,}472}\approx 0.0625. Region therefore explains 6.25% of the variation in the sense of belonging, and 93.75% escapes it. The expression “highly significant” is accurate in the technical sense and misleading in the ordinary sense: it describes how solid the detection is, not how large the phenomenon is. Speaking of “the importance of territorial roots” on the basis of one sixteenth of the variance is an extrapolation the table does not support.

d)

No, not in the causal sense. Region was not randomly assigned: the inhabitants of a region differ in age, schooling, origin and rurality, all variables related to the sense of belonging. One-way analysis of variance controls none of this, and the word “effect”, which is a technical term for the factor in the model, reads in the text as a claim of causation. This is an ambiguity of vocabulary that careful writers avoid by writing “difference associated with region”.

e)

“The sense of belonging differs significantly among the five regions, F(4,295)=4.92F\left(4, 295\right)=4.92; p < 0.001. Region nevertheless accounts for only 6.3% of the total variation, η2=0.063\eta^{2}=0.063, which leaves most of the individual differences unexplained. Since region was not assigned, this association cannot be interpreted as a causal effect, and age, schooling and place of birth would have to be controlled before concluding anything about territorial roots.” Three corrections: the effect size is reported, the word effect disappears, and the missing control variables are named.

Something missing from this set? A type of exercise your teacher gives, a problem you are stuck on, a mistake you spotted: tell me, I read every request.

Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space. Rather not create an account? Write to me directly.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

Previous chapter Comparing two groups: t-test and effect size, 360-301 Next chapter Multiple regression, 360-301

© Ahmed Squalli Houssaini. Exercise set published at www.letuteurscientifique.ca/en/exercices/cegep-aqm-analysis-of-variance. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a statistics tutor in Montreal?

Get in touch for a first session. 360-301 arrives at the time of the end-of-program research project, and it is the course where a mistake of method costs the whole analysis chapter.

Site by Studio Squalli