3.4.2.4 - Chi-square and geographical hypotheses
Chi-square compares observed categorical counts with counts expected under a stated null model. Learn goodness-of-fit and contingency-table methods, their assumptions and significance decisions, then express a defensible geographical conclusion. All worked counts are original illustrative training datasets.
Goodness of fit and expected counts
A goodness-of-fit test asks whether counts across categories depart sufficiently from a prespecified distribution to provide evidence against that null model.
Chi-square
is an observed count and the count expected under . Sum all categories or table cells. The statistic is non-negative; counts and the final statistic must not be confused with percentages.
Suppose 60 independently sampled public street segments are classified once each as residential, retail or open space. The training null model predicts equal proportions, so each expected count is . The observed counts are 30,20 and 10:
| Category | |||
|---|---|---|---|
| Residential | 30 | 20 | 5 |
| Retail | 20 | 20 | 0 |
| Open space | 10 | 20 | 5 |
| Total | 60 | 60 | 10 |
Thus . Each category is mutually exclusive and the categories exhaust the classified sample. For categories and no parameters estimated from these data, goodness-of-fit degrees of freedom are , here 2. A supplied upper-tail5% critical value for 2 degrees of freedom is 5.991. Because 10 exceeds 5.991, reject the equal-proportions null: the sample provides evidence of a departure, with residential above and open space below expectation. It does not reveal what caused that distribution.
Expectations need not be equal. If a prespecified model predicts probabilities 0.5,0.3 and 0.2, multiply each by the total rather than dividing by 3. Expectations must be positive and sum to the observed total. If model parameters are fitted from the same data, the simple rule may need adjustment; that situation needs an appropriate specified method. Keep intermediate values unrounded and report the requested final accuracy.
Contingency tables and independence
A contingency-table test asks whether two categorical variables are associated; its expectations follow the marginal totals rather than an equal-share assumption.
Original training observations classify 60 independently sampled people by visit period and chosen route. Each person is counted in exactly one cell:
| Period | Route A | Route B | Route C | Row total |
|---|---|---|---|---|
| Morning | 14 | 10 | 6 | 30 |
| Evening | 6 | 10 | 14 | 30 |
| Column total | 20 | 20 | 20 | 60 |
states that period and route category are independent in the target population. Under independence, expected cell count = row total × column total ÷ grand total. Each cell here has . The cell contributions are 1.6,0,1.6 in the first row and 1.6,0,1.6 in the second, totalling .
For an -row, -column contingency table, degrees of freedom are , here . At the supplied 5% critical value 5.991,6.4 is larger, so reject independence: there is evidence of an association between visit period and route choice. Morning has more A and less C than expected; evening reverses this pattern. The statistic itself has no positive/negative direction; interpretation comes from the cells.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account