Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Worked Example: Chi-Squared Test for Categorical Data

Suppose there is a city of 1 million residents with four neighborhoods: A, B, C, and D. A random sample of
650 residents of the city is taken and their occupation is recorded as "blue collar", "white collar", or "no
collar". The null hypothesis is that each person's neighborhood of residence is independent of the person's
occupational classification. The data are tabulated as:

A B C D Total
White collar 90 60 104 95 349
Blue collar 30 50 51 20 151
No collar 30 40 45 35 150
Total 150 150 200 150 650

Let us take the sample living in neighborhood A, 150/650, to estimate what proportion of the whole 1 million
people live in neighborhood A. Similarly we take 349/650 to estimate what proportion of the 1 million people
are white-collar workers. By the assumption of independence under the hypothesis we should "expect" the
number of white-collar workers in neighborhood A to be

150(349)
OR
650
Then in that "cell" of the table, we have

The sum of these quantities over all of the cells is the test statistic. Under the null hypothesis, it has
approximately a chi-square distribution whose number of degrees of freedom are

Use the degrees of freedom to check a table of critical values to determine the p value at 0.05, against
which you’ll compare your 𝝌2 value.

Source: https://malouffapbioblog.wordpress.com/2013/05/16/ap-biology-exam-last-minute-cramming/

In this case, if your 𝝌2 value is greater than 12.59, you can conclude, with 95% certainty, that a relationship
does exist and that the likelihood of your results being due to chance alone are less than 5%.

Resource modified from: https://en.wikipedia.org/wiki/Chi-squared_test

You might also like