[R] Sample size for 2-sample proportion tests

Karl Knoblick karlknoblich at yahoo.de
Wed May 28 13:38:53 CEST 2008


Hallo!
I found a question exactly as mine, but I did not found an answer. Therefore I post this again - hopefully there will be an answer!
Thanks in advance!
karl
From: Berta <ibanez> 
Date: Tue, 27 Feb 2007 18:58:48 +0100

Hi R-users, 
I want to calculate the sample size needed to carry out a 2-sample 
proprotion test. 
I have the hypotesized treatment probability of success (0.80), the 
hypotesized control probability of success (0.05), and also de proportion of 
the sample devoted to treated group (5%), (fraction=rho=0.05, n2/n1=19). 
Using the Hsmisc library, it seemss that I can use bsamsize (option 1) or 
samplesize.bin (option 2, alpha=0.05 or option 3 alpha=0.05/2, I am not sure 
after reading the help page) and I can use STATA (option 4). 

library(Hmisc) 

#OPTION 1: 
bsamsize(p1=0.8, p2=0.05, fraction=0.05, alpha=.05, power=.9) 
# n1 =2.09, n2=39.7, TOTAL=42 

#OPTION 2: 
samplesize.bin(alpha=0.05, beta=0.9, pit=0.8, pic=0.05, rho=0.05) 
# n= 58, TOTAL= 58 

#OPTION 3: 
samplesize.bin(alpha=0.025, beta=0.9, pit=0.8, pic=0.05, rho=0.05) 
# n= 72, TOTAL= 72 

#OPTION 4: 
sampsi 0.8 0.05, p(0.90) a(0.05) r(19) 
# n1=4, n2 = 76 TOTAL=80 

Can the method used produces the differences (42 vs 72 vs 80)? Can somebody 
give me hints about the possible reasons (asymptotic-exact distribution- 
continuity correction-my own error)? Which method would be recomended? 

Thanks a lot in advance, 

Berta 



      __________________________________________________________
Ge
.mail.yahoo.com



More information about the R-help mailing list