Tutorials › ANOVA › An End-to-End Unequal-Variance ANOVA Case

Heteroscedastic ANOVA · Tutorial 565 of 595

An End-to-End Unequal-Variance ANOVA Case

Work through an unequal-variance one-way ANOVA case from group summaries to cautious, context-specific conclusions.

Intermediate 10 min read

What You'll Learn

  • Summarize group sizes, means, and variances to assess how much the groups differ in spread.
  • Calculate and interpret classical and Welch one-way omnibus tests for the same data.
  • Apply Games–Howell comparisons using pair-specific standard errors and degrees of freedom.
  • Explain why omnibus and pairwise results answer different questions.
  • Report statistical conclusions alongside assumptions and limits on interpretation.

Introduction

An applied one-way ANOVA analysis involves more than choosing a test and reading its p-value. Group sizes, means, and variances help show whether a common-variance analysis is a reasonable description of the data. When spreads differ, Welch’s omnibus test and Games–Howell pairwise comparisons provide alternatives that do not pool the group variances in the same way. This tutorial works through those steps for one hypothetical dataset and shows how to report the results without claiming more than the analysis supports.

The example concerns a hypothetical laboratory exercise comparing the time, in minutes, required to complete a task under three procedures. We will use group summaries rather than list every observation. Assume that observations are independent within and across groups, and that diagnostic checks of the underlying observations show no severe outliers or departures from approximate within-group normality. These assumptions are important: summary statistics alone cannot establish independence or assess the shape of the observations.

Group Summaries and the Variability Question

Let \(k\) be the number of groups. For group \(i\), let \(n_i\) be its sample size, \(\bar{x}_i\) its sample mean, and \(s_i^2\) its sample variance. A one-way analysis compares the group means for one categorical factor and one quantitative response. The classical one-way F test assumes independent observations, approximate normality within each group, and a common population variance across groups. Welch’s one-way test instead allows the population variances to differ; it still relies on independent observations and approximate within-group normality for its usual calibration.

The summaries below are hypothetical. They are chosen to illustrate unequal group sizes and unequal sample variances. The units of the means and standard deviations are minutes; variances are in squared minutes.

Procedure\(n_i\)\(\bar{x}_i\) (minutes)\(s_i^2\) (minutes squared)\(s_i\) (minutes)
A810.0002.2501.500
B1212.9762.3741.541
C615.9521.3941.180

The largest sample variance is about \(2.374/1.394=1.70\) times the smallest. The spreads are not identical, although their differences are not extreme in this example. The sample sizes also differ, with group C having half as many observations as group B. Unequal variances combined with unequal allocation can affect the behavior of a pooled-variance test, so it is useful to examine a Welch analysis as well as the classical result.

Worked Example: Summarizing Variability Before Testing

Using the table, compare the sample variances and calculate the pooled within-group variance used by the classical one-way ANOVA.

The variance ratio is \(2.374/1.394 \approx 1.70\). Thus the largest observed group variance is about 70% larger than the smallest. This ratio describes the sample spreads; it does not by itself prove that the population variances differ.

The classical pooled within-group mean square is the sum of the within-group sums of squares divided by their total degrees of freedom. Using the unrounded variances that underlie the displayed summaries,

$$ \begin{aligned} SS_{\text{within}} &=\sum_{i=1}^{3}(n_i-1)s_i^2\\ &=7(2.250)+11(2.373626)+5(1.393548)\\ &\approx48.8276,\\ df_{\text{within}} &=(8-1)+(12-1)+(6-1)=23,\\ MS_{\text{within}} &=\frac{48.8276}{23}\approx2.12294\text{ minutes}^2. \end{aligned} $$

This pooled quantity is a weighted average of the sample variances. It is appropriate as an estimate of a common variance only when the common-variance model is suitable. Its calculation does not make that assumption true.

Classical and Welch Omnibus Tests

Both omnibus tests address the null hypothesis that all population means are equal: \(H_0:\mu_1=\mu_2=\mu_3\). The alternative is that at least one population mean differs. Neither test, by itself, identifies which means differ.

For the classical test, the between-group sum of squares is \(\sum_i n_i(\bar{x}_i-\bar{x}_{\cdot})^2\), where \(\bar{x}_{\cdot}\) is the overall sample mean. Dividing this sum by \(k-1\) gives the between-group mean square. The classical F statistic is the between-group mean square divided by the pooled within-group mean square.

Worked Example: The Classical One-Way F Test

The overall sample mean, weighted by the group sizes, is approximately \(12.747\) minutes. Substituting the group sizes and means gives a between-group sum of squares of approximately \(122.64\) minutes squared. Therefore,

$$ \begin{aligned} MS_{\text{between}}&=\frac{122.64}{3-1} \approx61.32\text{ minutes}^2,\\ F&=\frac{MS_{\text{between}}}{MS_{\text{within}}} =\frac{61.32}{2.12294}\approx28.88. \end{aligned} $$

Under the classical assumptions, this statistic is compared with an \(F\) distribution with numerator \(df=2\) and denominator \(df=23\). Its upper-tail p-value is approximately \(5.5\times10^{-7}\). At \(\alpha=0.05\), the result is statistically significant: the data provide strong evidence against equality of all three population means under the classical model. This p-value is not the probability that \(H_0\) is true.

Welch’s test uses inverse-variance weights. For each group, define \(w_i=n_i/s_i^2\), and let \(W=\sum_i w_i\). The weighted mean is \(\bar{x}_w=\sum_iw_i\bar{x}_i/W\). The statistic also uses a correction factor and an estimated denominator degrees of freedom. In this case, these adjustments account for the group-specific variances and sample sizes instead of treating the pooled variance as common.

Definition: For \(k\) independent groups, Welch’s one-way test uses \(w_i=n_i/s_i^2\), \(W=\sum_iw_i\), and \(\bar{x}_w=\sum_iw_i\bar{x}_i/W\). Define \(A=\sum_i(1-w_i/W)^2/(n_i-1)\). The correction factor is \(C=1+\{2(k-2)/(k^2-1)\}A\). The Welch statistic is \(F_W=\{\sum_iw_i(\bar{x}_i-\bar{x}_w)^2/(k-1)\}/C\), with numerator \(df=k-1\) and denominator \(df=(k^2-1)/(3A)\).

Worked Example: Calculating Welch’s Omnibus Test

For these groups, the inverse-variance weights and their sum are

$$ \begin{aligned} w_A&=\frac{8}{2.250}=\frac{32}{9},& w_B&=\frac{12}{216/91}=\frac{91}{18},& w_C&=\frac{6}{216/155}=\frac{155}{36},\\ W&=\frac{209}{36}. \end{aligned} $$

The proportions of total weight are \(w_A/W=128/209\), \(w_B/W=182/209\), and \(w_C/W=155/209\). In calculating \(A\), each term uses one minus its weight proportion. Thus the first numerator is \(1-128/209=81/209\), not \(128/209\). The full calculation is

$$ \begin{aligned} A&=\frac{(81/209)^2}{7} +\frac{(27/209)^2}{11} +\frac{(54/209)^2}{5}\\ &\approx0.20047,\\ C&=1+\frac{2(3-2)}{3^2-1}A =1+\frac{A}{4} \approx1.05012. \end{aligned} $$

The weighted mean is approximately \(13.486\) minutes. Substitution of the group means and weights gives a weighted sum of squared deviations of approximately \(69.244\) in the corresponding weighted units. Therefore,

$$ \begin{aligned} F_W &=\frac{69.244/(3-1)}{1.05012} \approx32.97,\\ df_{\text{numerator}}&=3-1=2,\\ df_{\text{denominator}}&=\frac{3^2-1}{3(0.20047)} =\frac{8}{0.20047}\approx39.91. \end{aligned} $$

The upper-tail p-value for \(F_W\approx32.97\) with \(df=(2,39.91)\) is approximately \(3.5\times10^{-9}\). At \(\alpha=0.05\), Welch’s test also rejects the null hypothesis of equal population means. The calculation supports a conclusion about evidence of mean differences; it does not establish that procedure A, B, or C caused a difference.

Games–Howell Pairwise Comparisons

An omnibus result indicates whether the set of means is inconsistent with equality, but it does not identify the pairs that differ. Games–Howell comparisons assess pairs while allowing unequal variances and unequal sample sizes. For groups \(i\) and \(j\), the standard error of their mean difference is \(\sqrt{s_i^2/n_i+s_j^2/n_j}\). The pair-specific Welch–Satterthwaite degrees of freedom are

$$ df_{ij}= \frac{(s_i^2/n_i+s_j^2/n_j)^2} {(s_i^2/n_i)^2/(n_i-1)+(s_j^2/n_j)^2/(n_j-1)}. $$

Games–Howell expresses the absolute mean difference on a studentized-range scale: \(q_{ij}=|\bar{x}_i-\bar{x}_j|/\sqrt{\{s_i^2/n_i+s_j^2/n_j\}/2}\). Each pair is assessed using the studentized-range distribution with \(k\) groups and that pair’s estimated degrees of freedom. This calibration accounts for making multiple pairwise comparisons; it does not turn each comparison into an unadjusted two-sample test.

Worked Example: Comparing Procedures A and B

The observed difference is \(12.976-10.000=2.976\) minutes. The estimated variance of the difference is \(2.250/8+2.373626/12=0.479052\) minutes squared, so the standard error is \(\sqrt{0.479052}\approx0.4894\) minutes. The studentized-range statistic is

$$ q_{AB}= \frac{2.976}{\sqrt{0.479052/2}} \approx6.08. $$

For the pair-specific degrees of freedom,

$$ \begin{aligned} df_{AB} &=\frac{(0.28125+0.197802)^2} {0.28125^2/7+0.197802^2/11}\\ &\approx15.45. \end{aligned} $$

The Games–Howell studentized-range comparison is statistically significant at the 0.05 familywise level. In context, the hypothetical sample mean for procedure B is higher than that for procedure A by about \(2.976\) minutes, and the adjusted comparison provides evidence of a difference in their population mean completion times under the model assumptions.

The same calculation is repeated for each remaining pair. The following table gives rounded results; adjusted p-values are reported as bounds rather than as overly precise estimates. They are obtained from the studentized-range calibration with three groups and the pair-specific degrees of freedom.

PairAbsolute mean difference (minutes)\(q\)Pairwise \(df\), approximatelyGames–Howell conclusion at 0.05
A vs B2.9766.0815.45Significant; adjusted \(p<0.01\)
A vs C5.95211.7511.94Significant; adjusted \(p<0.01\)
B vs C2.9766.4212.89Significant; adjusted \(p<0.01\)

All three comparisons exceed the relevant 0.05 studentized-range critical values. The table supports evidence of differences for each pair, with the sample means ordered A, then B, then C. It does not show that every individual using procedure C will take longer than every individual using A or B; these are comparisons of population means, not predictions about individual outcomes.

Putting the Results Together

For these hypothetical data, the classical and Welch omnibus tests both provide strong evidence against equal population means. Their statistics and denominator degrees of freedom differ because their variance assumptions and calculations differ. The classical test uses the pooled within-group mean square, while Welch’s test uses group-specific inverse-variance weights and an adjusted reference distribution. Since the sample variances and sample sizes are not identical, reporting Welch’s result alongside the classical result makes the analysis more transparent.

The Games–Howell follow-ups add information the omnibus tests do not provide: which pairs show evidence of differing means under a multiple-comparison procedure. A concise report could state: “In a hypothetical comparison of task completion times under three procedures, group variances ranged from 1.394 to 2.374 minutes squared, and group sizes ranged from 6 to 12. Welch’s one-way test found evidence that not all population means were equal, \(F_W(2,39.91)=32.97\), \(p\approx3.5\times10^{-9}\). Games–Howell comparisons found evidence of differences for all three pairs (each adjusted \(p<0.01\)); sample means were 10.000, 12.976, and 15.952 minutes for A, B, and C, respectively.” This report identifies the response units and the procedure used for follow-up comparisons.

These results depend on the assumptions stated at the outset. In particular, independence should follow from the study design, not merely from a statistical test. Approximate normality and the absence of severe outliers should be checked using the observations and diagnostic plots; group summaries cannot show these features. If the data are strongly non-normal or the design creates dependence, the reported reference distributions may not be appropriate. Also, statistical evidence of different means does not by itself establish practical importance or a causal effect.

Common Mistake

A frequent error is to calculate \(A\) using the weight proportions themselves, for example \((128/209)^2/7\) for group A. That is not the term in Welch’s correction. The formula uses \(1-w_i/W\), so the correct group A numerator is \((1-128/209)^2=(81/209)^2\). Using the weight proportion in place of its complement changes \(A\), which then changes the correction factor, Welch statistic, denominator degrees of freedom, and p-value. Check each term against the definition before combining them.

A second interpretive error is to treat a significant omnibus test as proof that every pair differs. The omnibus test only addresses whether all population means are equal. Pairwise claims require follow-up comparisons, and those comparisons should account for multiplicity. Here, the Games–Howell results supply that separate pairwise evidence.

Key takeaway: An end-to-end unequal-variance ANOVA analysis begins with groupwise summaries, states and checks the relevant assumptions, distinguishes the pooled classical test from Welch’s test, and uses an appropriate multiple-comparison procedure for pairwise conclusions. Report the methods, evidence, units, and limits together.

Check Your Understanding

Use the worked case and definitions to answer these questions.

  1. Why does unequal variance matter more to a pooled-variance analysis when group sizes are also unequal?
  2. For group A, why is the numerator in its contribution to \(A\) equal to \(81/209\), rather than \(128/209\)?
  3. What does the significant Welch omnibus result establish, and what does it not identify?
  4. Why do Games–Howell comparisons use pair-specific degrees of freedom?
  5. Name one important assumption that cannot be checked from the group summary table alone.
Clinical Biostats