Hi,
I'm having a problem reconciling the sample size calculations with sampsi. which seem to be a bit off.
I'm using STATA 12 for Mac.
I am reviewing a research protocol where Drug A and Drug B are being used to look at chronic post-operative pain 1 year out. The expectation is that Drug A will result in pain 30% of the time, and the Drug B 10% of the time, with 80% power and a 95%confidence level.
Thus :
_____________________________________
________________________________________________
However, after doing some back of the enveloppe calculations where n = 2 *(zα/2 + zβ ) ^2*p∗ (1 − p∗ ) / delta^2
and I got after some rounding n=63.
Confused by this discrepancy, I checked my math with R and got:
I cannot understand why the sample size estimate with sampsi is larger than either my hand calculations or R. I tried looking at the base code with viewsource but nothing obvious jumped out at me.
I would appreciate if anyone could point out to me where the error is. If I have done something very silly please be kind.
Thanks,
Chris Labos
I'm having a problem reconciling the sample size calculations with sampsi. which seem to be a bit off.
I'm using STATA 12 for Mac.
I am reviewing a research protocol where Drug A and Drug B are being used to look at chronic post-operative pain 1 year out. The expectation is that Drug A will result in pain 30% of the time, and the Drug B 10% of the time, with 80% power and a 95%confidence level.
Thus :
_____________________________________
Code:
. sampsi .30 0.10, power(0.8) alpha(0.05)
Estimated sample size for two-sample comparison of proportions
Test Ho: p1 = p2, where p1 is the proportion in population 1
and p2 is the proportion in population 2
Assumptions:
alpha = 0.0500 (two-sided)
power = 0.8000
p1 = 0.3000
p2 = 0.1000
n2/n1 = 1.00
Estimated required sample sizes:
n1 = 72
n2 = 72
However, after doing some back of the enveloppe calculations where n = 2 *(zα/2 + zβ ) ^2*p∗ (1 − p∗ ) / delta^2
and I got after some rounding n=63.
Confused by this discrepancy, I checked my math with R and got:
Code:
> power.prop.test(p1=0.3, p2=0.1, power=0.8)
Two-sample comparison of proportions power calculation
n = 61.5988
p1 = 0.3
p2 = 0.1
sig.level = 0.05
power = 0.8
alternative = two.sided
NOTE: n is number in *each* group
I would appreciate if anyone could point out to me where the error is. If I have done something very silly please be kind.
Thanks,
Chris Labos

Comment