# Special cases within chi square test

In the previous article we discussed about basics of Chi Square. However, there could be some special cases within chi square which basically means that we can conduct Chi square for in-depth analysis.

## Are proportions equal?

A special case of the chi-square test for independence is the test that several proportions are equal. For example, you want to test whether the % of people who report themselves to be very happy has changed during the time that the test has been conducted. The figure below is a cross-tabulation of the % of people who say were very happy for each of the decades. This uses the aggregated SPSS .sav file. Almost 35% of the people questioned in the 1970s claimed that they were very happy, compared to 31% in this millennium.

## Calculating the chi square statistic

If the null hypothesis is true, you expect 32.1% of people to be “very happy” in each decade, the overall very happy rate. You calculate the expected number in each decade by multiplying the total number of people questioned in each decade by 32.1%. The expected number of “pretty happy” people is 67.9% multiplied by the number of people in each decade. These values are shown in the table above. The chi-square statistic is calculated in the usual fashion.

From the table below, you see that the observed significance level for the chi-square statistic is < .001, leading you to reject the null hypothesis that in each decade people are equally likely to describe themselves as very happy. Notice that the difference between years isn’t very large; the largest % is 34.3% for the 1970s, while the smallest is 30.9% for the 1990s. The sample sizes in each group are very large, so even small differences are statistically significant, although they may have little practical implication.

## Introducing a control variable

To see whether both men and women experienced changes in happiness during this time period, you can compute the chi-square statistic separately for men and for women, as shown below:

**Step 1:**Go to Analyze, then Descriptive Statistics, then Crosstabs (Figure 1)

**Step 2:**Then put the variable happy in the row box and decade in the column box, then the variable Gender (ALREADY IN THE PREVIOUS EXAMPLE WE HAVE COMPARED HAPPINESS WITH DECADE AND IN THIS CASE WE ARE ADDING A CONTROL VARIABLE I.E. GENDER TO DETERMINE IF HAPPINESS CHANGES ACROSS DECADES WITH RESPECT TO GENDER AS WELL OR NOT) into layer 1 of 1, then select under the “Cells” tab in the crosstabs dialog box, the boxes marked “Observed” and “Expected” under Counts and column %, then select OK and go back and select the statistics box in order to order a chi-square test (Figure 2).

**Results:** You see that for Males, you can’t reject the null hypothesis that happiness has not changed with time. This is because the significance value in case of males is greater at 0.01. You can reject the null hypothesis for women. You can also plot a graph to depict same (Table3).

- Go to the GRAPHS menu, under “Legacy Dialogs”choose LINE then select the Multiple icon and summaries for groups of cases, and then click DEFINE (Figure 3).

- Since we need to determine the relationship between decade and Gender. Therefore, next we will move decade into the category axis box and Gender into the Panel by box in Row section.
- Now since the determining factor is “HAPPINESS” we will Select other statistic, then move happy into the variable list, and then CLICK change statistic.
- In the statistic sub-dialog box, select % inside and type 1 into both the low and high text boxes. Click “Continue”, and then click OK (Figure 4).

**RESULT:** The following Graph would appear. From the line plot in the graph below, you see that in the sample, happiness decreases with time for women, but not for men (Figure 5).

## Discuss