PracticeVideosBlogFlashcards

9.4 Analysis of Variance (One-Way & Two-Way ANOVA) & Chi-Square Contingency Tests

Key Takeaways

  • One-Way ANOVA tests for differences in means across three or more groups (k ≥ 3) simultaneously; running multiple pairwise t-tests is prohibited because it rapidly inflates the family-wise Type I error rate (α_family = 1 - (1 - α)^c).

  • The ANOVA F-statistic partitions total variation into between-group variance (MS_Between / signal) and within-group error variance (MS_Within / noise): F = MS_Between / MS_Within; a significant F-test requires post-hoc testing (e.g., Tukey's HSD) to identify specific differing pairs.

  • Two-Way ANOVA evaluates two independent factors simultaneously, testing for Main Effects of Factor A, Main Effects of Factor B, and their Interaction Effect (A × B), which indicates whether the effect of one factor depends on the level of the other.

  • The Chi-Square (χ²) Test of Independence analyzes contingency tables to test for an association between two categorical variables by comparing observed frequencies (O) against expected frequencies (E), with df = (r - 1)(c - 1).

  • The Chi-Square test requires all expected cell counts E_ij ≥ 5; if expected frequencies fall below 5, categories must be combined or Fisher's Exact Test must be utilized.

Last updated: September 2026

9.4 Analysis of Variance (One-Way & Two-Way ANOVA) & Chi-Square Contingency Tests

Quick Summary: When continuous improvement investigations expand beyond two groups or involve categorical attribute variables, practitioners deploy advanced inferential tools. One-Way Analysis of Variance (ANOVA) compares continuous means across three or more groups (k≥3k \ge 3) simultaneously using the FF-ratio (MSBetween/MSWithinMS_{\text{Between}} / MS_{\text{Within}}), preventing the massive Type I error inflation caused by multiple pairwise tt-tests. When two factors influence the process, Two-Way ANOVA evaluates both main effects and their interaction effect. For categorical and discrete defect counts, the Chi-Square (χ2\chi^2) Test of Independence evaluates contingency tables to detect associations between process attributes.


One-Way Analysis of Variance (ANOVA)

Purpose & Operational Context

One-Way ANOVA (Analysis of Variance) is a parametric hypothesis test used to compare the means of three or more independent groups (k≥3k \ge 3) on a single continuous response variable (YY). Examples include:

  • Comparing tensile strength across four raw material resin suppliers.
  • Comparing order cycle time across three operating shifts (Day, Evening, Night).
  • Comparing dimensional accuracy across five CNC machining centers.

Hypotheses Formulation

  • H0:μ1=μ2=μ3=⋯=μkH_0: \mu_1 = \mu_2 = \mu_3 = \dots = \mu_k (All group population means are equal)
  • Ha:H_a: At least one group mean is different from the others

Crucial Exam Rule: The alternative hypothesis in ANOVA is NOT "all means are different." HaH_a simply states that at least one group mean is statistically distinguishable from at least one other group mean. In fact, three groups could have identical means while a fourth group is radically higher, satisfying HaH_a.

Why Multiple tt-Tests Are Strictly Prohibited: α\alpha-Inflation

A frequent novice mistake in Six Sigma is comparing four groups by running separate two-sample tt-tests on every pair (Group 1 vs 2, 1 vs 3, 1 vs 4, 2 vs 3, 2 vs 4, 3 vs 4).

The number of pairwise comparisons (cc) required for kk groups is:

c=k(k−1)2c = \frac{k(k - 1)}{2}

If each individual test is conducted at significance level α=0.05\alpha = 0.05, the family-wise Type I error rate (the overall probability of committing at least one false alarm across the family of tests) inflates exponentially:

αfamily=1−(1−α)c\alpha_{\text{family}} = 1 - (1 - \alpha)^c
Number of Groups (kk)Number of Pairs (cc)Family-Wise Error Rate (αfamily\alpha_{\text{family}} at α=0.05\alpha = 0.05)
k=3k = 3331−(0.95)3=1−0.857=14.3%1 - (0.95)^3 = 1 - 0.857 = \mathbf{14.3\%}
k=4k = 4661−(0.95)6=1−0.735=26.5%1 - (0.95)^6 = 1 - 0.735 = \mathbf{26.5\%}
k=5k = 510101−(0.95)10=1−0.599=40.1%1 - (0.95)^{10} = 1 - 0.599 = \mathbf{40.1\%}
k=6k = 615151−(0.95)15=1−0.463=53.7%1 - (0.95)^{15} = 1 - 0.463 = \mathbf{53.7\%}

For 5 groups, running separate tt-tests produces a 40.1%40.1\% chance of falsely claiming a significant difference when none exists! ANOVA solves this problem by conducting a single, omnibus test that evaluates all means simultaneously while strictly holding α=0.05\alpha = 0.05.


The Mechanics of the F-Statistic & The ANOVA Table

ANOVA evaluates differences in means by analyzing and partitioning variances. The total variation in the data is split into two independent components:

                         Partitioning Total Variance

                              TOTAL VARIATION
                                 (SS_Total)
                                     │
                    ┌────────────────┴────────────────┐
                    ▼                                 ▼
          BETWEEN-GROUP VARIATION            WITHIN-GROUP VARIATION
               (SS_Between)                       (SS_Within)
           Variation caused by               Random, unexplained
            Factor Treatment                 background noise / error
  1. Between-Group Variance (SSBetweenSS_{\text{Between}} or SSFactorSS_{\text{Factor}}): Measures how far the individual group sample means deviate from the overall grand mean (xˉˉ\bar{\bar{x}}). This represents the signal generated by process differences.
  2. Within-Group Variance (SSWithinSS_{\text{Within}} or SSErrorSS_{\text{Error}}): Measures how individual observations deviate from their respective group sample mean. This represents inherent, unexplained random noise.

Mean Squares & The FF-Ratio

Dividing Sum of Squares (SSSS) by their respective Degrees of Freedom (dfdf) yields Mean Squares (MSMS):

Fcalc=MSBetweenMSWithin=Between-Group Variance (Signal)Within-Group Variance (Noise)F_{\text{calc}} = \frac{MS_{\text{Between}}}{MS_{\text{Within}}} = \frac{\text{Between-Group Variance (Signal)}}{\text{Within-Group Variance (Noise)}}
  • If F≈1F \approx 1: Between-group differences are no larger than random process noise (p>0.05p > 0.05; Fail to reject H0H_0).
  • If F≫1F \gg 1: The variance between group averages is substantially larger than random background noise (p≤0.05p \le 0.05; Reject H0H_0).

The Standard ANOVA Source Table

Source of VariationSum of Squares (SSSS)Degrees of Freedom (dfdf)Mean Square (MSMS)FF-Statisticpp-value
Between Groups (Factor)SSFactorSS_{\text{Factor}}k−1k - 1MSFactor=SSFactork−1MS_{\text{Factor}} = \frac{SS_{\text{Factor}}}{k - 1}F=MSFactorMSErrorF = \frac{MS_{\text{Factor}}}{MS_{\text{Error}}}From FF-dist
Within Groups (Error)SSErrorSS_{\text{Error}}N−kN - kMSError=SSErrorN−kMS_{\text{Error}} = \frac{SS_{\text{Error}}}{N - k}——
TotalSSTotalSS_{\text{Total}}N−1N - 1———

(Where $k = $ number of groups, $N = $ total observations across all groups).

Step-by-Step Worked Example: Interpreting an ANOVA Table

Scenario: A Green Belt compares the yield strength of metal brackets across k=4k = 4 independent heat-treatment recipes. A total of N=24N = 24 brackets were tested (n=6n = 6 brackets per recipe). The partial ANOVA table shows:

  • SSFactor=180.0SS_{\text{Factor}} = 180.0
  • SSError=120.0SS_{\text{Error}} = 120.0

Calculate Degrees of Freedom, Mean Squares, and FF-Statistic:

  1. dfFactor=k−1=4−1=3df_{\text{Factor}} = k - 1 = 4 - 1 = 3
  2. dfError=N−k=24−4=20df_{\text{Error}} = N - k = 24 - 4 = 20
  3. dfTotal=N−1=24−1=23df_{\text{Total}} = N - 1 = 24 - 1 = 23
  4. MSFactor=180.03=60.0MS_{\text{Factor}} = \frac{180.0}{3} = 60.0
  5. MSError=120.020=6.0MS_{\text{Error}} = \frac{120.0}{20} = 6.0
  6. Fcalc=MSFactorMSError=60.06.0=10.00F_{\text{calc}} = \frac{MS_{\text{Factor}}}{MS_{\text{Error}}} = \frac{60.0}{6.0} = 10.00

At α=0.05\alpha = 0.05, the critical F0.05,3,20=3.10F_{0.05, 3, 20} = 3.10. Because Fcalc=10.00>3.10F_{\text{calc}} = 10.00 > 3.10 (p<0.001p < 0.001), we Reject H0H_0. Heat-treatment recipe significantly affects yield strength.


Post-Hoc Analysis: Tukey's Honestly Significant Difference (HSD)

A statistically significant ANOVA test is an omnibus test: it proves that a difference exists somewhere among the means, but it does not identify which specific groups differ.

To identify which groups differ without inflating Type I error, practitioners run a post-hoc multiple comparison test. The gold standard in Six Sigma is Tukey's Honestly Significant Difference (HSD) test.

Interpreting Tukey's Grouping Output

Statistical software groups means using letters. Groups that do not share a common letter are statistically significantly different:

                  Tukey HSD Output Interpretation

      Recipe      Sample Size     Mean Yield      Grouping
     ──────────────────────────────────────────────────────
      Recipe C        6            142.5 MPa         A
      Recipe A        6            138.0 MPa         A
      Recipe D        6            124.2 MPa            B
      Recipe B        6            112.8 MPa               C
  • Recipes C and A share letter A: No significant difference between C and A.
  • Recipe D has letter B: Recipe D is significantly lower than A and C, but significantly higher than B.
  • Recipe B has letter C: Recipe B is significantly lower than all other recipes.

Two-Way ANOVA: Main Effects & Interactions

While One-Way ANOVA examines a single independent factor, industrial processes are usually driven by multiple variables acting simultaneously. Two-Way ANOVA evaluates two independent factors (Factor AA and Factor BB) on a continuous response YY, testing three distinct hypotheses:

  1. Main Effect of Factor AA: Does Factor AA significantly alter YY, averaged across all levels of Factor BB?
  2. Main Effect of Factor BB: Does Factor BB significantly alter YY, averaged across all levels of Factor AA?
  3. Interaction Effect (A×BA \times B): Does the effect of Factor AA depend upon the specific level of Factor BB?

Interpreting Interaction Plots

Interaction plots graph the response mean on the vertical axis against Factor AA on the horizontal axis, with separate lines for each level of Factor BB:

                     Interpreting Interaction Plots

      NO INTERACTION (Parallel Lines)           STRONG INTERACTION (Crossing Lines)
   Y ┌                     B2 (High)         Y ┌               B1 (High)    B2
     │                ───────                  │                  ╲        ╱
     │               ╱                         │                   ╲      ╱
     │              ╱                          │                    ╲    ╱
     │             ╱   B1 (Low)                │                     ╲  ╱
     │       ───────                           │                      ╳
     │      ╱                                  │                     ╱  ╲
     │     ╱                                   │                    ╱    ╲
     └────────────────────────                 └─────────────────────────────
       A1 (Low)       A2 (High)                  A1 (Low)            A2 (High)
       Effect of A is same across B              Effect of A REVERSES across B!
  • Parallel Lines: Zero interaction. The effect of Factor AA is consistent regardless of Factor BB. The factors act independently.
  • Non-Parallel or Crossing Lines: Strong interaction present. The effect of Factor AA depends entirely on what level Factor BB is set to. When an interaction is significant, main effects cannot be interpreted in isolation.

Chi-Square (χ2\chi^2) Tests for Categorical Data

When data is categorical or discrete attribute counts (e.g., defect type, region, supplier, pass/fail), ANOVA cannot be applied. Practitioners deploy Chi-Square (χ2\chi^2) tests.

1. Chi-Square Test of Independence (Contingency Tables)

Evaluates whether two categorical variables are statistically independent or whether an association exists between them (e.g., Defect Category vs. Manufacturing Shift).

Data is tabulated in an r×cr \times c contingency table (rr rows, cc columns):

χcalc2=∑i=1r∑j=1c(Oij−Eij)2Eij\chi^2_{\text{calc}} = \sum_{i=1}^r \sum_{j=1}^c \frac{(O_{ij} - E_{ij})^2}{E_{ij}}

Where:

  • $O_{ij} = $ Observed frequency count in row ii, column jj
  • $E_{ij} = $ Expected frequency count under the null hypothesis of independence: Eij=(Row i Total)×(Column j Total)Grand Total NE_{ij} = \frac{(\text{Row } i \text{ Total}) \times (\text{Column } j \text{ Total})}{\text{Grand Total } N}
  • Degrees of Freedom: df=(r−1)(c−1)\mathbf{Degrees\ of\ Freedom:}\ df = (r - 1)(c - 1)

The Expected Cell Frequency Rule: The asymptotic Chi-Square distribution is valid only if all expected cell frequencies satisfy Eij≥5E_{ij} \ge 5. If any expected cell count is <5< 5, categories must be combined, or Fisher's Exact Test must be used for 2×22 \times 2 tables.

Step-by-Step Worked Example: Chi-Square Contingency Test

Scenario: A Green Belt investigates whether defect classification (Scratch vs Dent) depends on production shift (Day vs Night). A sample of N=200N = 200 defective brackets yields the following observed counts (OO):

ShiftScratchDentRow Total
Day Shift6040100
Night Shift3070100
Column Total90110Grand Total N=200N = 200

Test for independence at α=0.05\alpha = 0.05.

Step 1: Compute Expected Frequencies (EijE_{ij})

  • EDay, Scratch=100×90200=45.0E_{\text{Day, Scratch}} = \frac{100 \times 90}{200} = 45.0
  • EDay, Dent=100×110200=55.0E_{\text{Day, Dent}} = \frac{100 \times 110}{200} = 55.0
  • ENight, Scratch=100×90200=45.0E_{\text{Night, Scratch}} = \frac{100 \times 90}{200} = 45.0
  • ENight, Dent=100×110200=55.0E_{\text{Night, Dent}} = \frac{100 \times 110}{200} = 55.0 (All Eij≥5E_{ij} \ge 5, satisfying the cell frequency rule).

Step 2: Calculate Chi-Square Statistic

χcalc2=(60−45)245+(40−55)255+(30−45)245+(70−55)255\chi^2_{\text{calc}} = \frac{(60 - 45)^2}{45} + \frac{(40 - 55)^2}{55} + \frac{(30 - 45)^2}{45} + \frac{(70 - 55)^2}{55} χcalc2=22545+22555+22545+22555=5.000+4.091+5.000+4.091=18.182\chi^2_{\text{calc}} = \frac{225}{45} + \frac{225}{55} + \frac{225}{45} + \frac{225}{55} = 5.000 + 4.091 + 5.000 + 4.091 = 18.182

Step 3: Determine Degrees of Freedom and Decision

  • df=(r−1)(c−1)=(2−1)(2−1)=1×1=1df = (r - 1)(c - 1) = (2 - 1)(2 - 1) = 1 \times 1 = 1
  • Critical value at α=0.05\alpha = 0.05 with df=1df = 1: χcrit2=3.841\chi^2_{\text{crit}} = 3.841
  • Since χcalc2=18.182>3.841\chi^2_{\text{calc}} = 18.182 > 3.841 (p<0.0001p < 0.0001), Reject H0H_0.
  • Conclusion: Defect type is strongly associated with shift; Night Shift produces significantly more dents, while Day Shift produces significantly more scratches.

Master Inferential Hypothesis Testing Roadmap

Use this comprehensive master roadmap to select the exact hypothesis test required for any Six Sigma examination scenario:

Operational Question / ObjectiveInput (XX)Output (YY)Distribution / ConditionsRecommended Statistical Test
Compare 1 mean to benchmarkConstant1 ContinuousNormal (σ\sigma known)One-Sample ZZ-test
Compare 1 mean to specificationConstant1 ContinuousNormal (σ\sigma unknown)One-Sample tt-test (df=n−1df = n-1)
Compare 1 median to targetConstant1 ContinuousNon-normal / Skewed1-Sample Wilcoxon / Sign Test
Compare 2 independent means1 Discrete (2 groups)1 ContinuousNormal (Equal variances)Two-Sample Pooled tt-test
Compare 2 independent means1 Discrete (2 groups)1 ContinuousNormal (Unequal variances)Welch's Unpooled tt-test
Compare 2 paired/matched means1 Discrete (2 conditions)1 ContinuousNormal differencesPaired tt-test (df=npairs−1df = n_{\text{pairs}}-1)
Compare 2 independent medians1 Discrete (2 groups)1 ContinuousNon-normalMann-Whitney U Test
Compare 2 paired medians1 Discrete (2 conditions)1 ContinuousNon-normal differencesWilcoxon Signed-Rank Test
Compare ≥3\ge 3 group means1 Discrete (k≥3k \ge 3 groups)1 ContinuousNormal, equal varianceOne-Way ANOVA (FF-test)
Compare ≥3\ge 3 groups with 2 factors2 Discrete factors1 ContinuousNormalTwo-Way ANOVA (Main + Interaction)
Compare ≥3\ge 3 group medians1 Discrete (k≥3k \ge 3 groups)1 ContinuousNon-normalKruskal-Wallis / Mood's Median
Compare 1 proportion to targetConstant1 Discrete (Binary)np0≥5,n(1−p0)≥5np_0 \ge 5, n(1-p_0) \ge 51-Proportion ZZ-test
Compare 2 independent proportions1 Discrete (2 groups)1 Discrete (Binary)Binomial2-Proportion ZZ-test (Pooled pˉ\bar{p})
Test association between 2 categories1 Discrete (rr levels)1 Discrete (cc levels)Expected counts ≥5\ge 5Chi-Square (χ2\chi^2) Independence
Compare observed vs expected counts1 Discrete (kk categories)Count frequencyExpected counts ≥5\ge 5Chi-Square Goodness-of-Fit

Critical CSSC Exam Traps

  • Trap 1: Running Multiple Pairwise tt-Tests Instead of ANOVA — This severely inflates the family-wise Type I error rate (α\alpha-inflation), creating massive false alarm risks.
  • Trap 2: Believing HaH_a in ANOVA Means "All Means Differ" — The alternative hypothesis in ANOVA only requires that at least one group mean differs from the others.
  • Trap 3: Calculating Degrees of Freedom for Contingency Tables as N−1N - 1 — For a Chi-Square test of independence on an r×cr \times c table, degrees of freedom is strictly df=(r−1)(c−1)df = (r - 1)(c - 1).
  • Trap 4: Ignoring the Expected Cell Frequency Requirement — Chi-Square tests are invalid if any expected cell count is <5< 5. Always verify Eij=(Row Total×Column Total)/N≥5E_{ij} = (\text{Row Total} \times \text{Column Total}) / N \ge 5.
  • Trap 5: Interpreting Main Effects When Interaction is Significant — In Two-Way ANOVA, if the interaction pp-value ≤0.05\le 0.05, you must examine the interaction plot before drawing conclusions about main factors.
Loading diagram...
ANOVA and Categorical Chi-Square Decision Architecture
Test Your Knowledge

A quality improvement team tests whether the average tensile strength of molded plastic brackets differs across 4 distinct raw material suppliers. Instead of performing a One-Way ANOVA, the team plans to run individual Two-Sample t-tests comparing each possible supplier pair at α = 0.05. What is the primary statistical consequence of this approach?

A

The test will lose statistical power, resulting in an inflated Type II error rate (β) above 80%.

B

The degrees of freedom will become negative, rendering the t-test calculations mathematically invalid.

C

The family-wise Type I error rate will inflate to approximately 26.5%, dramatically increasing the risk of a false alarm.

D

The sample standard deviations will become non-additive, causing the pooled variance to collapse to zero.

Test Your Knowledge

A Six Sigma Green Belt investigates customer complaints across 5 regional distribution centers. Complaints are categorized into 3 distinct types: Shipping Damage, Incorrect Item, and Late Delivery. The data is arranged into a 5-row by 3-column contingency table to test whether defect type is independent of distribution center. What are the degrees of freedom (df) for this Chi-Square test of independence?

A

14 degrees of freedom

B

15 degrees of freedom

C

7 degrees of freedom

D

8 degrees of freedom

Test Your Knowledge

In a Two-Way ANOVA evaluating the effects of cutting speed (Factor A) and coolant type (Factor B) on tool wear, the statistical software reports an interaction p-value of p = 0.002. The interaction plot shows that at low cutting speeds, Coolant 1 produces far less tool wear than Coolant 2, but at high cutting speeds, Coolant 2 produces far less wear than Coolant 1 (the lines cross distinctly). How must the Green Belt interpret these findings?

A

Conclude that Coolant 1 is unconditionally superior to Coolant 2 across all operating conditions because its main effect is significant.

B

Disregard the coolant factor entirely and focus only on cutting speed, since coolant type is an attribute variable.

C

Recognize that a significant interaction effect exists; the optimal coolant choice depends strictly upon the operating cutting speed, and main effects cannot be interpreted in isolation.

D

Fail to reject the null hypothesis because crossing lines indicate that the two factors cancel each other out.

Sections you finish are checked off in the contents.