[R] Sample size for 2-sample proportion tests

From: Karl Knoblick <karlknoblich_at_yahoo.de>
Date: Wed, 28 May 2008 11:38:53 +0000 (GMT)

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!
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).



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


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


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


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,



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 28 May 2008 - 11:42:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 28 May 2008 - 12:30:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive