Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Chi-Square Test Used when both outcome and exposure variables are binary (dichotomous) or even multichotomous Allows the researcher to calculate a.

Similar presentations


Presentation on theme: "The Chi-Square Test Used when both outcome and exposure variables are binary (dichotomous) or even multichotomous Allows the researcher to calculate a."— Presentation transcript:

1 The Chi-Square Test Used when both outcome and exposure variables are binary (dichotomous) or even multichotomous Allows the researcher to calculate a p-value associated with relative risks (RR) and odds ratio (OR) Simplest for is a 2 x 2 contingency table Obtain a set of expected values and compare observed to expected

2 How does chi-square work? Compares the observed 2 x 2 table to a theoretical table (“expected”) that would occur if the null hypothesis (H 0 ) were true DiseasedNot diseased ExposedO 11 O 12 Not exposedO 21 O 22 DiseasedNot diseased ExposedE 11 E 12 Not exposedE 21 E 22 ? ObservedExpected under H 0

3 Calculating the “expected” table DiseasedNot diseased ExposedO 11 O 12 Not exposedO 21 O 22 O 11 + O 12 = R 1 O 21 + O 22 = R 2 O 12 + O 22 = C 2 O 11 + O 21 = C 1 Σ O i = N Start with observed table DiseasedNot diseased ExposedE 11 = R 1 C 1 /NE 12 = R 1 C 2 /N Not exposedE 21 = R 2 C 1 /NE 22 = R 2 C 2 /N Calculate the expected table

4 Chi-square test from breast cancer study Set alpha value: let’s use 0.05 State H 0 and H A. H 0 : There is no association between race and breast cancer status. (The proportion of Whites is the same in cases and controls) p cases = p controls where p = proportion white

5 Null and alternate hypotheses Null hypothesis (H 0 ): There is no association between race and breast cancer status. (The proportion of Whites is the same in cases and controls.) p cases = p controls Alternate hypothesis (H A ): There is an association between race and breast cancer status. (The proportion of Whites is the different in cases and controls.) p cases ≠ p controls

6 Calculating expected table CasesControls White677905 Black272619 Start with observed table Calculate the expected table 1582 CasesControls White1582*949/2473 = 607.11582*1524/2473 = 974.9 Black891*949/2473 = 341.9891*1524/2473 = 549.1 891 1524949 2473

7 Calculate chi-square statistic CasesControls White677905 Black272619 CasesControls White607.1974.9 Black341.9549.1 χ 2 = (677-607.1) 2 /607.1 + (905-974.9) 2 /974.9 + (272-341.9) 2 /341.9 + (619-549.1) 2 /549.1 χ 2 = 36.2 ( O 11 – E 11 ) 2 / E 11

8 Chi-square distributions Test statistic = 36.2 Compare to a known χ 2 distribution to get p- value Need to know degrees of freedom = (rows – 1)*(columns – 1) In this case, d.f. = (2 – 1)(2 – 1) = 1*1 = 1 Chi-square value Probability 2 4 Critical value for 1 d.f. = 3.84 (where alpha = 0.05) Rejection region for H 0 Our chi square statistic = 36.2

9 Chi-square table and interpretation Examine the list of values and associated p-values from column with 1 degree of freedom For an observed χ 2 of 36.2, the associated p-value is < 0.001. Since p < α, we reject H 0 and conclude that there is an association between race and outcome (case/control) status.

10 Chi-square caveat #1 What about tables that are larger than 2x2? If there is a statistically significant association (i.e. p < α), we don’t know among which group(s) the association(s) occur(s). Need to conduct individual 2 x 2 χ 2 analyses to determine if/where the association(s) exist. (…which is < α)

11 What about very small sample sizes? Answer: Chi-square is not an appropriate test if 20% or more of the cells (i.e. 1 or more cells in a 2x2 table) have expected counts of less than 5. Solution: Use Fisher’s exact test Based on permutations, not on a theorized distribution Chi-square caveat #2


Download ppt "The Chi-Square Test Used when both outcome and exposure variables are binary (dichotomous) or even multichotomous Allows the researcher to calculate a."

Similar presentations


Ads by Google