Presentation is loading. Please wait.

Presentation is loading. Please wait.

Comparing Two Proportions (p 1 vs. p 2 ). Inferential Methods Large independent samplesLarge independent samples 1. z-test for comparing p 1 vs. p 2 2.

Similar presentations


Presentation on theme: "Comparing Two Proportions (p 1 vs. p 2 ). Inferential Methods Large independent samplesLarge independent samples 1. z-test for comparing p 1 vs. p 2 2."— Presentation transcript:

1 Comparing Two Proportions (p 1 vs. p 2 )

2 Inferential Methods Large independent samplesLarge independent samples 1. z-test for comparing p 1 vs. p 2 2. CI for (p 1 – p 2 ) 3. Effect size (see below) Quantifying Risk (or Benefit)Quantifying Risk (or Benefit) 1. Relative Risk (RR) ~ tests and CI 2. Odd’s Ratio (OR) ~ tests and CI 3. Number Needed to Treat (NNT) & Number Needed to Harm (NNH) Number Needed to Harm (NNH) Small independent samples - Fisher’s Exact Test (use software)Small independent samples - Fisher’s Exact Test (use software)

3 Inferential Methods (cont’d) Small dependent samples - McNemar’s test (binomial )Small dependent samples - McNemar’s test (binomial ) Large dependent samples - McNemar’s test (chi-square)Large dependent samples - McNemar’s test (chi-square)

4 Example 1: Nutrition Education for Pregnant Teens Research Question:Research Question: “Do the pregnant teens who receive nutrition education produce a lower proportion of low birth weight babies than do pregnant teens who do not receive such instruction?” “Do the pregnant teens who receive nutrition education produce a lower proportion of low birth weight babies than do pregnant teens who do not receive such instruction?” Study:Study: To conduct the study 314 pregnant teens were randomly assigned to receive the nutrition education and 316 pregnant teens were assigned to the non-instruction group.

5 Experimental Comparative Study Population 1 p 1 Population 2 p 2 p  vs. p  Sample size = n 1 Calculate: Sample size = n 2 Calculate: To make inferences use: Hypothesis test, CI for difference in proportions (and possibly RR, OR, & NNT/NNH). Population (e.g. pregnant teens) Randomly assign

6 Test statistic for large independent samples For testing equality of the two proportions only H o : (p 1 – p 2 ) =   A : (p 1 – p 2 ) >  (upper-tail) (p 1 – p 2 ) <  (lower-tail) (p 1 – p 2 ) <  (lower-tail) (p 1 – p 2 ) =  (two-tail, use CI approach) (p 1 – p 2 ) =  (two-tail, use CI approach) Provided n 1 p 1 > 10 & n 1 q 1 > 10 and n 2 p 2 > 10 & n 2 q 2 > 10

7 Test Statistic for Large Independent Samples For testing to see if difference is at least  H o : (p 1 – p 2 ) =   A : (p 1 – p 2 ) >  (upper-tail) (p 1 – p 2 ) <  (lower-tail) (p 1 – p 2 ) <  (lower-tail) Provided n 1 p 1 > 10 & n 1 q 1 > 10 and n 2 p 2 > 10 & n 2 q 2 > 10  Most important case

8 Confidence Interval for (p 1 – p 2 ) for Large Independent Samples Provided n 1 p 1 > 10 & n 1 q 1 > 10 n 2 p 2 > 10 & n 2 q 2 > 10 The confidence interval for (p 1 – p 2 ) has a general form: z-values 90% z = % z = % z = 2.578

9 Effect Size for Large Independent Samples There are three main ways to quantify effect size in situations where we are comparing proportions across two populations or treatment groups. 1)Difference in sample proportions = (this almost might referred to as the risk difference) 2)Relative Risk or Risk Ratio (RR) = 3)Odds Ratio (OR) (see Probability ppt)

10 Effect Size for Large Independent Samples Which measure you use depends on the context of the experiment/study and more importantly how the data was collected. In observational studies (e.g. case-control studies) the odds ratio (OR) is primarily used because the outcome of interest is NOT random. Therefore we cannot talk about the proportion of people with the disease, we can only talk about the proportion with the risk factor. (See example later in this Powerpoint)

11 Example 1: Nutrition Education for Pregnant Teens Here we are interested in determining if pregnant teens who receive the nutrition education have a lower prevalence of low birth weight infants, but we are not necessarily looking for a certain size (  ) for that difference. Let, p E = proportion of babies with low birth weight born to teens who underwent nutrition education. p N = proportion of babies with low birth weight born to teens who did not receive nutrition education.

12 Example 1: Nutrition Education for Pregnant Teens STEP 1) State Hypotheses H o : p E = p N or equivalently (p E – p N ) = 0 H A : p E < p N or equivalently (p E – p N ) < 0 STEP 2) Determine Test Criteria a) Choose  (we could use something else) b) From the CDC website we find that around 9% of infants born in the U.S. are classified as having low birth weights. For teen mothers that percentage is probably higher but smaller p’s require larger samples, thus we will use p =.09 to check sample size considerations. Here n 1 = 314 and n 2 = 316 so … b) From the CDC website we find that around 9% of infants born in the U.S. are classified as having low birth weights. For teen mothers that percentage is probably higher but smaller p’s require larger samples, thus we will use p =.09 to check sample size considerations. Here n 1 = 314 and n 2 = 316 so … n 1 p 1 = 28, n 1 q 1 = 286, n 2 p 2 = 28, n 2 q 2 = 288 (i.e. samples are LARGE) n 1 p 1 = 28, n 1 q 1 = 286, n 2 p 2 = 28, n 2 q 2 = 288 (i.e. samples are LARGE) THUS WE USE LARGE SAMPLE TEST FOR COMPARING POPULATION PROPORTIONS ASSUMING EQUALITY UNDER THE NULL, i.e.  = 0.

13 Example 1: Nutrition Education for Pregnant Teens STEP 3) Collect Data and Compute Test Statistic In the study, 23 of the 314 teen mothers receiving nutrition education had low birth weight babies compared to 39 of the 316 mothers in the non-instruction group. Using these results we can calculate all the necessary proportions to use in the z-test statistic shown below. Sample Proportion Calculations

14 Example 1: Nutrition Education for Pregnant Teens STEP 3) Collect Data and Compute Test Statistic In the study, 23 of the 314 teen mothers receiving nutrition education had low birth weight babies compared to 39 of the 316 mothers in the non-instruction group. Finally calculating the test statistic we see that difference in the sample proportions is over 2 SE’s below 0. Test Statistic Calculations

15 Example 1: Nutrition Education for Pregnant Teens STEPS 4 & 5) Compute p-value and make decision Our observed test statistic value is z = To find p-value we use the fact that our test statistic has a standard normal distribution. From standard normal table or computer P(Z < ) =.0172 The probability that chance variation alone would produce an observed proportion for education group this small or smaller when compared to the non-instruction group is 1.72%. Thus we have evidence to suggest that the proportion of low birth weight babies born to teen mothers in education group is smaller than that for the non-instruction group (p =.0172).

16 Example 1: Nutrition Education for Pregnant Teens STEPS 6) Quantify Significant Effects 95% CI for Difference in Proportions95% CI for Difference in Proportions Necessary Computations

17 Example 1: Nutrition Education for Pregnant Teens 95% CI for ( p E – p N ) = (-.0985, ) or (- 9.85%, -.39 %)95% CI for ( p E – p N ) = (-.0985, ) or (- 9.85%, -.39 %) One potential interpretation of CI: We estimate that the percentage of low birth weight babies born to teen mothers who participate in a nutrition education program is between.39 and 9.85 percentage points smaller than that for teen mothers who are not given this instruction.

18 Example 1: Nutrition Education for Pregnant Teens 95% CI for ( p E – p N ) = (-.0985, )95% CI for ( p E – p N ) = (-.0985, ) or (- 9.85%, -.39 %) or (- 9.85%, -.39 %) Another potential interpretation of CI: For pregnant teens participating in the nutrition education program we estimate that the prevalence of low birth weight is between.39 and 9.85 percentage points smaller than that for teen mothers receiving no such education.

19 Relative Risk or Risk Ratio Recall from the probability presentation that risk ratio or relative risk is defined as:Recall from the probability presentation that risk ratio or relative risk is defined as: We can use this in the study of potentially beneficial treatments by computing it as follows:We can use this in the study of potentially beneficial treatments by computing it as follows:

20 Example 1: Nutrition Education for Pregnant Teens Using Relative Risk or Risk Ratio (RR)Using Relative Risk or Risk Ratio (RR) We have, The relative risk (RR) of low birth weight associated with being in the control (non-instruction) group is given by: The relative risk (RR) of low birth weight associated with being in the control (non-instruction) group is given by: Relative Risk or Risk Ratio (RR) =.1234/.0732 = Relative Risk or Risk Ratio (RR) =.1234/.0732 = i.e., teen mothers not participating in the nutrition education program have a times higher chance of having a baby with a low birth weight. Another way we state it is that their risk of having a low birth weight baby is 68.6% higher.

21 Example 1: Nutrition Education for Pregnant Teens Using Relative Risk or Risk Ratio (RR)Using Relative Risk or Risk Ratio (RR) We have, Another way to look at this is in terms of benefit associated with being in the education vs. the non-instruction (control) group. This is achieved by reciprocating the RR. Another way to look at this is in terms of benefit associated with being in the education vs. the non-instruction (control) group. This is achieved by reciprocating the RR. “Risk Reduction” =.0732/.1234 =.5932 which constitutes a roughly 41% reduction in risk of having a low birth weight baby associated with receiving the nutrition education.

22 Example 1: Nutrition Education for Pregnant Teens But wait… there is more! For situations where we are looking at a potentially beneficial treatment we can report the NNT.But wait… there is more! For situations where we are looking at a potentially beneficial treatment we can report the NNT. NNT (Number Needed to Treat): the number of patients who need to be treated to prevent 1 adverse outcome. To find the NNT we simple compute:NNT (Number Needed to Treat): the number of patients who need to be treated to prevent 1 adverse outcome. To find the NNT we simple compute:

23 Example 1: Nutrition Education for Pregnant Teens NNT (Number Needed to Treat): the number of patients who need to be treated to prevent 1 adverse outcome.NNT (Number Needed to Treat): the number of patients who need to be treated to prevent 1 adverse outcome. Thus we estimate that we would need to have 20 teen mothers participate in nutrition education program to see 1 fewer baby born with a low birth weight amongst teen moms.Thus we estimate that we would need to have 20 teen mothers participate in nutrition education program to see 1 fewer baby born with a low birth weight amongst teen moms. Note: If we reciprocate the confidence limits for a CI for the “risk difference” we obtain a 95% CI for the NNT. Here we would have, (1/.0985, 1/.0039) = (10.15, )Note: If we reciprocate the confidence limits for a CI for the “risk difference” we obtain a 95% CI for the NNT. Here we would have, (1/.0985, 1/.0039) = (10.15, ) So we estimate that we would need to have between 10 and 256 teen mothers participate in the program to see 1 fewer low birth weight baby with 95% confidence.

24 Example 1: Nutrition Education for Pregnant Teens There is no reason to use the odds ratio (OR) here because the “disease” outcome (i.e. low birth weight), is random. We can still calculate it however.There is no reason to use the odds ratio (OR) here because the “disease” outcome (i.e. low birth weight), is random. We can still calculate it however. Recall from probability presentationRecall from probability presentation

25 Example 1: Nutrition Education for Pregnant Teens Here, So teen mothers who received no nutrition education during pregnancy have 1.78 times higher odds for having a baby with low birth weight when compared to teen mothers who did receive nutrition instruction.

26 Example 1: Nutrition Education for Pregnant Teens We can display data from this study in a 2 X 2 contingency table format Treatment Low Birthweight Normal Birthweight Row Totals No Instruction (N) 39277n N = 316 Nutrition Education (E) 23291n E = 314 Column Totals Study Results: In the study, 23 of the 314 teen mothers receiving nutrition education had low birth weight babies compared to 39 of the 316 mothers in the non- instruction group.

27 Example 1: Nutrition Education for Pregnant Teens Recall from the probability presentation that the OR has an easy formula when our data are displayed in a 2 X 2 table. Treatment Low Birthweight Normal Birthweight Row Totals No Instruction (N) a 39 b 277n N = 316 Nutrition Education (E) c 23 d 291n E = 314 Column Totals Easier Formula! OR = ad/bc = (39)(291)/(277)(23) = 1.78

28 Example 1: Nutrition Education for Pregnant Teens Whew! Let’s stop an summarize our findings to this point in a table. Perhaps we should have confidence intervals for the RR and OR as well!

29 Confidence Intervals for Relative Risk (RR) and Odds Ratio (OR) Before we look at the computational procedures for finding these CI’s we must note that the 2 X 2 table for our data MUST BE in the format below: The key is identifying which cell is “ a ” and that risk or treatment is always the row variable!!!!

30 Confidence Intervals for RR 1.Take natural log of estimated RR, ln(RR) 2.Compute standard error of ln(RR) 3.Find CI for ln(RR)

31 Confidence Intervals for RR 4.Find CI for RR by taking the antilog (e x ) of the endpoints of CI for RR in log scale: LCL for RR = e L UCL for RR = e U i.e., CI for RR = (e L, e U )

32 Confidence Intervals for OR 1.Take natural log of estimated OR, ln(OR) 2.Compute standard error of ln(OR) 3.Find CI for ln(OR)

33 Confidence Intervals for OR 4.Find CI for OR by taking the antilog (e x ) of the endpoints of CI for ln(OR): LCL for OR = e L UCL for OR = e U i.e., CI for OR = (e L, e U )

34 Hypothesis Testing for RR and OR In general we are interested in identifying situations where the RR/OR are greater than 1 (increased risk) or less than 1 (decreased risk).In general we are interested in identifying situations where the RR/OR are greater than 1 (increased risk) or less than 1 (decreased risk). For either the null hypothesis says that the RR or OR is equal to 1 or equivalently the ln(RR) or ln(OR) is 0 because ln(1) = 0.For either the null hypothesis says that the RR or OR is equal to 1 or equivalently the ln(RR) or ln(OR) is 0 because ln(1) = 0.

35 Hypothesis Testing for RR and OR The test statistic in either case provided our sample sizes are “large” isThe test statistic in either case provided our sample sizes are “large” is So we use the standard normal distribution to find the p-value associated with the test statistic.So we use the standard normal distribution to find the p-value associated with the test statistic. Better approach in practice is to simply look at whether or not CI for RR/OR contains 1 or not, if it does not contain 1 we Reject H o.Better approach in practice is to simply look at whether or not CI for RR/OR contains 1 or not, if it does not contain 1 we Reject H o.

36 Example 1: Nutrition Education for Pregnant Teens Treatment Low Birthweight Normal Birthweight Row Totals No Instruction (N) a 39 b 277n N = 316 Nutrition Education (E) c 23 d 291n E = 314 Column Totals Find a 95% CI for RR 1)RR =.1234/.0732 = )ln(RR) =.519 3)Find SE(ln(RR)) = 4) Find confidence limits for ln(RR).519+(1.96)(.251)=(.027,1.011) 5) Take antilog (e x ) of endpoints (e.027,e ) = (1.027,2.748) The CI contains only values above 1, thus we conclude the lack of nutritional education is associated with increased risk and nutritional education is associated with decreased risk of low birth weight.

37 Example 1: Nutrition Education for Pregnant Teens Treatment Low Birthweight Normal Birthweight Row Totals No Instruction (N) a 39 b 277n N = 316 Nutrition Education (E) c 23 d 291n E = 314 Column Totals Find a 95% CI for OR 1)OR = (39)(291)/(277)(23) = )ln(RR) =.577 3)Find SE(ln(RR)) = 4) Find confidence limits for ln(RR).577+(1.96)(.280)=(.029,1.125) 5) Take antilog (e x ) of endpoints (e.029,e ) = (1.029,3.082) Again we see the CI contains only values above 1, thus we conclude the lack of nutritional education is associated with increased risk and nutritional education is associated with decreased risk of low birth weight.

38 Example 1: Nutrition Education for Pregnant Teens Hypothesis Tests for RR and OR (even though the CI’s were enough!) Test Statistic for RR Test Statistics for OR Both p-values are less then  therefore reject the null and conclude there is increased risk associated with being a control and hence decreased risk of low birth weight associated with the nutritional education program for pregnant teens. This agrees with our conclusion from CI’s.

39 Example 1: Nutrition Education for Pregnant Teens That’s it! Let’s summarize our final findings in a table. All of this is much easier to do using statistical software, e.g. JMP.

40 Example 1: Nutrition Education for Pregnant Teens Enter data table as shown below

41 Example 1: Nutrition Education for Pregnant Teens You can see the three options related to what we just discussed below: Check them all

42 Example 1: Nutrition Education for Pregnant Teens All the CI’s we calculated “by hand” are shown below.

43 Fisher’s Exact Test When sample sizes are “small” or when it is available, one should use Fisher’s Exact Test for comparing p 1 vs. p 2.When sample sizes are “small” or when it is available, one should use Fisher’s Exact Test for comparing p 1 vs. p 2. The computations are tedious and finding a p-value requires special tables but it is implemented in many statistical software packages.The computations are tedious and finding a p-value requires special tables but it is implemented in many statistical software packages. By default JMP will always calculate p- values for Fisher’s Exact Test when 2 X 2 contingency tables are analyzed.By default JMP will always calculate p- values for Fisher’s Exact Test when 2 X 2 contingency tables are analyzed.

44 Fisher’s Exact Test The results from JMP are shown below:The results from JMP are shown below: The alternatives are communicated verbally along side the p-values, the one we are interested is boxed. It states that…The alternatives are communicated verbally along side the p-values, the one we are interested is boxed. It states that… The probability of having a baby with a normal birth weight is greater for those who in the group that received nutritional education (p =.0235). This p-value is EXACT and does not come from a normal approximation! This p-value is EXACT and does not come from a normal approximation!

45 Preliminary Summary of Independent Sample Comparisons (p 1 vs. p 2 ) When sample sizes are “large” one can use a z-test and CI to make inferences about (p 1 – p 2 ), otherwise use Fisher’s Exact Test.When sample sizes are “large” one can use a z-test and CI to make inferences about (p 1 – p 2 ), otherwise use Fisher’s Exact Test. To further quantify and discuss effect size one can use RR and OR, along with inferential methods for them.To further quantify and discuss effect size one can use RR and OR, along with inferential methods for them. If it makes sense for the given situation, NNT can also be calculated from (p 1 – p 2 ).If it makes sense for the given situation, NNT can also be calculated from (p 1 – p 2 ).

46 Observational Comparative Study (e.g. case-control) Population 1 p 1 Population 2 p 2 p  vs. p  Sample size = n 1 Calculate: Sample size = n 2 Calculate: To make inferences use: Hypothesis test, CI for difference in proportions (and possibly RR, OR, & NNT/NNH).

47 Example 2: Age at 1 st Pregnancy and Cervical Cancer (Case-Control Study) In a case-control study, we sample individuals who have a “disease” of interest (cases) and individuals who do not have the “disease” (controls) and compare these two populations in terms of potential risk factors.In a case-control study, we sample individuals who have a “disease” of interest (cases) and individuals who do not have the “disease” (controls) and compare these two populations in terms of potential risk factors. In this study, samples of women who have cervical cancer and women who did not have cervical cancer were independently taken. The proportions of women who had their first child at or before the age of 25 were compared for these two populations of women.In this study, samples of women who have cervical cancer and women who did not have cervical cancer were independently taken. The proportions of women who had their first child at or before the age of 25 were compared for these two populations of women.

48 Example 2: Age at 1 st Pregnancy and Cervical Cancer (Case-Control Study) In conducting the study 49 women with cervical cancer and 317 women of similar age & background without cervical cancer were sampled. The number of women having their first child at or before the age of 25 was determined for both samples.

49 Example 2: Age at 1 st Pregnancy and Cervical Cancer (Case-Control Study) Because the number of women with the disease was chosen by the researchers we cannot consider P(disease | risk), thus RR cannot be calculated. (RR test and CI)Because the number of women with the disease was chosen by the researchers we cannot consider P(disease | risk), thus RR cannot be calculated. (RR test and CI) We will only compare the proportion of women with the “risk factor” in each group. ( z-test, Fisher’s Exact test, CI for (p 1 – p 2 ) )We will only compare the proportion of women with the “risk factor” in each group. ( z-test, Fisher’s Exact test, CI for (p 1 – p 2 ) ) If the prevalence of the risk factor is greater for the disease group then we have evidence of an association or link between the factor and the disease.If the prevalence of the risk factor is greater for the disease group then we have evidence of an association or link between the factor and the disease.


Download ppt "Comparing Two Proportions (p 1 vs. p 2 ). Inferential Methods Large independent samplesLarge independent samples 1. z-test for comparing p 1 vs. p 2 2."

Similar presentations


Ads by Google