1 Chi-square (χ2) PSY 211 4-15-08 LAST STATISTIC OF THE SEMESTER! NEXT TIME: FOOD DAY, REVIEW, WRAP-UP A. Introduction 1. Parametric tests: Use at least one numeric rating, so scores can be placed in a frequency distribution that usually has a normal shape Correlation/Regression: Continuous variables only t-test/ANOVA: One categorical variable, one continuous variable 2. Non-parametric tests: Do not use numerical values, scores cannot be placed on a frequency distribution (also sometimes used for numeric variables that have non-normal distributions) Chi-square (χ2): Categorical variables only Pronunciation note: Chi is pronounced “khi” (from Greece), not “chai” (India), not “chee” (China) B. Two Types of χ2 χ2 Test for Goodness of Fit o Involves a single categorical variable only χ2 Test for Independence o Involves 2(+) categorical variables 2 C. χ2 Test for Goodness of Fit Generally just involves one categorical variable Null hypothesis specifies the proportion of the population in each category Determines how well sample data conform to proportions set forth by the null hypothesis Test statistic (χ2) examines whether the proportions in the sample reliably differ from the null hypothesis Examples: Use logic or past research to guide the null hypothesis H0 for Gender: Female Male 50% 50% H0 for Negative Childhood Emotion: Shame Anger Anxiety Sadness 25% 25% 25% 25% Often an equal percentage (proportion) is chosen for each group 3 Alternatively, null hypothesis could be based on known proportions in a larger population Examples: H0 for Ethnicity: White non-White 75% 25% H0 for Vegetarianism: No Yes 97% 3% H0 for Religious Affiliation: Christianity Non-religious / Don’t care Agnosticism Atheism Other 84% 10% 2% 1% 3% χ2 used to examine whether the proportions in a sample reliably differ from those hypothesized Like F… χ2 ranges from 0 to ∞ Is small when the null hypothesis is likely true. Is large when the null hypothesis is rejected. 4 H0 for Gender: Female Male 50% 50% N = 279 Proportion Female = 50% = .50 Hypothesized frequency Female = .50 * 279 = 139.5 Proportion Male = 50% = .50 Hypothesized frequency Male = .50 * 279 = 139.5 Chi-Square Test Frequencies 15. Gender Female Male Total Observed N 213 66 279 Expected N 139.5 139.5 Residual 73.5 -73.5 Te st Statistics Chi-Squarea df As ymp. Sig. 15. Gender 77.452 1 .000 a. 0 c ells (.0% ) have expected frequencies les s than 5. The minimum ex pec ted cell frequenc y is 139.5. The Observed N indicates the actual frequency in each group The Expected N indicates the frequency that is hypothesized, based on the null hypothesis. The Residual just indicates the Observed frequency minus the Expected frequency The Test Statistics box indicates that the χ2 value is 44.17, the degrees of freedom (df) are 1, and p < .001. The chi-square test for goodness of fit was significant, χ2(1, N = 279) = 77.45, p < .001. The sample included an unexpectedly high number of females. 5 Last Semester… Chi-Square Test Frequencies 2. Gender Female Male Total Observed N 223 103 326 Expected N 163.0 163.0 Residual 60.0 -60.0 Te st Statistics Chi-Squarea df As ymp. Sig. 2. Gender 44.172 1 .000 a. 0 c ells (.0% ) have expected frequencies les s than 5. The minimum ex pec ted cell frequenc y is 163.0. The chi-square test for goodness of fit was significant, χ2(1, N = 326) = 44.17, p < .001. The sample included an unexpectedly high number of females. 6 H0 for Religious Affiliation: Christianity Non-religious / Don’t care Agnosticism Atheism Other 84% 10% 2% 1% 3% N = 279 Hypothesized frequency Christian = .84 * 279 = 234.4 ……… Hypothesized frequency Other = .03 * 279 = 8.4 Chi-Square Test Frequencies 31. Worldview or Rel igion Christianity Agnos ticis m At heis m Don't Know / Don't Care Ot her Total Observed N 204 27 10 35 3 279 Ex pec ted N 234.4 27.9 5.6 2.8 8.4 Residual -30.4 -.9 4.4 32.2 -5. 4 Test Statistics Chi-Square a df As ymp. Sig. 31. Worldview or Religion 382.767 4 .000 a. 1 cells (20.0%) have expected frequencies less than 5. The minimum expected cell frequency is 2.8. The chi-square test for goodness of fit was significant, χ2(4, N = 279) = 382.77, p < .001. There were fewer Christians than expected and more people who were apathetic. 7 Last Semester… Chi-Square Test Frequencies 23. Re ligi on Non-religious Christianity Agnos ticis m At heis m Ot her Total Observed N 42 231 19 16 18 326 Ex pec ted N 32.6 273.8 6.5 3.3 9.8 Residual 9.4 -42.8 12.5 12.7 8.2 Expected frequencies based on the expected proportions identified previously. For example, for Christianity .84 x 326 = 273.84. Te st Statistics Chi-Squarea df As ymp. Sig. 23. Religion 89.997 4 .000 a. 1 c ells (20. 0%) have ex pect ed frequencies less than 5. The minimum ex pect ed c ell frequency is 3.3. The chi-square test for goodness of fit was significant, χ2(4, N = 326) = 90.00, p < .001. There were fewer Christians than expected and more people than expected in every other religious group. 8 H0 for Yearly Physical: No Yes 50% 50% Chi-Square Test Frequencies 2. Yearly Physical No Yes Total Observed N 143 136 279 Expected N 139.5 139.5 Residual 3.5 -3.5 Test Statistics Chi-Square a df As ymp. Sig. 2. Yearly Physical .176 1 .675 a. 0 cells (.0%) have expected frequencies less than 5. The minimum expected cell frequency is 139.5. The chi-square test for goodness of fit was not significant, χ2(1, N = 279) = 0.18, p = .68. There was about an equal number of people getting yearly physicals as those who were not. 9 D. χ2 Test for Independence Examines the relationship between two (or more) categorical variables to determine if they are independent Two variables are said to be independent if there is no relationship between them Two variables are said to be dependent if there is a relationship between them Similar to the correlation coefficient, except that instead of both variables being continuous, both variables are categorical o Can’t correlate Academic Major with Favorite Barnyard Animal, but you can do a chi-square! Null hypothesis: no relationship Alternative hypothesis: some relationship 10 Examples: Does Gender related to Beliefs about Human Origins? 15. Ge nde r * 18. Belie f about Hum an Origins Crossta bula tion 15. Gender Female Male Total Count Ex pec ted Count Count Ex pec ted Count Count Ex pec ted Count 18. Belief about Human Origins Religious Evolutionary Texts Theory 124 89 117.6 95.4 30 36 36.4 29.6 154 125 154.0 125.0 Total 213 213.0 66 66.0 279 279.0 Chi-Square Tests Pearson Chi-Square Continuity Correction a Likelihood Ratio Fis her's Exact Test Linear-by-Linear As sociation N of Valid Cases Value 3.318b 2.822 3.304 3.306 df 1 1 1 1 As ymp. Sig. (2-sided) .069 .093 .069 Exact Sig. (2-sided) Exact Sig. (1-sided) .089 .047 .069 279 a. Computed only for a 2x2 table b. 0 cells (.0%) have expected count less than 5. The minimum expected count is 29. 57. Observed frequencies compared to those that are expected, based on the null hypothesis Sample size Chi-square value, degrees of freedom, and p-value 11 Bar Chart 18. Belief about Human Origins 125 Religious Texts Evolutionary Theory Count 100 75 50 25 0 Female Male 15. Gender The chi-square test for independence was nonsignificant, χ2(1, N = 279) = 3.32, p = .07. Gender was not reliably related to beliefs about human origins. 12 Does being a parent impact one’s political views? 13. Parent * 20. Top Political Issue Crosstabulation 13. Parent No Yes Total Count Expected Count Count Expected Count Count Expected Count 20. Top Political Iss ue Economy Healthcare Foreign Policy 58 34 11 65.3 39.5 10.5 23 15 2 15.7 9.5 2.5 81 49 13 81.0 49.0 13.0 Education 76 68.5 9 16.5 85 85.0 Chi-Square Te sts Pearson Chi-Square Lik elihood Ratio Linear-by-Linear As soc iation N of Valid Cases Value 15.516 a 15.831 .080 4 4 As ymp. Sig. (2-sided) .004 .003 1 .777 df 279 a. 1 c ells (10.0%) have ex pec ted c ount les s than 5. The minimum expected count is 2.52. Other 46 41.1 5 9.9 51 51.0 Total 225 225.0 54 54.0 279 279.0 13 Bar Chart 20. Top Political Issue 80 Education Economy Healthcare Foreign Policy Other Count 60 40 20 0 No Yes 13. Parent The chi-square test for independence was significant, χ2(4, N = 279) = 15.52, p = .004. Non-parents were mainly concerned with education, whereas parents were mainly concerned with the economy. 14 Does ethnicity relate to musical preference? 11. White * 32. Favorite Music Crosstabulation 11. White No Yes Total Count Expected Count Count Expected Count Count Expected Count Country 2 6.0 62 58.0 64 64.0 32. Favorite Mus ic Rap, hip Rock hop, R&B 2 12 8.8 3.6 92 27 85.2 35.4 94 39 94.0 39.0 Chi-Square Te sts Pearson Chi-Square Lik elihood Ratio Linear-by-Linear As soc iation N of Valid Cases Value 30.695 a 26.787 9.472 3 3 As ymp. Sig. (2-sided) .000 .000 1 .002 df 279 a. 1 c ells (12.5%) have ex pec ted c ount les s than 5. The minimum expected count is 3.63. Other 10 7.6 72 74.4 82 82.0 Total 26 26.0 253 253.0 279 279.0 15 Bar Chart 32. Favorite Music 100 Country Rock Rap, hip hop, R&B Other Count 80 60 40 20 0 No Yes 11. White The chi-square test for independence was significant, χ2(3, N = 279) = 30.70, p < .001. Compared to other ethnic groups, white people were less likely to prefer rap, hip hop, and R&B. 16 Some Examples from Last Semester… Is Gender related to Vegetarianism? The sample is 68% female, so females are expected to make up 68% of the vegetarians and 68% of the nonvegetarians. 2. Gender * 10. Vegetarian Crosstabulation 2. Gender Female Male Total 10. Vegetarian No Yes 206 17 209.3 13.7 100 3 96.7 6.3 306 20 306.0 20.0 Count Expected Count Count Expected Count Count Expected Count Total 223 223.0 103 103.0 326 326.0 Chi-Square Tests Pearson Chi-Square Continuity Correction a Likelihood Ratio Fis her's Exact Test Linear-by-Linear As sociation N of Valid Cases Value 2.715b 1.959 3.081 2.707 df 1 1 1 1 As ymp. Sig. (2-sided) .099 .162 .079 Exact Sig. (2-sided) Exact Sig. (1-sided) .136 .076 .100 326 a. Computed only for a 2x2 table b. 0 cells (.0%) have expected count less than 5. The minimum expected count is 6. 32. Observed frequencies compared to those that are expected, based on the null hypothesis Sample size Chi-square value, degrees of freedom, and p-value The chi-square test for independence was nonsignificant, χ2(1, N = 326) = 2.72, ns. Gender was not reliably related to vegetarianism. 17 Does ethnicity relate to musical preference? 20. Ethnicity * 29. Music Crosstabulation 20. Ethnicity White NonWhite Total Count Expected Count Count Expected Count Count Expected Count 29. Mus ic Alterna Classic tive Rock 82 40 Rap 16 R&B 12 Hip Hop 25 16.1 13.4 25.1 85.1 2 3 3 1.9 1.6 18 18.0 Country 66 Other 51 Total 292 37.6 61.8 52.8 292.0 13 2 3 8 34 2.9 9.9 4.4 7.2 6.2 34.0 15 28 95 42 69 59 326 15.0 28.0 95.0 42.0 69.0 59.0 326.0 Chi-Square Te sts Pearson Chi-Square Lik elihood Ratio Linear-by-Linear As soc iation N of Valid Cases Value 7.354a 7.962 .853 6 6 As ymp. Sig. (2-sided) .289 .241 1 .356 df 326 a. 4 c ells (28.6%) have ex pec ted c ount les s than 5. The minimum expected count is 1.56. The chi-square test for independence was nonsignificant, χ2(6, N = 326) = 7.35, ns. Ethnicity was not reliably related to music preference. White people make up 90% of the sample, so they are expected to make up 90% of those who like rap, 90% of those who like R&B, etc. 18 Does being an athlete related to choice of hero? 4. Athlete * 22. Hero Crosstabulation 4. Athlete No Yes Total Count Expected Count Count Expected Count Count Expected Count 22. Hero Other Romantic Famous Teacher/ Mom Dad Sibling Relative Friend Partner Person Coach Other Total 58 20 9 17 10 8 3 3 20 148 53.6 27.7 8.6 18.2 10.9 4.5 3.6 6.4 41 10 23 14 2 5 11 64.4 33.3 10.4 21.8 13.1 5.5 4.4 7.6 61 19 40 24 10 8 14 118.0 61.0 19.0 40.0 24.0 10.0 8.0 14.0 60 118 Chi-Square Te sts Pearson Chi-Square Lik elihood Ratio Linear-by-Linear As soc iation N of Valid Cases Value 16.937 a 17.516 .671 8 8 As ymp. Sig. (2-sided) .031 .025 1 .413 df 326 a. 3 c ells (16.7%) have ex pec ted c ount les s than 5. The minimum expected count is 3.63. The chi-square test for independence was statistically significant, χ2(8, N = 326) = 16.94, p = .03. Specifically, athletes were more likely than expected to indicate that their dad was their hero. 14.5 148.0 12 178 17.5 178.0 32 326 32.0 326.0