690 likes | 891 Views
Unit 2: Comparing Two Groups. In Unit 1, we learned the basic process of statistical inference using tests and confidence intervals. We did all this by focusing on a single proportion.
E N D
Unit 2: Comparing Two Groups • In Unit 1, we learned the basic process of statistical inference using tests and confidence intervals. We did all this by focusing on a single proportion. • In Unit 2, we will take these ideas and extend them to comparing two groups. We will compare two proportions, two independent means, and paired data.
Chapter 5:Comparing Two Proportions 5.1: Descriptive (Two-Way Tables) 5.2: Inference with Simulation-Based Methods 5.3: Inference with Theory-Based Methods
Positive and Negative Perceptions • Consider these two questions: • Are you having a good year? • Are you having a bad year? • Do people answer each question in such a way that would indicated the same answer? (e.g. Yes for the first one and No for the second.)
Positive and Negative Perceptions • Researchers questioned 30 students (randomly giving them one of the two questions). • They then recorded if a positive or negative responsewas given. • Is this an observational study or randomized experiment?
Positive and Negative Perceptions • Observational units • The 30 students • Variables • Question wording (good year or bad year) • Perception of their year (positive or negative) • Which is the explanatory and which is the response?
Two-Way Tables • A two-way table organizes data • Summarizes two categorical variables • Also called contingency table • Are students more likely to give a positive response if they were given the good year question?
Two-Way Tables • Conditional proportions will help us better determine if there is an association between the question asked and the type of response. • We can see that those given the positive question were more likelyto respond positively.
Segmented Bar Graphs • We can use segmented bar graphs to see this association. • Remember that variables are associatedif the conditional proportion of the outcomes for one group differ from the conditional proportion of outcomes in other groups.
Perceptions • Those responding to the good year question were more likely to answer positively (83% to 33%) than those responding positively to the bad year question. • The statistic we will be using to measure this is the difference in proportions. • 0.83 - 0.33 = 0.50 higher for the good year question than the bad year question.
A Sneak Peak at Comparing Two Proportions: Simulation-Based Approach In the next section we will conduct tests of significance to compare two proportions and I want to give you a preview of that here. We will assume there is no association between the variables (i.e. the two population proportions are the same) and decide if two sample proportions differ enough to conclude this would be very unlikely just by random chance.
Hypotheses • Null Hypothesis: There is no association between which question is asked and the type of response. (The proportion of positive responses will be the same in each group. ) • Alternative Hypothesis: There is an association between which question is asked and the type of response. (The proportion of positive responses will be different in each group. )
Results • The difference in proportions of positive responses is 0.83 − 0.33 = 0.50. • How likely is a difference this great or greater if the type of question asked made no difference in how the student would respond?
Random Reassignment • Notice that 19 students gave a positive response. If the null hypothesis is true, these 19 would have given a positive response no matter which question was asked. • Therefore, under a true null hypothesis, we can randomly place these 19 people into either group and they will still give a positive response. This replicates the random assignment that was done in the experiment. • We will also keep constant the 18 that receive the positive question and 12 that receive the negative question.
You can think about this random reassignment with the raw data as well. It doesn’t matter which question was asked, the responses will be the same. Therefore, we can shuffle the type of question and leave the responses fixed. This is equivalent to keeping the same column and row totals and just shuffling the inside of the two-way table as described earlier.
Random Reassignment • I did this once and found a difference in the proportions of positive responses for the two questions of 0.50 −0.83 = −0.33
Random Reassignment • I did this again and found a difference in the proportions of positive responses for the two questions of 0.61 −0.67 = −0.06
Random Reassignment • I did this again and found a difference in the proportions of positive responses for the two questions of 0.67 −0.58 = 0.09
Random Reassignment • In my three randomizations, I have yet to see a difference in proportions that is as far away from zero as the observed difference of 0.5. • Let’s do some more randomizations to develop a null distribution.
Random Reassignment • After 1000 randomizations, only 7 were as far away from zero as our observed proportion.
Conclusion • Since we have a p-value of 7/1000 or 0.007, we can conclude the alternative hypothesis and say we have strong evidence that how the question is phrased affects the response.
Applets • Let’s look at how this is done in two applets • Simulation for Two Proportions • Simulation for Multiple Proportions
Swimming with Dolphins Is swimming with dolphins therapeutic for patients suffering from clinical depression? • Researchers recruited 30 subjects aged 18-65 with a clinical diagnosis of mild to moderate depression. • Discontinued antidepressants and psychotherapy 4 weeks prior to and throughout the experiment • 30 subjects went to an island near Honduras • Randomly assigned to two treatment groups
Swimming with Dolphins • Both groups engaged in one hour of swimming and snorkeling each day. • One group swam in the presence of dolphins and the other group did not. • Participants in both groups had identical conditions except for the dolphins • After 2 weeks, each subjects’ level of depression was evaluated, as it had been at the beginning of the study • The response variable is if the subject achieved substantial reduction in depression.
Swimming with Dolphins • Observational units • The 30 subjects with mild to moderate depression. • Explanatory variable • Swimming with dolphins or not • Response variable • Reduction in depression or not • Are the variables quantitative or categorical?
Swimming with Dolphins • Is this study an observational study or an experiment? • Are the subjects in this study a random sample from a larger population?
Swimming with Dolphins Results
Swimming with Dolphins • The difference in proportions of improvers is 0.67 – 0.20 = 0.47. • There are two possible explanations for an observed difference of 0.47. • A tendency to be more likely to improve with dolphins • The 13 subjects were going to show improvement with or without dolphins and random chance assigned more improvers to the dolphins
Swimming with Dolphins Null hypothesis: Dolphins don’t help • Swimming with dolphins is not associated with substantial improvement in depression Alternative hypothesis: Dolphins help • Swimming with dolphins increases the probability of substantial improvement in depression symptoms
Swimming with Dolphins • The parameter is the (long-run) difference in the probability of improving between receiving dolphin therapy and the control. • Our statistic is the observed difference in sample proportions () or 0.67 – 0.20 = 0.47.
Swimming with Dolphins Null Hypothesis: The probability someone exhibits substantial improvement after swimming with dolphins is the same as the probability someone exhibits substantial improvement after swimming without dolphins. Alternative Hypothesis: The probability someone exhibits substantial improvement after swimming with dolphins is higher than the probability someone exhibits substantial improvement after swimming without dolphins.
Swimming with Dolphins • Since we defined our parameter as the difference in probability of improving between the 2 groups, we can write our hypotheses this way as well: H0: dolphins =control dolphins control = 0 Ha: dolphins >control dolphins control > 0
Swimming with Dolphins If the null hypothesis is true (dolphin therapy is not better) we would have 13 improvers and 17 non-improvers regardless of the group they were in. Any differences we see between groups arise solely from the randomness in the assignment to the groups.
Swimming with Dolphins • We can perform this simulation with cards. • 13 black cards represent the improvers • 17 red cards represent the non-improvers • We assume these outcomes would happen no matter which treatment group subjects were in. • Shuffle the cards and put 15 in one pile (dolphin therapy) and 15 in another (control group) • An improver is equally likely to be assigned to each group
Swimming with Dolphins • In the actual study, there were 10 improvers (diff of 0.47) in the dolphin group. • We conducted 3 simulations and got 8, 5, and 6 improvers in the dolphin therapy group. (notice the diff in proportions)
Swimming with Dolphins • We did 1000 repetitions to develop a null distribution. • Why is it centered at about 0? • What does each dot represent?
Swimming with Dolphins • 13 out of 1000 results had a difference of 0.47 or higher (p-value = 0.013). • 0.47 isSD above zero. • Using either the p-value or standardized statistic, we have strong evidence against the null and can conclude that swimming with dolphins increases the probability of substantial improvement in depression symptoms.
Swimming with Dolphins • A 95% confidence interval for the difference in the probability using the standard deviation from the null distribution is 0.467 + 2(0.178) = 0.467 + 0.356 or (0.111to 0.823) • We are 95% confident that when allowed to swim with dolphins, the probability of improving is between 0.111 and 0.823 higher than when no dolphins are present. • How does this interval back up our conclusion from the test of significance?
Swimming with Dolphins • Can we say that the presence of dolphins caused this improvement? • Since this was a randomized experiment, and assuming everything was identical between the groups, we have strong evidence that dolphins were the cause • Can we generalize to a larger population? • Maybe mild to moderately depressed 18-65 year old patients willing to volunteer for this study • We have no evidence that random selection was used to find the 30 subjects.
Exploration 5.2: Contagious Yawns? • MythBusters investigated this. • 50 subjects were ushered into a small room by co-host Kari. • She yawned as she ushered 34 in the room and for 16 she didn’t yawn. We will assume she randomly decided who would received the yawns.
Comparing Two Proportions: Theory-Based Approach Section 5.3
Introduction • Just as with a single proportion, we can often predict results of a simulation using a theory-based approach. • The theory-based approach also gives a simpler way to generate a confidence intervals.
Smoking and Gender • How does parents’ behavior affect the sex of their children? • Fukuda et al., 2002 (Japan) found the following: • 255 of 565 births (45.1%) where both parents smoked more than a pack a day were boys. • 1975 of 3602 births (54.8%)where both parents did not smoke were boys. • Other studies have shown a reduced male to female birth ratio where high concentrations of other environmental chemicals are present (e.g. industrial pollution, pesticides)
Smoking and Gender • Asegmented bar graph and 2-way table • Let’s compare the proportions to see if the difference is statistically significantly.
Smoking and Gender Null Hypothesis: • There is no association between smoking status of parents and sex of child. • The probability of having a boy is the same for parents who smoke and don’t smoke. • smoking - nonsmoking = 0 Alternative Hypothesis: • There is an association between smoking status of parents and sex of child. • The probability of having a boy is not the same for parents who smoke and don’t smoke • smoking - nonsmoking ≠ 0
Smoking and Gender • What are the observational units in the study? • What are the variables in this study? • Which variable should be considered the explanatory variable and which the response variable? • Can you draw cause-and-effect conclusions for this study?
Smoking and Gender • OK to shuffle? • In the last section we “re-randomized” subjects to treatment groups to simulate the null distribution. • In this study the parents weren’t randomized to the treatment, since it’s observational, but we can still represent the null hypothesis of no association through randomization.