4.4(b) - Chi-squared and geographical association
Chi-squared can test whether two categorical geographical variables are associated, such as neighbourhood and a journey-time category. This lesson develops 4.4(b) through an original contingency-table example, explaining expected frequencies, the calculation, significance decisions and the limits of the resulting geographical claim.
Categorical observations and hypotheses
Some geographical evidence records categories rather than measurements on a continuous scale. A household may be classified by neighbourhood and whether its journey to a service is short or long. A contingency table cross-classifies each household using both variables. Each observation must belong to one row and one column, and categories must be mutually exclusive and consistently defined.
The chi-squared test of independence compares observed counts with counts expected if the two classifications were independent. Independence means that knowing one category does not change the probability of the other. The null hypothesis states that the variables are independent in the relevant population; the alternative states that they are associated. It does not specify which geographical mechanism produces an association.
An original illustrative survey defines a short journey as under 15 minutes and a long journey as 15 minutes or more. It samples 50 independent households in each neighbourhood, with one response per household. These definitions prevent a 15-minute journey being counted twice or omitted.
| Observed households | Short journey | Long journey | Row total |
|---|---|---|---|
| Neighbourhood A | 30 | 20 | 50 |
| Neighbourhood B | 20 | 30 | 50 |
| Column total | 50 | 50 | 100 |
The table suggests different journey-category proportions, but a test is needed to assess whether this difference is sufficiently unusual under independence. Chi-squared uses frequencies, not the raw percentages or the journey durations. Converting the counts to percentages and treating those percentages as if they were additional people would change the test incorrectly.
A chi-squared goodness-of-fit test is related but asks a different question: whether one categorical distribution fits stated expected proportions. Its expected counts and degrees of freedom follow that model. Do not automatically apply the independence-table formula to every test called chi-squared. The NIST independence-test reference describes the two-variable table used here.
Real categorical data also need explicit definitions. The first Census 2021 results for England and Wales, released on 28 June 2022, reported usual-resident populations by sex and five-year age groups. Their reference-date definition used 21 March 2021. These are defined classifications of residents, rather than a count of people passing through on publication day. A contingency analysis must retain the categories and population to which the actual counts refer.
Expected frequencies
An expected frequency is the count predicted for a cell under the null model, given the table's totals. It is not a target chosen by the investigator or a count that ought morally to occur. For a test of independence, use the row total multiplied by the column total, divided by the grand total.
Here is an expected frequency for one cell.
Worked equal margins
In the journey table, each neighbourhood has 50 households and each journey category 50. Substitute the margins:
Each expected row and column totals 50, matching the observed margins.
Expected counts need not be whole numbers, even though observed counts are. They represent a model's expected values, not a proposed set of literal fractional households. Retain sufficient precision during calculations. Check that the expected values reproduce the observed row and column totals; a mismatch can expose a calculation error.
Worked unequal margins
A separate table has 80 households in C and 20 in D, with 70 short and 30 long journeys overall. Calculate all four cells using their own margins:
The rows sum to 80 and 20; the columns to 70 and 30. Equal expectations are therefore a feature of equal margins, not a general rule.
Calculating chi-squared
The chi-squared statistic combines the discrepancy between observed and expected frequencies across every cell. Subtract expected from observed, square that difference, divide by the expected count, then sum the contributions. Squaring prevents positive and negative discrepancies from cancelling; dividing by expectation scales the discrepancy relative to the modelled frequency.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account