power2x2 | Power for testing two independent proportions | power2x2 |
x TO y BY z
, or a combination of these. However, you must surround the DIFF= value with
%STR()
if any commas appear in it. For example,
diff=.10 to .30 by .05 diff=%str(.10, .13, .20)
ALPHA=.05
sets the probability of a Type 1 error at 0.05. You may specify a single
value, or a list of values separated by commas, or a range of the form x TO y by z
. [Default: ALPHA=.05
]
x TO y BY z
, or a combination of these, as in a DO
statement. However, you must surround the POWER= value with
%STR()
if any commas appear in it.
NMIN=10
]
NMAX=200
] To get power for a single total sample size, set NMIN and NMAX to half of
the total sample size.
Y * X
or Y * X = Z
, where X, Y, and Z may be any of the variables N, DIFF, P2, POWER or OR.
No plots are produced if PLOT= is blank. [Default: PLOT=POWER
* N=DIFF
]
OUT=_POWER_
]
H0: p1 = p2 Ha: p1 ne p2
where p1 and p2 are the success probabilities in the two populations. The Pearson chi-square statistic tests the null hypothesis (H0) against the alternative hypothesis (Ha) and is available in the FREQ procedure when the CHISQ option is specified on the TABLES statement.
The power is the probability of rejecting H0 and is a function of the true difference in proportions. Power is often computed assuming many different settings of the true proportions. The type 2 error rate (denoted beta) is the probability of accepting H0 for some non-zero true difference and is equal to 1-power. The power and beta are computed for a range of total sample sizes at a particular alternative hypothesis that you specify. It is assumed that the total sample size will be split equally between the two samples.
%include vcd(power2x2); *-- or include in an autocall library; %power2x2( p1=.6, diff=.10 to .20 by .05, nmin=50);
With the settings above, the expected baseline success rate is 60%. Power for detecting a difference of 10-20% in the two proportions will be computed for a .05 level test and for sample sizes ranging from 50 to 200.