Lean Six Sigma 100%

Green Belt · Analyze phase

Lesson 6: Proportions and chi-square

IASSC Body of Knowledge 3.5.7-3.5.8, Hypothesis Testing for Proportions and Chi-Square Tests · 14 practice questions

0:00 / --:--

Reading

Lessons 4 and 5 covered tests for continuous, measured data such as turnaround time or cost overrun. Much of the data GCHS actually collects is attribute data instead: a permit either passed inspection or it did not, an applicant either qualified for a program or did not. This lesson covers the hypothesis tests built for that kind of pass/fail, category-based data: tests on one and two proportions, and the chi-square test of independence for larger contingency tables with more than two categories.

Contingency table: observed vs. expected inspection pass counts by crew A 2 by 2 contingency table comparing Crew A and Crew B on inspection pass and fail counts. Crew A: 42 pass, 8 fail, row and column totals shown. Crew B: 30 pass, 20 fail. Totals: 72 pass, 28 fail, grand total 100. Below the observed table, an expected-count table shows each cell's expected value computed as row total times column total divided by grand total, all four expected values equal to 36 or 14. Observed counts Crew A Pass Fail Row total Crew A 42 8 50 Crew B 30 20 50 Col total 72 28 100 Expected counts (row x col / grand total) Crew A, Pass 36.0 Crew A, Fail 14.0 Crew B, Pass 36.0 Crew B, Fail 14.0 Example: 50 x 72 / 100 = 36.0 Chi-square = sum of (Observed - Expected)² / Expected across all four cells df = (rows - 1) x (cols - 1) = (2-1)(2-1) = 1
A 2 by 2 contingency table of inspection pass/fail counts by crew, with each cell's expected count computed from its row and column totals, feeding the chi-square test of independence.

1-proportion test

The 1-proportion test compares a single sample proportion to a target value, for example testing whether GCHS's first-pass NSPIRE inspection rate of 82 percent across a sample of properties differs from a program target of 90 percent. It uses a z statistic based on the normal approximation to the binomial distribution, valid as long as the sample is large enough (a common rule of thumb requires both n times the hypothesized proportion and n times one minus that proportion to be at least 5, sometimes stated as at least 10 for a more conservative check).

2-proportion test

The 2-proportion test compares proportions from two independent samples, for example whether the on-time work-order completion rate differs between two maintenance vendors. Like the 1-proportion test, it relies on a normal approximation and needs an adequately large sample in each group; when sample sizes are small or the true proportion is near 0 or 1, an exact test is a safer alternative. Because proportion tests depend on the normal approximation holding, sample-size planning matters more here than with continuous data: detecting a small difference between two proportions, or estimating a proportion tightly, generally requires a substantially larger sample than an equivalent test on continuous measurements would.

Chi-square test of independence

When there are more than two categories on one or both sides of a comparison, for example checking whether inspection outcome (pass/fail) is associated with property type (single-family, duplex, multifamily), the chi-square test of independence is used on the resulting contingency table. The null hypothesis is that the two categorical variables are independent, meaning the row variable's distribution does not depend on the column category. For each cell, an expected count is calculated under that null hypothesis:

Expected count = (row total x column total) / grand total

The test statistic sums (observed - expected)² / expected across every cell in the table, and is compared to a chi-square distribution with degrees of freedom = (number of rows - 1) x (number of columns - 1). A widely used guideline is that the chi-square approximation is reliable when expected counts are at least 5 in each cell; when several expected counts fall below 5, categories are typically combined or an exact test is used instead.

Worked example. GCHS wants to know whether inspection pass rate depends on which of two rehab crews did the work. A sample of 100 completed jobs is reviewed:

PassFailRow total
Crew A42850
Crew B302050
Column total7228100
  • Expected(Crew A, Pass) = 50 x 72 / 100 = 36.0
  • Expected(Crew A, Fail) = 50 x 28 / 100 = 14.0
  • Expected(Crew B, Pass) = 50 x 72 / 100 = 36.0
  • Expected(Crew B, Fail) = 50 x 28 / 100 = 14.0

All four expected counts are at least 5, so the chi-square approximation is appropriate. The test statistic is:

  • (42 - 36)² / 36 = 36 / 36 = 1.000
  • (8 - 14)² / 14 = 36 / 14 = 2.571
  • (30 - 36)² / 36 = 36 / 36 = 1.000
  • (20 - 14)² / 14 = 36 / 14 = 2.571

Chi-square = 1.000 + 2.571 + 1.000 + 2.571 = 7.143. Degrees of freedom = (2-1) x (2-1) = 1. The critical chi-square value for df = 1 at alpha = 0.05 is 3.841. Since 7.143 is greater than 3.841, the null hypothesis of independence is rejected: pass rate appears to depend on which crew did the work, evidence worth following up with the two crews directly rather than attributing the gap to chance.

Why this matters

A contingency table this small is easy to eyeball as "Crew B looks worse," but eyeballing does not tell you whether a 24-point gap in pass rate (84 percent versus 60 percent) could plausibly be random noise from only 50 jobs per crew. The chi-square test gives that gap an actual statistical footing before a staffing or training decision gets made on the strength of it.

When the expected-count guideline is not met

If a contingency table has categories with very low counts, such as a rare defect type that occurred only twice across the whole sample, several expected cell counts will fall below 5 and the chi-square approximation becomes unreliable. The standard responses are to combine adjacent categories into a broader "other" category until expected counts clear the guideline, or to collect more data before testing, or to use an exact test built for small counts. Reporting a chi-square result computed on a table with mostly single-digit expected counts, without addressing this, is a common and avoidable error.

Practice questions

1. A 1-proportion test is used to compare which of the following?

  1. Two independent sample variances
  2. Three or more sample medians
  3. Two sample means from independent groups, after checking that both are normal
  4. A single sample proportion to a target value

2. What distribution underlies the normal-approximation z statistic used in 1- and 2-proportion tests?

  1. The binomial distribution
  2. The F distribution
  3. The chi-square distribution
  4. The t distribution

3. Compared to detecting a difference in a continuous measurement, detecting a similarly small difference between two proportions generally requires what?

  1. No sample at all, since proportions are always exact
  2. A substantially larger sample size
  3. Exactly the same sample size
  4. A smaller sample size

4. The chi-square test of independence is used on which kind of data?

  1. Paired continuous measurements
  2. A single continuous sample versus a target mean
  3. Three or more independent continuous samples
  4. A contingency table of counts across two or more categorical variables

5. In a chi-square test of independence, how is a cell's expected count calculated?

  1. Grand total divided by the number of cells in the table
  2. (Row total x column total) / grand total
  3. Row total minus column total
  4. Row total x column total x grand total

6. In the crew inspection example (Crew A: 42 pass, 8 fail; Crew B: 30 pass, 20 fail; totals 72 pass, 28 fail, grand total 100), what is the expected count for Crew A, Pass?

  1. 14.0
  2. 28.0
  3. 36.0
  4. 50.0

7. Using the same table, what is the chi-square statistic's contribution from the Crew A, Fail cell (observed 8, expected 14)?

  1. 2.571
  2. 1.000
  3. 6.000
  4. 0.429

8. Summing all four cell contributions in that example gives chi-square = 7.143. With df = 1 and a critical value of 3.841 at alpha = 0.05, what is the conclusion?

  1. Accept the null hypothesis as proven
  2. The test is invalid because expected counts are too small
  3. Reject the null hypothesis; pass rate and crew appear related
  4. Fail to reject the null hypothesis; no evidence of a relationship

9. How are degrees of freedom calculated for a chi-square test of independence on an r-by-c contingency table?

  1. r x c, one degree of freedom for each cell in the table
  2. r + c - 2
  3. r x c - 1
  4. (r - 1) x (c - 1)

10. What is the standard rule of thumb about expected cell counts for the chi-square approximation to be reliable?

  1. Expected counts should generally be at least 5 in each cell
  2. Expected counts must all be under 5
  3. Every observed count must be exactly equal
  4. At least 30 observations total

11. If several expected cell counts fall below 5 in a contingency table, what is a recommended response?

  1. Combine categories, collect more data, or use an exact test
  2. Switch to a paired t test instead
  3. Double every observed count to compensate
  4. Report the chi-square result exactly as calculated with no changes

12. GCHS wants to test whether inspection outcome (pass/fail) is associated with property type across three categories (single-family, duplex, multifamily). Which test applies?

  1. 1-sample t test comparing each property type's mean to a target
  2. Paired t test
  3. 1-proportion test
  4. Chi-square test of independence

13. What is the null hypothesis in a chi-square test of independence?

  1. The sample mean equals a target value
  2. The two categorical variables are independent of each other
  3. The two variables have equal variances
  4. All row totals equal all column totals

14. A 2-proportion test would best fit which of these GCHS scenarios?

  1. Testing whether a sample variance matches a historical variance
  2. Comparing average repair cost across four vendors
  3. Comparing on-time work-order completion rate between two maintenance vendors
  4. Comparing a single crew's mean punch-list closeout time in days to a target of 12 days

Glossary

1-proportion test
A test comparing a single sample proportion to a hypothesized target proportion, using a normal approximation to the binomial distribution.
2-proportion test
A test comparing proportions from two independent samples, requiring an adequately large sample size in each group.
Contingency table
A table of observed counts cross-classified by two or more categorical variables, used as the input to a chi-square test of independence.
Chi-square test of independence
A test of whether two categorical variables in a contingency table are independent, comparing observed to expected counts.
Expected count
The count a contingency table cell would show if the null hypothesis of independence were exactly true, calculated as row total x column total / grand total.
Degrees of freedom (contingency table)
For an r-by-c contingency table, (r - 1) x (c - 1).
Expected-count guideline
The rule of thumb that each contingency table cell should have an expected count of at least 5 for the chi-square approximation to be reliable.