240 likes | 336 Views
Chapter 19. Chi-Square ( χ 2 ) Test for Qualitative (Nominal) Data. Chi-Square ( χ 2 ). Uses categorical data Example: blood type; A, B, O, AB Designed to compare observed frequencies with hypothesized or expected frequencies. Observed frequency – the actual sampling frequency
E N D
Chapter 19 Chi-Square (χ2) Test for Qualitative (Nominal) Data
Chi-Square (χ2) • Uses categorical data • Example: blood type; A, B, O, AB • Designed to compare observed frequencies with hypothesized or expected frequencies. • Observed frequency – the actual sampling frequency • Expected frequency – the predicted frequency given the null hypothesis is true.
Hypotheses • H0: Probability of categories = expected or predicted proportion • H1: H0 is false
χ2 Ratio (fo – fe)2 • χ2 = Σ fe
χ2 Calculation Expected numbers based on known proportion of blood types times the sample size (100).
χ2 Calculation Expected numbers based on known proportion of blood types times the sample size (100).
χ2 Calculation Expected numbers based on known proportion of blood types times the sample size (100).
χ2 Calculation Expected numbers based on known proportion of blood types times the sample size (100).
χ2 Calculation Expected numbers based on known proportion of blood types times the sample size (100).
χ2 Calculation Expected numbers based on known proportion of blood types times the sample size (100).
χ2 Calculation • The sum of each observed minus expected cell squared divided by expected. (38-44)2(38-41)2(20-10)2(4-5) 2 = 44 + 41 + 10 + 5 (-6)2(-3)2(10)2(-1) 2 = 44 + 41 + 10 + 5 3691001 = 44 + 41 + 10 + 5
χ2 Calculation = .82 + .22 + 10.00 + .20 = 11.24 Degrees of freedom for χ2 test df = c – 1, where c is the number of categories
χ2 Interpretation • Look up in Table D (Appendix C) page 537 • If the calculated value is greater than or equal to the table value, then reject the null hypothesis.
χ2 With two variables • This is a test of independence. • That is, the two qualitative variables are tested to be independent of each other. • If they are not independent, then the null hypothesis is false, and we accept the alternate hypothesis.
χ2 With two variables • Expected frequencies are calculated from the marginal totals. • We use the data to estimate the expected frequencies.
Expected frequencies • Must calculate expected from the proportions in the observed data. • Fe = (column total)(row total) grand total
χ2 Calculation • The sum of each observed minus expected cell squared divided by expected. (41-36)2(19-24)2(32-42)2(38-28) 2(47-42)2(23-28)2 = 41 + 24 + 42 + 28 + 42 + 28 (5)2(-5)2(-10)2(10) 2(5)2(-5) 2 = 41 + 24 + 42 + 28 + 42 + 28 25251001002525 = 41 + 24 + 42 + 28 + 42 + 28
χ2 Calculation = .61 + 1.04 + 2.38 + 3.57 + .60 + .89 = 9.09 Degrees of freedom for χ2 test with two variables df = (c – 1)(r – 1), where c is the number of categories, and r is the number of rows df = (3 – 1)(2 – 1) = (2)(1) = 2 The table value at the .05 level of significance = 5.99
χ2 Calculation Since the calculated value of 9.09 exceeds the table value of 5.99 We reject the H0 and accept the H1 that there is a significant difference between the observed and expected values. Interpretation: The location does make a difference is social responsibility when returning self-addressed stamped letters in this community.
Estimating Effect Size • If the χ2 is significant then you must calculate the effect size. • Squared Cramer’s phi coefficient • Φ2c roughly estimates the proportion of explained variance (or predictability) between two qualitative variables. χ2 • Φ2c = n(k – 1) • Where n=sample size, k = the smaller of either rows or columns.