Lecture Title
Total Page:16
File Type:pdf, Size:1020Kb
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike License. Your use of this material constitutes acceptance of that license and the conditions of use of materials on this site. Copyright 2006, The Johns Hopkins University and John McGready. All rights reserved. Use of these materials permitted only in accordance with license rights granted. Materials provided “AS IS”; no representations or warranties provided. User assumes all responsibility for use, and all liability related thereto, and must independently review all materials for accuracy and efficacy. May contain materials owned by others. User is responsible for obtaining permissions for use from third parties as needed. Comparing Proportions Between Two Independent Populations John McGready Johns Hopkins University Lecture Topics CI’s for difference in proportions between two independent populations Large sample methods for comparing proportions between two populations – Normal method – Chi-squared test Fisher’s exact test Relative risk 3 Section A The Two Sample Z-Test for Comparing Proportions Between Two Independent Populations Comparing Two Proportions We will motivate by using data from the Pediatric AIDS Clinical Trial Group (ACTG) Protocol 076 Study Group1 1 Conner, E., et al. Reduction of Maternal-Infant Transmission of Human Immunodeficiency Virus Type 1 with Zidovudine Treatment, New England Journal of Medicine 331: 18 Continued 5 Comparing Two Proportions Study Design – “We conducted a randomized, double- blinded, placebo-controlled trial of the efficacy and safety of zidovudine (AZT) in reducing the risk of maternal-infant HIV transmission” – 363 HIV infected pregnant women were randomized to AZT or placebo Continued 6 Comparing Two Proportions Results – Of the 180 women randomized to AZT group, 13 gave birth to children who tested positive for HIV within 18 months of birth Continued 7 Comparing Two Proportions Result – Of the 183 women randomized to the placebo group, 40 gave birth to children who tested positive for HIV within 18 months of birth 8 Notes on Design Random assignment of Tx – Helps insure two groups are comparable – Patient and physician could not request particular Tx Continued 9 Notes on Design Double blind – Patient and physician did not know Tx assignment 10 HIV Transmission Rates 13 AZT pˆ = = 0.072 AZT 180 40 Placebo pˆ = = 0.219 PLAC 183 Continued 11 HIV Transmission Rates Note—these are NOT the true population parameters for the transmission rates, they are estimates based on our two samples Continued 12 HIV Transmission Rates There is sampling variability 95% confidence intervals – AZT 95% CI .04 - .12 – Placebo 95% CI .16 - .28 13 95% CIs for HIV Transmission Rates AZT nAZT × pˆ AZT × (1− pˆ AZT ) = 180 × 0.072 ×.928 = 12 Placebo nPLAC × pˆ PLAC × (1− pˆ PLAC ) = 183× 0.22 ×.78 = 31 14 HIV Transmission Rates . cii 180 13 -- Binomial Exact -- Variable | Obs Mean Std. Err. [95% Conf. Interval] -------------+--------------------------------------------------------------- | 180 .0722222 .019294 .0390137 .1203358 . cii 183 40 -- Binomial Exact -- Variable | Obs Mean Std. Err. [95% Conf. Interval] -------------+--------------------------------------------------------------- | 183 .2185792 .0305507 .160984 .2855248 15 Notes on HIV Transmission Rates Is the difference significant, or can it be explained by chance? Since CI’s do not overlap suggests significant difference – Can we compute a confidence interval on the difference in proportions? – Can we compute a p-value? 16 Sampling Distribution of the Difference in Sample Means Since we have large samples we know the sampling distributions of the sample proportions in both groups are approximately normal It turns out the difference of quantities, which are (approximately) normally distributed, are also normally distributed Continued 17 Sampling Distribution of the Difference in Sample Means So, the big news is . – The sampling distribution of the difference of two sample proportions, each based on large samples, approximates a normal distribution – This sampling distribution is centered at the true (population) difference, P1 - P2 18 Simulated Sampling Distribution of Sample Proportion Simulated Sampling Distribution, Proportion HIV Infected Children AZT Group, n = 180 15 s le p 10 m a S of e g a t en c 5 r e P 0 0 .05 .1 .15 .2 .25 .3 .35 Sam ple Proportion HIV Infected Children Continued 19 Simulated Sampling Distribution of Sample Proportion Simulated Sampling Distribution, Proportion HIV Infected Children Placebo Group, n = 183 15 s e l p 10 m Sa f o e g a t n e 5 rc Pe 0 0 .05 .1 .15 .2 .25 .3 .35 Sam ple Proportion HIV Infected Children 20 Simulated Sampling Distribution Difference in Sample Proportions Simulated Sampling Distribution, Difference in Proportions (Placebo - AZT) 20 15 s le p m a S of 10 e g a t en c r e P 5 0 0 .05 .1 .15 .2 .25 .3 .35 Difference in Sam ple Proportions HIV Infected Children 21 95% Confidence Interval for Difference in Proportions Our most general formula: (our best estimate) ± 2*(SE of our best estimate) 22 95% Confidence Interval for Difference in Means Well, our best estimate for the mean difference would be : pˆ1 − pˆ 2 Where . – pˆ1= proportion HIV infected children in AZT group – pˆ 2= proportion HIV infected children in placebo group Continued 23 95% Confidence Interval for Difference in Means Since pˆ 1 − pˆ 2 = 0.07-.22 = - 0.15, our formula is . -.15 ± 2 SE ( pˆ 1 − pˆ 2 ) SE( pˆ1 − pˆ 2 )= standard error of the difference of two sample means 24 Two Independent Groups Statisticians have developed formulas for the standard error of the difference – These formulas depend on sample sizes in both groups and sample proportion in both groups Continued 25 Two Independent Groups The SE ( pˆ 1 − pˆ 2 ) is greater than either the SE ( p ˆ 1 ) or SE( pˆ 2 ) Why do you think this is? Continued 26 Two Independent Groups In the example . SE ( pˆ 1 − pˆ 2 ) = .036 SE ( pˆ 1 ) = .019 SE ( pˆ 2 ) = .031 27 Example 95% confidence interval for difference in proportions SE ( pˆ 1 − pˆ 2 ) -.15 ± 2 -.15 ± 2 *.036 -.15 ± .07 -0.22 to -0.08 28 Note The confidence interval does not include 0 29 The SE of the Difference in Sample Proportions Variation from independent sources can be added 2 2 Variance( pˆ − pˆ ) = [SE( pˆ )] + [SE( pˆ )] 1 2 1 2 pˆ1 (1 − pˆ1 ) pˆ 2 (1 − pˆ 2 ) Variance( pˆ1 − pˆ 2 ) = + n1 n2 Why do you think we add? Continued 30 The SE of the Difference in Sample Proportions Variation from independent sources can be added pˆ1 (1 − pˆ1 ) pˆ 2 (1 − pˆ 2 ) SE( pˆ1 − pˆ 2 ) = + n1 n2 31 Principle Formula depends on n1, n2, pˆ 1 , pˆ 2 There are other slightly different equations for (e.g. Altman, p.234) SE ( pˆ 1 − pˆ 2 ) But they all give similar answers 32 Simple Approximation Method to Compare Proportions Hypotheses H0: P1 = P2 Ha: P1 ≠ P2 Continued 33 Simple Approximation Method to Compare Proportions Hypotheses H0: P1 -P2 = 0 Ha: P1 -P2 ≠ 0 Continued 34 Simple Approximation Method to Compare Proportions Recall the general “recipe” for hypothesis testing: 1. State null and alternative hypotheses 2. Calculate test statistic based on sample 3. Compare test statistic to appropriate distribution to get p-value Continued 35 Simple Approximation Method to Compare Proportions Principle – General formula for test statistic . (observed diff ) - (null diff) test = SE of the difference 36 Comparing Proportions But since null difference is zero, this reduces to . (observed diff ) test = SE of the difference Continued 37 Comparing Proportions Principle – Estimate parameter (the difference) divide by SE of estimate pˆ − pˆ Z = 1 2 SE( pˆ1 − pˆ 2 ) 38 Two-Sample z-test for Comparing Proportions Which is just . pˆ − pˆ Z = 1 2 SE( pˆ1 − pˆ 2 ) .07 − (.22 ) − .15 z = = = −4.2 .036 .036 39 Note This is a two sample z-test for comparing two proportions – The value z = - 4.2 is the test statistic We calculate a p-value which is the probability of obtaining a test statistic as extreme as we did if H0 was true 40 How Are p-values Calculated? Is a result 4.2 standard errors below 0 unusual? – It depends on what kind of distribution we are dealing with Continued 41 How Are p-values Calculated? The p-value is the probability of getting a test statistic as or more extreme than what you observed (- 4.2) by chance if H0 was true The p-value comes from the sampling distribution of the difference in two sample proportions 42 Sampling Distribution What is sampling distribution of the difference in sample proportions? – If both groups are large then this distribution is approximately normal 43 AZT Study So, since both our samples are large our sampling distribution will be approximately normal – This sampling distribution will be centered at true difference, P1 -P2 – Under null hypothesis, this true difference is 0 Continued 44 AZT Study To compute a p-value, we would need to compute the probability of being 4.2 or more standard errors away from 0 on a standard normal curve - 4.2 4.2 0 Continued 45 AZT Study If we were to look this up on a normal table, we would find a very low p-value (p < .001) 46 Notes This method is also essentially equivalent to the chi-square (χ2) method – Gives about the same answer – (p-value) – We will discuss chi-square method next 47 Display Data in a 2x2 Table Two rows and two columns Contingency table Drug Group AZT Placebo 13 40 53 HIV Yes Transmission No 167 143 310 180 183 363 Continued 48 Display Data in a 2x2 Table Grand total Drug Group AZT Placebo 13