3.4.2.4 - Chi-square and geographical hypotheses

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

χ2=∑(O−E)2E\chi^2=\sum\frac{(O-E)^2}{E}

OO is an observed count and EE the count expected under H0H_0. 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 60/3=2060/3=20. The observed counts are 30,20 and 10:

CategoryOOEE(O−E)2/E(O-E)^2/E
Residential30205
Retail20200
Open space10205
Total606010

Thus χ2=10\chi^2=10. Each category is mutually exclusive and the categories exhaust the classified sample. For kk categories and no parameters estimated from these data, goodness-of-fit degrees of freedom are k−1k-1, 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 k−1k-1 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:

PeriodRoute ARoute BRoute CRow total
Morning1410630
Evening6101430
Column total20202060

H0H_0 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 E=30×20/60=10E=30\times20/60=10. The cell contributions are 1.6,0,1.6 in the first row and 1.6,0,1.6 in the second, totalling χ2=6.4\chi^2=6.4.

For an rr-row, cc-column contingency table, degrees of freedom are (r−1)(c−1)(r-1)(c-1), here (2−1)(3−1)=2(2-1)(3-1)=2. 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