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.
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:
Pass
Fail
Row total
Crew A
42
8
50
Crew B
30
20
50
Column total
72
28
100
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?
Two independent sample variances
Three or more sample medians
Two sample means from independent groups, after checking that both are normal
A single sample proportion to a target value
Answer: d. The 1-proportion test compares one sample's observed proportion against a hypothesized target proportion.
2. What distribution underlies the normal-approximation z statistic used in 1- and 2-proportion tests?
The binomial distribution
The F distribution
The chi-square distribution
The t distribution
Answer: a. Proportion tests rely on a normal approximation to the underlying binomial distribution, which requires an adequately large sample size.
3. Compared to detecting a difference in a continuous measurement, detecting a similarly small difference between two proportions generally requires what?
No sample at all, since proportions are always exact
A substantially larger sample size
Exactly the same sample size
A smaller sample size
Answer: b. Attribute (proportion) data carries less information per observation than continuous data, so detecting a comparable effect size typically needs a larger sample.
4. The chi-square test of independence is used on which kind of data?
Paired continuous measurements
A single continuous sample versus a target mean
Three or more independent continuous samples
A contingency table of counts across two or more categorical variables
Answer: d. The chi-square test of independence works on a contingency table of counts, testing whether two categorical variables are related.
5. In a chi-square test of independence, how is a cell's expected count calculated?
Grand total divided by the number of cells in the table
(Row total x column total) / grand total
Row total minus column total
Row total x column total x grand total
Answer: b. Expected count = (row total x column total) / grand total, computed under the null hypothesis of independence.
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?
14.0
28.0
36.0
50.0
Answer: c. Expected(Crew A, Pass) = row total (50) x column total (72) / grand total (100) = 36.0.
7. Using the same table, what is the chi-square statistic's contribution from the Crew A, Fail cell (observed 8, expected 14)?
2.571
1.000
6.000
0.429
Answer: a. (8 - 14)² / 14 = 36 / 14 = 2.571.
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?
Accept the null hypothesis as proven
The test is invalid because expected counts are too small
Reject the null hypothesis; pass rate and crew appear related
Fail to reject the null hypothesis; no evidence of a relationship
Answer: c. 7.143 exceeds the critical value of 3.841, so the null hypothesis of independence is rejected; all expected counts were at least 5, so the approximation was valid.
9. How are degrees of freedom calculated for a chi-square test of independence on an r-by-c contingency table?
r x c, one degree of freedom for each cell in the table
r + c - 2
r x c - 1
(r - 1) x (c - 1)
Answer: d. Degrees of freedom = (number of rows - 1) x (number of columns - 1).
10. What is the standard rule of thumb about expected cell counts for the chi-square approximation to be reliable?
Expected counts should generally be at least 5 in each cell
Expected counts must all be under 5
Every observed count must be exactly equal
At least 30 observations total
Answer: a. A widely used guideline calls for expected counts of at least 5 in each cell before trusting the chi-square approximation.
11. If several expected cell counts fall below 5 in a contingency table, what is a recommended response?
Combine categories, collect more data, or use an exact test
Switch to a paired t test instead
Double every observed count to compensate
Report the chi-square result exactly as calculated with no changes
Answer: a. Standard responses to low expected counts are combining categories, collecting more data, or using an exact test built for small counts.
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-sample t test comparing each property type's mean to a target
Paired t test
1-proportion test
Chi-square test of independence
Answer: d. Comparing a categorical outcome across more than two categorical groups is exactly the case the chi-square test of independence handles.
13. What is the null hypothesis in a chi-square test of independence?
The sample mean equals a target value
The two categorical variables are independent of each other
The two variables have equal variances
All row totals equal all column totals
Answer: b. The null hypothesis for the chi-square test of independence is that the row variable's distribution does not depend on the column category, i.e., they are independent.
14. A 2-proportion test would best fit which of these GCHS scenarios?
Testing whether a sample variance matches a historical variance
Comparing average repair cost across four vendors
Comparing on-time work-order completion rate between two maintenance vendors
Comparing a single crew's mean punch-list closeout time in days to a target of 12 days
Answer: c. Comparing an on-time (pass/fail) rate between two independent groups is a 2-proportion test scenario, not a continuous-data test.
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.