Two-Way Tables: Homogeneity and Independence — Solutions and Rubrics
Use these solutions after completing the independent application. The rubrics describe what the requested action must demonstrate; equivalent correct reasoning is welcome.
Original generated practice for the Fall 2026 course. Return to the lesson and independent checks.
Are commute distributions the same across towns?: worked answer
Independent SRSs of 90 working adults are drawn without replacement from each of three towns, each with at least 5,000 working adults. Each adult reports one primary commute choice: walk, bus or drive. Researchers ask whether the categorical commute distribution is the same in all towns, using α=0.05.
| Town | Walk | Bus | Drive | Total |
|---|---|---|---|---|
| A | 45 | 30 | 15 | 90 |
| B | 30 | 30 | 30 | 90 |
| C | 15 | 30 | 45 | 90 |
| Total | 90 | 90 | 90 | 270 |
For a chi-square distribution with 4 degrees of freedom, P(χ²≥30)=0.00000489444. This is an upper-tail probability, supplied so no particular calculator is required.
Part a
Choose the test and explain how the sampling design determines it. Identify the categorical variable and populations. State both hypotheses in context without implying that only two category percentages are compared.
Use a chi-square test for homogeneity: independent samples were selected from three town populations and one categorical variable, primary commute choice, is compared. H₀: the walk/bus/drive distributions are the same across towns A, B and C. Hₐ: the distributions are not all the same across these town populations. The alternative need not mean every town or every category differs.
| Evidence for credit | Points |
|---|---|
| Selects homogeneity because independent town samples compare one categorical variable. | 1 |
| States same versus not-all-same distributions with all town populations. | 1 |
Part b
Find all expected counts, showing one row-total/column-total calculation. Then justify every required condition, including whether observed or expected counts determine the count condition.
For each cell E=(row total)(column total)/(table total)=90(90)/270=30, so the expected table has 30 in all nine cells. The independent SRSs establish randomization. Each sample 90 is at most 10% of its town population (90≤500 even at the stated minimum). Every expected count 30 is strictly greater than 5, satisfying the official expected-count condition. The condition uses the null expected counts, not the observed 15, 30 or 45.
| Evidence for credit | Points |
|---|---|
| Computes expected count formula and all nine 30s. | 1 |
| Justifies randomization, each population bound and every expected count >5. | 1 |
Part c
Calculate each distinct cell contribution and the whole chi-square statistic, the degrees of freedom and p-value. Describe the relevant distribution and why the tail is upper rather than lower or doubled.
Cells with O=45 or 15 contribute (15)²/30=7.5 each; there are four. Five O=30 cells contribute zero. Thus χ²=4(7.5)=30. df=(3−1)(3−1)=4. Under H₀ the statistic is approximately chi-square with df=4; p=P(χ²₄≥30)=0.00000489444. The sum measures observed-versus-expected squared discrepancy relative to expected counts. Values are nonnegative and large values are the evidence against H₀; do not double the upper tail. Chi-square curves are right-skewed; skew diminishes as df increases.
| Evidence for credit | Points |
|---|---|
| Accounts for four 7.5 and five zero contributions; stat=30, df=4. | 1 |
| Correct upper-tail p and chi-square shape/discrepancy explanation. | 1 |
Part d
Interpret the p-value conditionally and decide at α=0.05. Answer the investigative question in context and explain what the test does not identify on its own.
If all three town populations had the same commute distribution, the probability of obtaining a chi-square discrepancy at least 30 from these independent samples is approximately 0.00000489444. Because this is ≤0.05, reject H₀. There is convincing statistical evidence that the primary commute distributions are not all the same across working adults in towns A, B and C. The omnibus test alone does not say which specific town/category differences are responsible or establish that town residence caused them.
| Evidence for credit | Points |
|---|---|
| Conditions probability on common distributions and uses >= observed discrepancy. | 1 |
| Rejects and states not-all-same distributions with contextual limits. | 1 |
Are dwelling type and park visits associated?: worked answer
An SRS of 200 residents is selected without replacement from a city of 25,000 residents. Each resident is classified by dwelling type and usual park-visit frequency. The question concerns association between these two categorical variables in this city population, using α=0.01.
| Dwelling | Daily | Weekly | Less often | Total |
|---|---|---|---|---|
| Apartment | 50 | 30 | 20 | 100 |
| House | 30 | 40 | 30 | 100 |
| Total | 80 | 70 | 50 | 200 |
A chi-square upper-tail calculation gives P(χ²₂≥8.428571)=0.01478288.
Part a
Select the test and explain why this design differs from independent samples from several populations. State H₀ and Hₐ in both association language and independence language, identifying the population and both variables.
Use chi-square independence: one SRS from one city measures dwelling type and park-visit frequency on every person. H₀: no association between the variables among city residents; equivalently, the variables are independent in that population. Hₐ: an association exists; equivalently, they are not independent. Separate row labels do not turn this single sample into two independently sampled populations.
| Evidence for credit | Points |
|---|---|
| Names independence and one sampled population, both variables. | 1 |
| States no-association/independent and association/not-independent alternatives correctly. | 1 |
Part b
Calculate all six expected counts and justify the three conditions. Compute each contribution to χ², its sum and df. Use the supplied tail probability to find the p-value.
Each row’s expected counts are 100(80)/200=40, 100(70)/200=35 and 100(50)/200=25. SRS gives randomization; 200≤2,500 meets 10%; all expected counts (40,35,25 in both rows) are >5. Contributions per row: (50−40)²/40 or (30−40)²/40=2.5; squared 5 difference over 35=0.7142857; squared 5 difference over 25=1. Thus χ²=2(2.5+0.7142857+1)=8.428571. df=(2−1)(3−1)=2; p≈0.01478288, upper tail.
| Evidence for credit | Points |
|---|---|
| Correct six expected counts and full design/count checks. | 1 |
| Correct contributions/sum, df=2 and upper-tail p≈0.01478. | 1 |
Part c
Interpret the p-value and conclude at α=0.01. A resident says “The test establishes independence.” Explain why this statement is too strong and compare the decision if α had been 0.05.
Assuming dwelling type and visit frequency are independent among city residents, the chance of a sample table with χ² at least 8.428571 is about 0.01478. Since 0.01478>0.01, fail to reject H₀: there is not convincing evidence of an association at the 1% level. This does not establish independence or rule out a real association. At a prespecified α=0.05 the same p≤0.05 would reject H₀ and provide evidence of association. The threshold changes the decision, not the observed data or p-value.
| Evidence for credit | Points |
|---|---|
| Correct null-conditional interpretation. | 1 |
| Fail-rejection at .01, rejection at .05; avoids proving independence. | 1 |
What makes a chi-square analysis defensible?: worked answer
Study A randomly assigns 120 volunteers, 40 to each of three snack packages, and records one of three preference ratings. Every null expected cell is 12 or more. Study B is one SRS of 80 households without replacement from a population of 400; each household is classified by dwelling tenure (own/rent) and heating type (gas/electric/other); its smallest expected cell is 9. Study C uses independent SRSs from two towns, records primary commute category (walk/bus/drive) and each sample no more than 5% of its population, but one expected cell is exactly 5. Study D measures numeric travel times and compares averages. The investigators want to compare population/treatment response distributions or association as their designs allow.
Part a
For A–D choose homogeneity, independence, a mean procedure, or explain why the proposed chi-square approximation is not justified. For A–C explicitly discuss randomization, the 10% condition and the strict expected-count requirement. Explain the scope of A’s conclusion.
A supports a homogeneity analysis across randomized treatments; random assignment supplies randomization, the sampling-without-replacement condition is unnecessary for the experiment, and each expected count is >5. Its volunteers do not establish population-wide representativeness; random assignment can support a treatment effect for these participants under the design. B is an independence design if it records two categorical variables per household, but 80>0.10(400)=40 violates the sampling condition despite adequate counts. C is a homogeneity design with randomization and 10% satisfied, but the expected count exactly 5 fails the required strictly-greater-than-5 condition. D’s numerical travel-time mean is not a categorical count distribution; a mean method may fit, subject to its own design/conditions.
| Evidence for credit | Points |
|---|---|
| Correctly matches response/design to method. | 1 |
| Explains A exemption, B 80>40 and C strict >5 failure; limits A population scope. | 1 |
Part b
Describe how χ² measures discrepancy and how the shape changes between df=2 and df=10. Explain why a negative test statistic or a lower-tail p-value would signal a calculation/interpretation error.
χ² adds (O−E)²/E over all cells; positive expected counts make contributions nonnegative. Its distribution is positive/nonnegative and skewed right. At df=10 the skew is less pronounced than at df=2. Large upper-tail values represent more discrepancy, so the p-value is an upper-tail probability. A negative sum or a lower-tail p-value contradicts the construction and direction of evidence.
| Evidence for credit | Points |
|---|---|
| Correct sum/discrepancy and nonnegative property. | 1 |
| Correct skew change and upper-tail direction. | 1 |