| No Pets | Cats Only | Dogs Only | Other Pets | Total | |
|---|---|---|---|---|---|
| Apartment | 30 | 20 | 15 | 5 | 70 |
| House | 40 | 30 | 45 | 15 | 130 |
| Total | 70 | 50 | 60 | 20 | 200 |
Expected count: E = (Row Total × Column Total) / Grand Total, assuming independence.
- Identify row and column totals
- Apply formula: E = (RT × CT) / GT
- Calculate expected count for each cell
- Verify all expected counts ≥ 5
Apartment-No Pets: (70 × 70) / 200 = 24.5
Apartment-Cats Only: (70 × 50) / 200 = 17.5
Apartment-Dogs Only: (70 × 60) / 200 = 21
Apartment-Other Pets: (70 × 20) / 200 = 7
House-No Pets: (130 × 70) / 200 = 45.5
House-Cats Only: (130 × 50) / 200 = 32.5
House-Dogs Only: (130 × 60) / 200 = 39
House-Other Pets: (130 × 20) / 200 = 13
All expected counts: 24.5, 17.5, 21, 7, 45.5, 32.5, 39, 13
Minimum expected count = 7 (all ≥ 5) ✓
At least 80% of cells have E ≥ 5 ✓
Apartment-No Pets: 24.5 (≥5) ✓
Apartment-Cats Only: 17.5 (≥5) ✓
Apartment-Dogs Only: 21 (≥5) ✓
Apartment-Other Pets: 7 (≥5) ✓
House-No Pets: 45.5 (≥5) ✓
House-Cats Only: 32.5 (≥5) ✓
House-Dogs Only: 39 (≥5) ✓
House-Other Pets: 13 (≥5) ✓
All expected counts are calculated correctly and meet the minimum requirement of 5, satisfying the conditions for the chi-square test.
• Expected count formula: E = (Row Total × Column Total) / Grand Total
• Minimum condition: All expected counts should be ≥ 5
• Majority condition: At least 80% of cells should have E ≥ 5
✓ All expected counts ≥ 5
✓ Chi-square approximation is valid
✓ Test can be performed
| Running | Swimming | Weight Training | Total | |
|---|---|---|---|---|
| Young (18-25) | 12 | 8 | 3 | 23 |
| Middle (26-40) | 15 | 12 | 5 | 32 |
| Older (41+) | 8 | 5 | 2 | 15 |
| Total | 35 | 25 | 10 | 70 |
Condition violation: When expected counts fall below the minimum threshold (typically 5).
Young-Running: (23 × 35) / 70 = 11.5
Young-Swimming: (23 × 25) / 70 = 8.21
Young-Weight Training: (23 × 10) / 70 = 3.29
Middle-Running: (32 × 35) / 70 = 16
Middle-Swimming: (32 × 25) / 70 = 11.43
Middle-Weight Training: (32 × 10) / 70 = 4.57
Older-Running: (15 × 35) / 70 = 7.5
Older-Swimming: (15 × 25) / 70 = 5.36
Older-Weight Training: (15 × 10) / 70 = 2.14
Violations: Young-Weight Training (3.29), Middle-Weight Training (4.57), Older-Weight Training (2.14)
3 out of 9 cells have E < 5 (33% violating condition)
More than 20% of cells have E < 5
Chi-square approximation may not be valid
Combine "Weight Training" with another category
Or increase sample size
The chi-square test conditions are violated. The expected count for "Older-Weight Training" is 2.14 < 5, which violates the minimum expected count requirement.
• Violation threshold: More than 20% of cells with E < 5
• Invalidation: Chi-square approximation becomes unreliable
• Remedies: Combine categories or increase sample size
✗ Young-Weight Training: E = 3.29 < 5
✗ Middle-Weight Training: E = 4.57 < 5
✗ Older-Weight Training: E = 2.14 < 5
Chi-square test not recommended
| Running | Swimming | Strength (Combined) | Total | |
|---|---|---|---|---|
| Young (18-25) | 12 | 8 | 3+5=8 | 23 |
| Middle (26-40) | 15 | 12 | 5+2=7 | 32 |
| Older (41+) | 8 | 5 | 2+2=4 | 15 |
| Total | 35 | 25 | 19 | 70 |
Category combination: Merging categories to increase expected counts and satisfy conditions.
Young-Running: (23 × 35) / 70 = 11.5
Young-Swimming: (23 × 25) / 70 = 8.21
Young-Strength: (23 × 19) / 70 = 6.24
Middle-Running: (32 × 35) / 70 = 16
Middle-Swimming: (32 × 25) / 70 = 11.43
Middle-Strength: (32 × 19) / 70 = 8.69
Older-Running: (15 × 35) / 70 = 7.5
Older-Swimming: (15 × 25) / 70 = 5.36
Older-Strength: (15 × 19) / 70 = 4.07
Most expected counts now ≥ 5, except Older-Strength: 4.07
Only 1 out of 9 cells has E < 5 (11% violating condition)
Less than 20% of cells have E < 5
Chi-square approximation is now acceptable
Consider combining with another small category if needed
After combining weight training with another strength-based activity, the chi-square test conditions are mostly satisfied with only one cell having an expected count below 5.
• Combination principle: Combine categories logically
• Condition improvement: Increases expected counts
• Acceptability: Less than 20% of cells with E < 5
✓ 8 out of 9 cells have E ≥ 5
✓ Only 11% of cells violate condition
✓ Chi-square test now acceptable
Expected count: The frequency expected in each cell if the null hypothesis of independence is true.
Contingency table: A table showing the distribution of one categorical variable across the categories of another categorical variable.
Independence assumption: The probability of being in a cell is the product of the probabilities of being in the corresponding row and column.
- Identify structure: Determine rows and columns in contingency table
- Calculate marginal totals: Row totals, column totals, and grand total
- Apply formula: E = (row total × column total) / grand total
- Verify conditions: Check that all expected counts are ≥ 5
- Count violations: Determine percentage of cells violating condition
- Take action: Combine categories if necessary
• Minimum expected count: All E ≥ 5 (preferred)
• Majority condition: At least 80% of cells have E ≥ 5
• Sample size: Generally n ≥ 40 for 2×2 tables
• Random sampling: Data should come from random sample
• Combine adjacent categories if meaningful
• Collect more data to increase sample size
• Use Fisher's Exact Test for 2×2 tables
• Consider alternative non-parametric tests
| Cash | Credit | Debit | Mobile | Total | |
|---|---|---|---|---|---|
| North | 45 | 60 | 55 | 30 | 190 |
| South | 35 | 40 | 35 | 20 | 130 |
| East | 50 | 70 | 60 | 40 | 220 |
| West | 20 | 30 | 25 | 15 | 90 |
| Total | 150 | 200 | 175 | 105 | 630 |
Large contingency table: 4×4 table requiring systematic calculation of 16 expected counts.
North-Cash: (190 × 150) / 630 = 45.24
North-Credit: (190 × 200) / 630 = 60.32
North-Debit: (190 × 175) / 630 = 52.78
North-Mobile: (190 × 105) / 630 = 31.67
South-Cash: (130 × 150) / 630 = 30.95
South-Credit: (130 × 200) / 630 = 41.27
South-Debit: (130 × 175) / 630 = 36.11
South-Mobile: (130 × 105) / 630 = 21.67
East-Cash: (220 × 150) / 630 = 52.38
East-Credit: (220 × 200) / 630 = 69.84
East-Debit: (220 × 175) / 630 = 61.11
East-Mobile: (220 × 105) / 630 = 36.67
West-Cash: (90 × 150) / 630 = 21.43
West-Credit: (90 × 200) / 630 = 28.57
West-Debit: (90 × 175) / 630 = 25
West-Mobile: (90 × 105) / 630 = 15
All expected counts: 45.24, 60.32, 52.78, 31.67, 30.95, 41.27, 36.11, 21.67, 52.38, 69.84, 61.11, 36.67, 21.43, 28.57, 25, 15
Minimum expected count = 15 (all ≥ 5) ✓
All 16 cells have E ≥ 5 ✓
All expected counts are greater than 5, satisfying the conditions for the chi-square test. The test can be performed with confidence.
• Systematic calculation: Apply formula to each cell
• Verification: Check all expected counts
• Acceptance: All conditions met for chi-square test
| Democrat | Republican | Independent | Total | |
|---|---|---|---|---|
| High School | 25 | 30 | 5 | 60 |
| College | 40 | 35 | 10 | 85 |
| Graduate | 20 | 15 | 0 | 35 |
| Total | 85 | 80 | 15 | 180 |
Critical violation: When expected counts are extremely low or zero, indicating severe condition failure.
HS-Democrat: (60 × 85) / 180 = 28.33
HS-Republican: (60 × 80) / 180 = 26.67
HS-Independent: (60 × 15) / 180 = 5
College-Democrat: (85 × 85) / 180 = 40.14
College-Republican: (85 × 80) / 180 = 37.78
College-Independent: (85 × 15) / 180 = 7.08
Graduate-Democrat: (35 × 85) / 180 = 16.53
Graduate-Republican: (35 × 80) / 180 = 15.56
Graduate-Independent: (35 × 15) / 180 = 2.92
Graduate-Independent: E = 2.92 < 5 (critical violation)
HS-Independent: E = 5 (borderline)
Combine "Independent" with "Republican" since both are conservative-leaning
Or collect more data to increase sample size
Use Fisher's Exact Test for 3×2 table
Consider Bayesian approaches
The expected count for Graduate-Independent is 2.92 < 5, violating the minimum expected count condition. The chi-square test cannot be reliably applied without modifications.
• Critical identification: Find the lowest expected counts
• Remedial action: Combine categories or use alternatives
• Validation: Recheck conditions after modification
✗ Graduate-Independent: E = 2.92 < 5
✗ Chi-square test not recommended
✓ Combine categories or use alternatives
Expected count: The theoretical frequency in each cell of a contingency table under the assumption that the two categorical variables are independent.
Contingency table: A cross-tabulation showing the joint distribution of two categorical variables, with rows representing one variable and columns representing another.
Independence: Two variables are independent if the conditional probability of one variable does not depend on the value of the other variable.
Chi-square approximation: The use of the chi-square distribution to approximate the sampling distribution of the test statistic.
- Construct contingency table: Organize observed data with row and column totals
- Calculate marginal totals: Sum rows and columns to get totals
- Apply expected count formula: E = (row total × column total) / grand total
- Calculate for all cells: Systematically compute expected count for each cell
- Verify conditions: Check that all expected counts are ≥ 5
- Count violations: Determine how many and what percentage of cells violate the condition
- Evaluate severity: Assess if violations are critical or manageable
- Take corrective action: Combine categories, increase sample size, or use alternatives
- Re-verify conditions: Confirm that new table meets requirements
• Expected count: E = (row total × column total) / grand total
• Minimum condition: All expected counts should be ≥ 5 (preferred)
• Majority condition: At least 80% of cells should have E ≥ 5
• Severity: More than 20% of cells with E < 5 is problematic
• Alternative: Fisher's Exact Test for 2×2 tables with small expected counts
1. Combine adjacent categories that are logically similar
2. Increase sample size if feasible
3. Use Fisher's Exact Test for 2×2 tables
4. Consider Monte Carlo simulation methods
5. Apply Yates' continuity correction for 2×2 tables
6. Use Bayesian approaches when appropriate