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.

Slides:



Advertisements
Similar presentations
Chi-Square Tests 3/14/12 Testing the distribution of a single categorical variable :  2 goodness of fit Testing for an association between two categorical.
Advertisements

Statistics: Unlocking the Power of Data Lock 5 Testing Goodness-of- Fit for a Single Categorical Variable Kari Lock Morgan Section 7.1.
Chapter 12 Goodness-of-Fit Tests and Contingency Analysis
Chi-Squared Hypothesis Testing Using One-Way and Two-Way Frequency Tables of Categorical Variables.
Chapter 13: Inference for Distributions of Categorical Data
Copyright ©2011 Brooks/Cole, Cengage Learning More about Inference for Categorical Variables Chapter 15 1.
Copyright ©2006 Brooks/Cole, a division of Thomson Learning, Inc. More About Categorical Variables Chapter 15.
© 2010 Pearson Prentice Hall. All rights reserved The Chi-Square Test of Homogeneity.
© 2010 Pearson Prentice Hall. All rights reserved The Chi-Square Test of Independence.
CHI-SQUARE TEST OF INDEPENDENCE
Stat 512 – Lecture 12 Two sample comparisons (Ch. 7) Experiments revisited.
Chapter Goals After completing this chapter, you should be able to:
11-2 Goodness-of-Fit In this section, we consider sample data consisting of observed frequency counts arranged in a single row or column (called a one-way.
Statistics: Unlocking the Power of Data Lock 5 Inference for Proportions STAT 250 Dr. Kari Lock Morgan Chapter 6.1, 6.2, 6.3, 6.7, 6.8, 6.9 Formulas for.
Presentation 12 Chi-Square test.
Chapter 13 Chi-Square Tests. The chi-square test for Goodness of Fit allows us to determine whether a specified population distribution seems valid. The.
The table shows a random sample of 100 hikers and the area of hiking preferred. Are hiking area preference and gender independent? Hiking Preference Area.
Copyright © 2012 Pearson Education. All rights reserved Copyright © 2012 Pearson Education. All rights reserved. Chapter 15 Inference for Counts:
Copyright © 2013 Pearson Education, Inc. All rights reserved Chapter 10 Inferring Population Means.
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Inference on Categorical Data 12.
©2011 Brooks/Cole, Cengage Learning Elementary Statistics: Looking at the Big Picture 1 Lecture 33: Chapter 12, Section 2 Two Categorical Variables More.
For testing significance of patterns in qualitative data Test statistic is based on counts that represent the number of items that fall in each category.
Chi-square test or c2 test
Two Way Tables and the Chi-Square Test ● Here we study relationships between two categorical variables. – The data can be displayed in a two way table.
Chapter 26 Chi-Square Testing
Chi-Square Procedures Chi-Square Test for Goodness of Fit, Independence of Variables, and Homogeneity of Proportions.
Other Chi-Square Tests
Slide Slide 1 Section 8-6 Testing a Claim About a Standard Deviation or Variance.
FPP 28 Chi-square test. More types of inference for nominal variables Nominal data is categorical with more than two categories Compare observed frequencies.
13.2 Chi-Square Test for Homogeneity & Independence AP Statistics.
+ Chi Square Test Homogeneity or Independence( Association)
Testing for an Association between two Categorical Variables
BPS - 5th Ed. Chapter 221 Two Categorical Variables: The Chi-Square Test.
Statistical Significance for a two-way table Inference for a two-way table We often gather data and arrange them in a two-way table to see if two categorical.
AP Statistics Section 14.. The main objective of Chapter 14 is to test claims about qualitative data consisting of frequency counts for different categories.
Statistics: Unlocking the Power of Data Lock 5 Exam 2 Review STAT 101 Dr. Kari Lock Morgan 11/13/12 Review of Chapters 5-9.
© Copyright McGraw-Hill CHAPTER 11 Other Chi-Square Tests.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Statistics: Unlocking the Power of Data Lock 5 STAT 101 Dr. Kari Lock Morgan 10/30/12 Chi-Square Tests SECTIONS 7.1, 7.2 Testing the distribution of a.
Chapter 13 Inference for Counts: Chi-Square Tests © 2011 Pearson Education, Inc. 1 Business Statistics: A First Course.
Statistics: Unlocking the Power of Data Lock 5 Hypothesis Testing: Conclusions STAT 250 Dr. Kari Lock Morgan SECTION 4.3 Significance level (4.3) Statistical.
Chapter Outline Goodness of Fit test Test of Independence.
The table shows a random sample of 100 hikers and the area of hiking preferred. Are hiking area preference and gender independent? Hiking Preference Area.
Statistics: Unlocking the Power of Data Lock 5 STAT 250 Dr. Kari Lock Morgan SECTION 7.1 Testing the distribution of a single categorical variable : χ.
11.2 Tests Using Contingency Tables When data can be tabulated in table form in terms of frequencies, several types of hypotheses can be tested by using.
Section 12.2: Tests for Homogeneity and Independence in a Two-Way Table.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical.
Statistics: Unlocking the Power of Data Lock 5 Inference for Means STAT 250 Dr. Kari Lock Morgan Sections 6.4, 6.5, 6.6, 6.10, 6.11, 6.12, 6.13 t-distribution.
Chapter 13- Inference For Tables: Chi-square Procedures Section Test for goodness of fit Section Inference for Two-Way tables Presented By:
Statistics: Unlocking the Power of Data Lock 5 Inference for Means STAT 250 Dr. Kari Lock Morgan Sections 6.4, 6.5, 6.6, 6.10, 6.11, 6.12, 6.13 t-distribution.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 12 Tests of Goodness of Fit and Independence n Goodness of Fit Test: A Multinomial.
BPS - 5th Ed. Chapter 221 Two Categorical Variables: The Chi-Square Test.
Statistics: Unlocking the Power of Data Lock 5 Inference for Proportions STAT 250 Dr. Kari Lock Morgan Chapter 6.1, 6.2, 6.3, 6.7, 6.8, 6.9 Formulas for.
Statistics: Unlocking the Power of Data Lock 5 STAT 250 Dr. Kari Lock Morgan SECTION 7.1 Testing the distribution of a single categorical variable : 
Statistics 300: Elementary Statistics Section 11-3.
Chapter 11: Categorical Data n Chi-square goodness of fit test allows us to examine a single distribution of a categorical variable in a population. n.
Class Seven Turn In: Chapter 18: 32, 34, 36 Chapter 19: 26, 34, 44 Quiz 3 For Class Eight: Chapter 20: 18, 20, 24 Chapter 22: 34, 36 Read Chapters 23 &
The Chi-Square Distribution  Chi-square tests for ….. goodness of fit, and independence 1.
12.2 Tests for Homogeneity and Independence in a two-way table Wednesday, June 22, 2016.
Chapter 12 Lesson 12.2b Comparing Two Populations or Treatments 12.2: Test for Homogeneity and Independence in a Two-way Table.
 Check the Random, Large Sample Size and Independent conditions before performing a chi-square test  Use a chi-square test for homogeneity to determine.
Chi Square Test of Homogeneity. Are the different types of M&M’s distributed the same across the different colors? PlainPeanutPeanut Butter Crispy Brown7447.
Test of Goodness of Fit Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007.
Chi-Square Goodness-of-Fit Test
Chi-Square hypothesis testing
Chi-square test or c2 test
Chapter 10 Analyzing the Association Between Categorical Variables
Contingency Tables: Independence and Homogeneity
Inference for Relationships
Analyzing the Association Between Categorical Variables
Presentation transcript:

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

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

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

Statistics: Unlocking the Power of Data Lock 5 Painkillers and Miscarriage MiscarriageNo MiscarriageTOTAL No painkiller Aspirin51722 Ibuprofen Acetaminophen TOTAL Does this data provide evidence that these two variables are associated?

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

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

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

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 TOTAL

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 TOTAL

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)

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

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

Statistics: Unlocking the Power of Data Lock 5 Randomization Distribution

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

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

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

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)

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?

Statistics: Unlocking the Power of Data Lock 5 NSAIDs and Miscarriage MiscarriageNo MiscarriageTOTAL No painkiller Aspirin51722 Ibuprofen Acetaminophen TOTAL MiscarriageNo MiscarriageTOTAL No NSAIDs NSAIDs TOTAL

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 NSAIDs NSAIDs TOTAL

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

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

Statistics: Unlocking the Power of Data Lock 5 StatKey

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

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

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

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

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

Statistics: Unlocking the Power of Data Lock 5 Results

Statistics: Unlocking the Power of Data Lock 5 Results

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????

Statistics: Unlocking the Power of Data Lock 5

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