Presentation is loading. Please wait.

Presentation is loading. Please wait.

Statistics: Unlocking the Power of Data Lock 5 STAT 250 Dr. Kari Lock Morgan SECTION 7.2 χ 2 test for association (7.2) Testing for an Association between.

Similar presentations


Presentation on theme: "Statistics: Unlocking the Power of Data Lock 5 STAT 250 Dr. Kari Lock Morgan SECTION 7.2 χ 2 test for association (7.2) Testing for an Association between."— Presentation transcript:

1 Statistics: Unlocking the Power of Data Lock 5 STAT 250 Dr. Kari Lock Morgan SECTION 7.2 χ 2 test for association (7.2) Testing for an Association between two Categorical Variables

2 Statistics: Unlocking the Power of Data Lock 5 Question of the Day Is use of painkillers during pregnancy associated with miscarriage?

3 Statistics: Unlocking the Power of Data Lock 5 Painkillers and Miscarriage Scientists interviewed 1009 women soon after they got a positive pregnancy test about their use of painkillers around the time of conception or the early weeks of pregnancy The researchers then kept track of which of the pregnancies ended in miscarriage Two categorical variables Li, D-K., et. al. (2003). “Exposure to non-steroidal anti-inflammatory drugs during pregnancy and risk of miscarriage: population based cohort study,” British Medical Journal, 327(7411): 1.Exposure to non-steroidal anti-inflammatory drugs during pregnancy and risk of miscarriage: population based cohort study

4 Statistics: Unlocking the Power of Data Lock 5 Painkillers and Miscarriage MiscarriageNo MiscarriageTOTAL No painkiller103659762 Aspirin51722 Ibuprofen134053 Acetaminophen24148172 TOTAL1458641009 Does this data provide evidence that these two variables are associated?

5 Statistics: Unlocking the Power of Data Lock 5 Two Categorical Variables The statistics behind a χ 2 test easily extends to two categorical variables A χ 2 test for association (often called a χ 2 test for independence) tests for an association between two categorical variables Everything is the same as a chi-square goodness-of-fit test, except: The hypotheses The expected counts Degrees of freedom for the χ 2 -distribution

6 Statistics: Unlocking the Power of Data Lock 5 Hypotheses General hypotheses: H 0 : The two variables are not associated H a : The two variables are associated Painkillers and miscarriage: H 0 : Type of painkiller taken is not associated with whether or not pregnancy ends in miscarriage H a : Type of painkiller taken is associated with whether or not pregnancy ends in miscarriage

7 Statistics: Unlocking the Power of Data Lock 5 Expected Counts MiscarriageNo MiscarriageTOTAL No painkiller762 Aspirin22 Ibuprofen53 Acetaminophen172 TOTAL1458641009

8 Statistics: Unlocking the Power of Data Lock 5 Expected Count Give the expected count for Aspirin, Miscarriage. a) 2.1 b) 3.16 c) 4.72 d) 5.65 MiscarriageNo MiscarriageTOTAL No painkiller762 Aspirin22 Ibuprofen53 Acetaminophen172 TOTAL1458641009

9 Statistics: Unlocking the Power of Data Lock 5 Chi-Square Statistic Observed (expected) MiscarriageNo MiscarriageTOTAL No painkiller103 (109.5)659 (652.5)762 Aspirin5 ( )17 (18.8)22 Ibuprofen13 (7.6)40 (45.4)53 Acetaminophen24 (24.7)148 (147.3)172 TOTAL1458641009

10 Statistics: Unlocking the Power of Data Lock 5 Chi-Square Statistic Give the contribution to the χ 2 statistic for the Aspirin, Miscarriage category. a) 0.7 b) 1.07 c) 1.7 d) 2.07 MiscarriageNo Miscarriage No painkiller103 (109.5)659 (652.5) Aspirin5 (3.16)17 (18.8) Ibuprofen13 (7.6)40 (45.4) Acetaminophen24 (24.7)148 (147.3)

11 Statistics: Unlocking the Power of Data Lock 5 StatKey χ 2 = 6.168

12 Statistics: Unlocking the Power of Data Lock 5 What Next? χ 2 = 6.168 What next? We need to compare this to a distribution of statistics we would get, if the null were true

13 Statistics: Unlocking the Power of Data Lock 5 Randomization Distribution

14 Statistics: Unlocking the Power of Data Lock 5 Conclusion Can we conclude that type of painkiller taken is associated with having a miscarriage? a) Yes b) No

15 Statistics: Unlocking the Power of Data Lock 5 Conclusion Can we conclude that type of painkiller taken is not associated with having a miscarriage? a) Yes b) No

16 Statistics: Unlocking the Power of Data Lock 5 Chi-Square (χ 2 ) Distribution If each of the expected counts are at least 5, AND if the null hypothesis is true, then the χ 2 statistic follows a χ 2 –distribution, with degrees of freedom equal to df = (number of rows – 1)(number of columns – 1) Painkillers and Miscarriage: df = (4 – 1)(2 – 1) = 3

17 Statistics: Unlocking the Power of Data Lock 5 Theoretical Distribution Can we also use the theoretical χ 2 distribution to get the p-value? a) Yes b) No MiscarriageNo Miscarriage No painkiller103 (109.5)659 (652.5) Aspirin5 (3.16)17 (18.8) Ibuprofen13 (7.6)40 (45.4) Acetaminophen24 (24.7)148 (147.3)

18 Statistics: Unlocking the Power of Data Lock 5 NSAIDs? NSAIDs (Nonsteroidal anti-inflammatory drugs) are a special class of painkillers that include aspirin and ibuprofen (but not acetaminophen) Headline coming out of this paper:Use of NSAIDs in pregnancy increases risk of miscarriageUse of NSAIDs in pregnancy increases risk of miscarriage Is taking NSAIDs or not associated with miscarriage?

19 Statistics: Unlocking the Power of Data Lock 5 NSAIDs and Miscarriage MiscarriageNo MiscarriageTOTAL No painkiller103659762 Aspirin51722 Ibuprofen134053 Acetaminophen24148172 TOTAL1458641009 MiscarriageNo MiscarriageTOTAL No NSAIDs127807934 NSAIDs185775 TOTAL1458641009

20 Statistics: Unlocking the Power of Data Lock 5 NSAIDs and Miscarriage How should we analyze this data? a) Test for difference in proportions using a randomization test b) Test for a difference in proportions using the z- statistic and normal distribution c) Chi-Square Test for Association d) Any of the above e) None of the above MiscarriageNo MiscarriageTOTAL No NSAIDs127807934 NSAIDs185775 TOTAL1458641009

21 Statistics: Unlocking the Power of Data Lock 5 Two Categorical Variables with Two Categories

22 Statistics: Unlocking the Power of Data Lock 5 Hypotheses H 0 : taking NSAIDs around the time of conception or early in pregnancy is not associated with having a miscarriage H a : taking NSAIDs around the time of conception or early in pregnancy is associated with having a miscarriage

23 Statistics: Unlocking the Power of Data Lock 5 StatKey

24 Statistics: Unlocking the Power of Data Lock 5 Conclusion Can we conclude that taking NSAIDs around the time of conception or in early pregnancy is associated with having a miscarriage? a) Yes b) No

25 Statistics: Unlocking the Power of Data Lock 5 Conclusion Can we conclude that taking NSAIDs around the time of conception or in early pregnancy causes increased risk of miscarriage? a) Yes b) No

26 Statistics: Unlocking the Power of Data Lock 5 That’s Not All! A much more recent study (March 2014) reexamined this issue. Daniel, S. et. al. (2014). Fetal Exposure to nonsteroidal anti-inflammatory drugs and spontaneous abortions, Canadian Medical Association Journal, 186(5).Fetal Exposure to nonsteroidal anti-inflammatory drugs and spontaneous abortions

27 Statistics: Unlocking the Power of Data Lock 5 NSAIDs and Miscarriage

28 Statistics: Unlocking the Power of Data Lock 5 NSAIDs and Miscarriage

29 Statistics: Unlocking the Power of Data Lock 5 Results

30 Statistics: Unlocking the Power of Data Lock 5 Results

31 Statistics: Unlocking the Power of Data Lock 5 ??? The first study found a significant association between NSAIDs and miscarriage, with those taking NSAIDS having significantly higher risk of miscarriage The second study found a significant association between NSAIDs and miscarriage, with those taking NSAIDS having a significantly lower risk of miscarriage WHAT’S GOING ON????

32 Statistics: Unlocking the Power of Data Lock 5

33 To Do Read Section 7.2 Do HW 7.2 (due Friday, 11/20)


Download ppt "Statistics: Unlocking the Power of Data Lock 5 STAT 250 Dr. Kari Lock Morgan SECTION 7.2 χ 2 test for association (7.2) Testing for an Association between."

Similar presentations


Ads by Google