Quality engineer comparing pack weights from three filling machines at a measurement bench.

What are hypothesis testing and ANOVA

Hypothesis testing is the statistical method for deciding, with a known risk of error, whether a difference seen in the data is real or just chance. ANOVA (analysis of variance) is the hypothesis test used to compare the means of three or more groups at once, such as three machines, three suppliers or three shifts.

In process improvement, this is the step that separates opinion from evidence: before adjusting a machine or changing a supplier, the test tells you whether the difference you saw in the samples justifies action. It is a tool of the Analyze phase of Six Sigma DMAIC.

Advertisement

Hypothesis testing visual map

The map shows the test flow (hypothesis, p-value, decision) and the three-machine ANOVA example solved in this article.

HYPOTHESIS TESTING AND ANOVA
Visual map 151: Hypothesis Testing and ANOVA for Process Improvement. Click the map to see it full size.Download the map as PNG

The concepts in 5 lines

Reality \ DecisionReject H0Fail to reject H0
H0 trueType I error (false alarm), probability αCorrect decision
H0 falseCorrect decision (power, 1 − β)Type II error (real difference missed), probability β

The test flow in 6 steps

  1. State H0 and H1 in process terms (for example, "mean fill weight is the same on all three machines").
  2. Choose α before looking at the data.
  3. Set the sample size and collect the data randomly, with a trustworthy measurement system.
  4. Check the assumptions: independence, approximate normality and similar variances.
  5. Calculate the test statistic (t or F) and the p-value.
  6. Decide and translate it into a process action, looking at the size of the difference as well, not only the p-value.

Comparing two groups: the t test

Illustrative example: a filling line for 50 g packs has three machines (A, B and C). Five packs from each were weighed.

PackMachine AMachine BMachine C
150.250.650.1
249.850.950.3
350.550.449.9
450.151.050.2
549.950.750.0
Mean (g)50.1050.7250.10
Variance0.0750.0570.025

First, compare only A and B with the equal-variance t test. The pooled variance is sp² = (0.075 + 0.057) ÷ 2 = 0.066, and the standard error of the difference is 0.1625.

t = (50.10 − 50.72) ÷ 0.1625 = -3.82

With 8 degrees of freedom, the two-sided critical t at 5% is 2.306. Since |-3.82| > 2.306 (p = 0.0051), H0 is rejected: machines A and B fill at different means.

One-way ANOVA: three machines at once

With three groups, comparing pairs with several t tests inflates the risk: three comparisons at 5% give a false-alarm chance of 1 − 0.95³ = 14.3%; with 5 groups (10 pairs) it climbs to 40.1%. ANOVA makes a single overall comparison.

F = MSbetween ÷ MSwithin = [SSbetween ÷ (k − 1)] ÷ [SSwithin ÷ (N − k)]

SSbetween measures how far the group means sit from the grand mean; SSwithin measures the variation inside each group (the noise). If the signal beats the noise by a wide margin, F is large.

Calculation with the data above (k = 3 groups, n = 5 per group, N = 15). Grand mean = 50.31 g.

F = 0.6407 ÷ 0.0523 = 12.24

SourceSQglMQFp
Between machines1.28120.640712.240.0013
Within (error)0.628120.0523
Total1.90914

The critical F at 5% with 2 and 12 degrees of freedom is 3.885. Since 12.24 > 3.885, and p = 0.0013 < 0.05, H0 is rejected: at least one machine has a different mean.

Advertisement

Which machine differs? Tukey's post hoc test

ANOVA says a difference exists but not where. Tukey's test compares all pairs while holding the overall risk at 5%. The minimum significant difference is HSD = q × √(MSwithin ÷ n), with q = 3.773 (3 groups, 12 df).

HSD = 3.773 × √(0.0523 ÷ 5) = 0.386 g

PairDifference of means (g)Versus HSD 0.386Conclusion
B − A0.62largerDiffer
B − C0.62largerDiffer
A − C0.00smallerDo not differ

Process conclusion: machine B fills about 0.62 g more than A and C (1.2% of the 50 g nominal weight). Adjust or investigate B (nozzle, pressure, calibration) and confirm with a new sample. To follow up, use a control chart.

Common mistakes and assumptions

To relate two continuous variables instead of comparing groups, see the scatter diagram and correlation. To express the result in defects per million, see the sigma level.

Frequently asked questions

What is a p-value in plain language?

It is the probability of seeing a difference as large as the one observed if there were actually no difference at all. The smaller it is, the harder it is to blame chance.

When should I use ANOVA instead of a t test?

When there are three or more groups. With two groups, ANOVA and the t test give the same result (F = t²).

What does p < 0.05 mean?

That if H0 were true, a difference like this would appear less than 5% of the time. By convention, H0 is rejected.

In the example, why is F = 12.24 significant?

Because it exceeds the critical F of 3.885 (5%, 2 and 12 df); the matching p-value is 0.0013.

What do I do after a significant ANOVA?

Run a post hoc test such as Tukey to see which groups differ, then check whether the difference matters for the product.

How many samples do I need?

It depends on the difference worth detecting and on process variation. As a starting point use at least 5 to 10 per group and calculate the test power in statistical software.

Advertisement

Sources

  1. MONTGOMERY, D. C.; RUNGER, G. C. Applied Statistics and Probability for Engineers. Wiley.
  2. MONTGOMERY, D. C. Design and Analysis of Experiments. Wiley.
  3. FISHER, R. A. Statistical Methods for Research Workers. Edinburgh: Oliver and Boyd, 1925.
  4. TUKEY, J. W. Comparing individual means in the analysis of variance. Biometrics, v. 5, 1949.
  5. PYZDEK, T.; KELLER, P. The Six Sigma Handbook. McGraw-Hill.

Keep studying: trusted sources and links

Save this address: Manufatura Enxuta is your school for lean manufacturing. Come back whenever you need to study, with a complete article, a visual map and trusted sources. Follow one of the learning paths or check the A–Z glossary.

Want to measure what really matters?

Download the free e-book on performance indicators and track the losses in your operation.

Download the e-book
Photo of Vagner Soares

About the author

Vagner Soares

Lean Manufacturing & Behavioral Management Specialist

Over 20 years in the automotive and metalworking industries (GM and Dana), Lean Manufacturing practitioner since 2006. SENAI instructor and mentor in Brazil’s Brasil Mais Produtivo program, delivering consulting, training and audits for 50+ companies, combining quality, productivity and people development.