# SW318 Social Work Statistics Slide 1

Chi-square Test of Independence

Reviewing the Concept of Independence
Steps in Testing Chi-square Test of Independence Hypotheses Chi-square Test of Independence in SPSS

SW318 Social Work Statistics Slide 2

Chi-square Test of Independence

The chi-square test of independence is probably the most frequently used hypothesis test in the social sciences. In this exercise, we will use the chi-square test of independence to evaluate group differences when the test variable is nominal, dichotomous, ordinal, or grouped interval.

The chi-square test of independence can be used for any variable; the group (independent) and the test variable (dependent) can be nominal, dichotomous, ordinal, or grouped interval.

SW318 Social Work Statistics Slide 3

Independence Defined

Two variables are independent if, for all cases, the classification of a case into a particular category of one variable (the group variable) has no effect on the probability that the case will fall into any particular category of the second variable (the test variable). When two variables are independent, there is no relationship between them. We would expect that the frequency breakdowns of the test variable to be similar for all groups.

SW318 Social Work Statistics Slide 4

Independence Demonstrated

Suppose we are interested in the relationship between gender and attending college. If there is no relationship between gender and attending college and 40% of our total sample attend college, we would expect 40% of the males in our sample to attend college and 40% of the females to attend college.

If there is a relationship between gender and attending college, we would expect a higher proportion of one group to attend college than the other group, e.g. 60% to 20%.

the dependent relationship is indicated by one group having a higher proportion than the proportion for the total sample.SW318 Social Work Statistics Slide 5 Displaying Independent and Dependent Relationships When the variables are independent. Independent Relationship betw een Gender and College Dependent Relationship betw een Gender and College Poportion Attending College 100% 80% 60% 40% 40% 20% 0% Males Females Total 40% 40% Poportion Attending College 100% 80% 60% 60% 40% 40% 20% 20% 0% Males Females Total . the proportion in both groups is close to the same size as the proportion for the total sample. When group membership makes a difference.

 .e. i.  Since the proportion of subjects in each category of the group variable can differ. we take group category into account in computing expected frequencies as well.SW318 Social Work Statistics Slide 6 Expected Frequencies  Expected frequencies are computed as if there is no difference between the groups. To summarize. the expected frequencies for each cell are computed to be proportional to both the breakdown for the test variable and the breakdown for the group variable. both groups have the same proportion as the total sample in each category of the test variable.

SW318 Social Work Statistics Slide 7 Expected Frequency Calculation The data from “Observed Frequencies for Sample Data” is the source for information to compute the expected frequencies. These percentages are then multiplied by the total number of students in the sample (453) to compute the expected frequency for each cell in the table. Percentages are computed for the column of all students and for the row of all GPA’s. .

Probabilities for the test statistic can be obtained from the chi-square probability distribution so that we can test hypotheses.  .SW318 Social Work Statistics Slide 8 Expected Frequencies versus Observed Frequencies  The chi-square test of independence plugs the observed frequencies and expected frequencies into a formula which computes how the pattern of observed frequencies differs from the pattern of expected frequencies.

SW318 Social Work Statistics Slide 9 Independent and Dependent Variables  The two variables in a chi-square test of independence each play a specific role. .  The group variable is also known as the independent variable because it has an influence on the test variable.   The chi-square test of independence is a test of the influence or impact that a subject’s value on one variable has on the same subject’s value for a second variable. The test variable is also known as the dependent variable because its value is believed to be dependent on the value of the group variable.

It is most useful for nominal variables for which we do not another option. Assumptions for the Chi-square Test  The chi-square Test of Independence can be used for any level variable.  Assumptions: No cell has an expected frequency less than 5.  .SW318 Social Work Statistics Slide 10 Step 1. the chi-square distribution will give us misleading probabilities. If these assumptions are violated. including interval level variables grouped in a frequency distribution.

The value to use will be stated in the problem.SW318 Social Work Statistics Slide 11 Step 2. which will be either 0. This will be true if the observed counts for the categories of the variables in the sample are different from the expected counts. Hypotheses and alpha  The research hypothesis states that the two variables are dependent or related.05 or 0.  .  The null hypothesis is that the two variables are independent.01. The amount of difference needed to make a decision about difference or similarity is the amount corresponding to the alpha level of significance. This will be true if the observed counts in the sample are similar to the expected counts.

 If we were calculating the statistic by hand. Sampling distribution and test statistic  To test the relationship.SW318 Social Work Statistics Slide 12 Step 3. we would have to compute the degrees of freedom to identify the probability of the test statistic. SPSS will print out the degrees of freedom and the probability of the test statistics for us. which follows the chisquare distribution. . we use the chisquare test statistic.

We identify the value and probability for this test statistic from the SPSS statistical output.  .SW318 Social Work Statistics Slide 13 Step 4. the chi-square test of independence statistic is computed by summing the difference between the expected and observed frequencies for each cell in the table divided by the expected frequencies for the cell. Computing the Test Statistic  Conceptually.

i.SW318 Social Work Statistics Slide 14 Step 5. If the probability of the test statistic is greater than the probability of the alpha error rate.  . We conclude that there is no relationship between the variables. they are independent. We conclude that there is a relationship between the variables. we reject the null hypothesis and conclude that our data supports the research hypothesis.e. Decision and Interpretation  If the probability of the test statistic is less than or equal to the probability of the alpha error rate. we fail to reject the null hypothesis.

The residual. between the observed frequency and the expected frequency is a more reliable indicator. especially if the residual is converted to a z-score and compared to a critical value equivalent to the alpha for the problem.SW318 Social Work Statistics Slide 15 Which Cell or Cells Caused the Difference  We are only concerned with this procedure if the result of the chi-square test was statistically significant. or the difference.   . One of the problems in interpreting chi-square tests is the determination of which cell or cells produced the statistically significant difference. Examination of percentages in the contingency table and expected frequency table can be misleading.

It does not produce the probability or significance. 2. There can be 0.   . This is equivalent to testing the null hypothesis that the actual frequency equals the expected frequency for a specific cell versus the research hypothesis of a difference greater than zero. The problems will tell you which value to use. we will compare the size of the standardized residuals to the critical values that correspond to an alpha of 0.96) or an alpha of 0.SW318 Social Work Statistics Slide 16 Standardized Residuals  SPSS prints out the standardized residual (converted to a z-score) computed for each cell. or more cells with statistically significant standardized residuals to be interpreted.58).05 (+/-1. Without a probability.01 (+/-2. 1.

e.e. compared to the expected frequency. compared to the expected frequency. there were more subjects in this category than we expected. i.  . i. there were fewer subjects in this category than we expected.SW318 Social Work Statistics Slide 17 Interpreting Standardized Residuals  Standardized residuals that have a positive value mean that the cell was over-represented in the actual sample. Standardized residuals that have a negative value mean that the cell was under-represented in the actual sample.

1 A chi-square test of independence of the relationship between sex and marital status finds a statistically significant relationship between the variables.SW318 Social Work Statistics Slide 18 Interpreting Cell Differences in a Chi-square Test . .

SW318 Social Work Statistics Slide 19 Interpreting Cell Differences in a Chi-square Test .9%-42.2% on the married row (50. we would identify cells on the married row and the widowed row as the ones producing the significant result because they show the largest differences: 8.7%) and 9.2 Researcher often try to identify try to identify which cell or cells are the major contributors to the significant chi-square test by examining the pattern of column percentages.1%) .1%-4.0% on the widowed row (13. Based on the column percentages.

SW318 Social Work Statistics Slide 20 Interpreting Cell Differences in a Chi-square Test .96 and +1.96.3 Using a level of significance of 0. If we interpreted the contribution of the married marital status. Using standardized residuals. we would find that only the cells on the widowed row are the significant contributors to the chi-square relationship between sex and marital status.05. . we would be mistaken. Basing the interpretation on column percentages can be misleading. the critical value for a standardized residual would be -1.

so the level of measurement requirements are satisfied. nominal. to do a post hoc test using 1. . First of all. the level of measurement for the independent and the dependent variable can be any level that defines groups (dichotomous. “degree of religious fundamentalism" [fund] is ordinal and "sex" [sex] is dichotomous.SW318 Social Work Statistics Slide 21 Chi-Square Test of Independence: post hoc practice problem 1 This question asks you to use a chi-square test of independence and. or grouped interval).96 of the critical value. ordinal. if significant.

SW318 Social Work Statistics Slide 22 Chi-Square Test of Independence: post hoc test in SPSS (1) You can conduct a chi-square test of independence in crosstabulation of SPSS by selecting: Analyze > Descriptive Statistics > Crosstabs… .

. The variable mentioned first in the problem. is used as the dependent variable and is moved to the “Row(s)” list box. select and move the variables for the question to “Row(s):” and “Column(s):” list boxes. [fund]. sex.SW318 Social Work Statistics Slide 23 Chi-Square Test of Independence: post hoc test in SPSS (2) First. click on “Statistics…” button to request the test statistic. is used as the independent variable and is moved to the “Column(s):” list box. The variable mentioned second in the problem. Second.

SW318 Social Work Statistics Slide 24 Chi-Square Test of Independence: post hoc test in SPSS (3) First. click on “Chi-square” to request the chi-square test of independence. Second. click on “Continue” button to close the Statistics dialog box. .

.SW318 Social Work Statistics Slide 25 Chi-Square Test of Independence: post hoc test in SPSS (4) Now click on “Cells…” button to specify the contents in the cells of the crosstabs table.

SW318 Social Work Statistics Slide 26 Chi-Square Test of Independence: post hoc test in SPSS (5) First. . select “Unstandardized” and “Standardized” residuals and click on “Continue” and “OK” buttons. make sure both “Observed” and “Expected” in the “Counts” section in “Crosstabs: Cell Display” dialog box are checked. In the “Residuals” section.

.SW318 Social Work Statistics Slide 27 Chi-Square Test of Independence: post hoc test in SPSS (6) In the table Chi-Square Tests result. SPSS also tells us that “0 cells have expected count less than 5 and the minimum expected count is 70. The sample size requirement for the chi-square test of independence is satisfied.63”.

We do not interpret cell differences unless the chi-square test statistic supports the research hypothesis. greater than the alpha level of significance of 0.SW318 Social Work Statistics Slide 28 Chi-Square Test of Independence: post hoc test in SPSS (7) The probability of the chi-square test statistic (chi-square=2. Thus.244. . The research hypothesis that differences in "degree of religious fundamentalism" are related to differences in "sex" is not supported by this analysis. the answer for this question is False.05. The null hypothesis that differences in "degree of religious fundamentalism" are independent of differences in "sex" is not rejected.821) was p=0.

or grouped interval). to do a post hoc test using -1. . First of all. the level of measurement for the independent and the dependent variable can be any level that defines groups (dichotomous.96 of the critical value. nominal.SW318 Social Work Statistics Slide 29 Chi-Square Test of Independence: post hoc practice problem 2 This question asks you to use a chi-square test of independence and. so the level of measurement requirements are satisfied. if significant. ordinal. [empathy3] is ordinal and [sex] is dichotomous.

SW318 Social Work Statistics Slide 30 Chi-Square Test of Independence: post hoc test in SPSS (8) You can conduct a chi-square test of independence in crosstabulation of SPSS by selecting: Analyze > Descriptive Statistics > Crosstabs… .

[empathy3]. . click on “Statistics…” button to request the test statistic. select and move the variables for the question to “Row(s):” and “Column(s):” list boxes. is used as the dependent variable and is moved to the “Row(s)” list box. is used as the independent variable and is moved to the “Column(s):” list box. The variable mentioned first in the problem.SW318 Social Work Statistics Slide 31 Chi-Square Test of Independence: post hoc test in SPSS (9) First. The variable mentioned second in the problem. [sex]. Second.

SW318 Social Work Statistics Slide 32 Chi-Square Test of Independence: post hoc test in SPSS (10) First. . click on “Continue” button to close the Statistics dialog box. Second. click on “Chi-square” to request the chi-square test of independence.

.SW318 Social Work Statistics Slide 33 Chi-Square Test of Independence: post hoc test in SPSS (11) Now click on “Cells…” button to specify the contents in the cells of the crosstabs table.

SW318 Social Work Statistics Slide 34 Chi-Square Test of Independence: post hoc test in SPSS (12) First. select “Unstandardized” and “Standardized” residuals and click on “Continue” and “OK” buttons. . In the “Residuals” section. make sure both “Observed” and “Expected” in the “Counts” section in “Crosstabs: Cell Display” dialog box are checked.

. SPSS also tells us that “0 cells have expected count less than 5 and the minimum expected count is 6. The sample size requirement for the chi-square test of independence is satisfied.SW318 Social Work Statistics Slide 35 Chi-Square Test of Independence: post hoc test in SPSS (13) In the table Chi-Square Tests result.79”.

083) was p<0.05. . The null hypothesis that differences in "accuracy of the description of feeling protective toward people being taken advantage of" are independent of differences in "sex" is rejected. Now. less than or equal to the alpha level of significance of 0. you can examine the post hoc test using the given critical value.SW318 Social Work Statistics Slide 36 Chi-Square Test of Independence: post hoc test in SPSS (14) The probability of the chi-square test statistic (chi-square=23. The research hypothesis that differences in "accuracy of the description of feeling protective toward people being taken advantage of" are related to differences in "sex" is supported by this analysis.001.

The answer to the question is true. there were fewer who said that feeling protective toward people being taken advantage of describes them very well than would be expected. . When converted to a z-score.2=-21. the standardized residual (-2. supporting a specific finding that among survey respondents who were male.4) was smaller than the critical value (1.96).SW318 Social Work Statistics Slide 37 Chi-Square Test of Independence: post hoc test in SPSS (15) The residual is the difference between the actual frequency and the expected frequency (5879.2).

or grouped interval? No Incorrect application of a statistic Yes . ordinal.SW318 Social Work Statistics Slide 38 Steps in solving chi-square test of independence: post hoc problems .1 The following is a guide to the decision process for answering homework problems about chi-square test of independence post hoc problems: Is the dependent and independent variable nominal. dichotomous.

2 Compute the Chi-Square test of independence.SW318 Social Work Statistics Slide 39 Steps in solving chi-square test of independence: post hoc problems . requesting standardized residuals in the output Yes Expected cell counts less than 5? Incorrect application of a statistic No Is the p-value for the chisquare test of independence <= alpha? No False Yes .

SW318 Social Work Statistics Slide 40 Steps in solving chi-square test of independence: post hoc problems .3 Identify the cell in the crosstabs table that contains the specific relationship in the problem Is the value of the standardized residual for the specified cell larger (smaller) than the postive (negative) critical value given in the problem? No False Yes No Is the relationship correctly described? Yes False True .