# Sec2-145 (1) - STAT 101 Dr Kari Lock Morgan Describing Data...

• 52
• 100% (2) 2 out of 2 people found this document helpful

This preview shows page 1 - 14 out of 52 pages.

Statistics: Unlocking the Power of Data Lock 5 STAT 101 Dr. Kari Lock Morgan Describing Data: Two Variables SECTIONS 2.1, 2.4, 2.5 Two categorical (2.1) Quantitative and categorical (2.4) Two quantitative (2.5)
Statistics: Unlocking the Power of Data Lock 5 The Big Picture Population Sample Sampling Statistical Inference Descriptive Statistics
Statistics: Unlocking the Power of Data Lock 5 Two Categorical Variables Look at the relationship between two categorical variables 1. Relationship status 2. Gender
Statistics: Unlocking the Power of Data Lock 5 Two-Way Table Female Male Total In a Relationship 32 10 42 It’s Complicated 12 7 19 Single 63 45 108 Total 107 62 169 It doesn’t matter which variable is displayed in the rows and which in the columns R: table(relationship, gender) Data from Duke students
Statistics: Unlocking the Power of Data Lock 5 Two-Way Table What proportion of students in this sample are in a relationship? a) 42/169 25% b) 32/107 30% c) 10/62 16% d) 32/42 76% Female Male Total In a Relationship 32 10 42 It’s Complicated 12 7 19 Single 63 45 108 Total 107 62 169
Statistics: Unlocking the Power of Data Lock 5 Two-Way Table What proportion of females in this sample are in a relationship? a) 42/169 25% b) 32/107 30% c) 10/62 16% d) 32/42 76% Female Male Total In a Relationship 32 10 42 It’s Complicated 12 7 19 Single 63 45 108 Total 107 62 169
Statistics: Unlocking the Power of Data Lock 5 Male and Female Proportions 30% of females in the sample say they are in a relationship 16% of males in the sample say they are in a relationship Why the difference???
Statistics: Unlocking the Power of Data Lock 5 Difference in Proportions A difference in proportions is a difference in proportions for one categorical variable calculated for different levels of the other categorical variable Example: proportion of females in a relationship – proportion of males in a relationship
Statistics: Unlocking the Power of Data Lock 5 Two-Way Table What proportion of people in a relationship in this sample are female? a) 42/169 25% b) 32/107 30% c) 10/62 16% d) 32/42 76% Female Male Total In a Relationship 32 10 42 It’s Complicated 12 7 19 Single 63 45 108 Total 107 62 169
Statistics: Unlocking the Power of Data Lock 5 Two-Way Table CAUTION : The proportion of females in a relationship is NOT THE SAME AS the proportion of people in a relationship who are female! 30% ≠ 76%!
Statistics: Unlocking the Power of Data Lock 5 Side-by-Side Bar Chart R: barplot(relationship~gender, beside=TRUE) The height of each bar is the number of the corresponding cell in the two-way table
Statistics: Unlocking the Power of Data Lock 5 Segmented Bar Chart A segmented bar chart is like a side-by-side bar chart, but the bars are stacked instead of side-by-side R: barplot(relationship~gender)
Statistics: Unlocking the Power of Data Lock 5 Vitamin D Injections Many kidney dialysis patients get vitamin D injections to correct for a lack of calcium. Two forms of vitamin D injections are used: calcitriol and paricalcitol. The records of 67 , 000 dialysis patients were examined, and half received one drug; the other half the other drug. After three years, 58 .