Tests of Independence (Chi-Square)
This example uses the data file survey_sample.sav. See the topic Sample Files for more information.
The chi-square test of independence is used to determine whether there is a relationship between two categorical variables. For example, you may want to determine whether Labor force status is related to Marital status.
- From the menus,
choose:
- In the table builder, drag and drop Labor force status from the variable list into the Rows area of the canvas pane.
- Drag and drop Marital status from the variable list into the Columns area.
- Select Rows as the position for the summary statistics.
- Select Labor force status and click Summary Statistics in the Define group.
- Select Column N % in the Statistics list and add it to the Display list.
- Click Apply to Selection.
- In the Custom Tables dialog box, click the Test Statistics tab.
- Select Tests of independence (Chi-square).
- Click OK to create the table and obtain the chi-square test.

This table is a crosstabulation of Labor force status by Marital status, with counts and column proportions shown as the summary statistics. Column proportions are computed so that they sum to 100% down each column. If these two variables are unrelated, then in each row the proportions should be similar across columns. There appear to be differences in the proportions, but you can check the chi-square test to be sure.

The test of independence hypothesizes that Labor force status and Marital status are unrelated--that is, that the column proportions are the same across columns, and any observed discrepancies are due to chance variation. The chi-square statistic measures the overall discrepancy between the observed cell counts and the counts you would expect if the column proportions were the same across columns. A larger chi-square statistic indicates a greater discrepancy between the observed and expected cell counts--greater evidence that the column proportions are not equal, that the hypothesis of independence is incorrect, and, therefore, that Labor force status and Marital status are related.
The computed chi-square statistic has a value of 729.242. In order to determine whether this is enough evidence to reject the hypothesis of independence, the significance value of the statistic is computed. The significance value is the probability that a random variate drawn from a chi-square distribution with 28 degrees of freedom is greater than 729.242. Since this value is less than the alpha level specified on the Test Statistics tab, you can reject the hypothesis of independence at the 0.05 level. Thus, Labor force status and Marital status are in fact related.