powerLogisticBin {powerMediation} | R Documentation |
Calculating power for simple logistic regression with binary predictor
Description
Calculating power for simple logistic regression with binary predictor.
Usage
powerLogisticBin(n,
p1,
p2,
B,
alpha = 0.05)
Arguments
n |
total number of sample size. |
p1 |
|
p2 |
|
B |
|
alpha |
Type I error rate. |
Details
The logistic regression mode is
where ,
is the binary predictor,
,
,
, and
.
The sample size formula we used for testing if
, is Formula (2) in Hsieh et al. (1998):
where is the required total sample size and
is the
-th
percentile of the standard normal distribution.
Value
Estimated power.
Note
The test is a two-sided test. For one-sided tests, please double the
significance level. For example, you can set alpha=0.10
to obtain one-sided test at 5% significance level.
Author(s)
Weiliang Qiu stwxq@channing.harvard.edu
References
Hsieh, FY, Bloch, DA, and Larsen, MD. A SIMPLE METHOD OF SAMPLE SIZE CALCULATION FOR LINEAR AND LOGISTIC REGRESSION. Statistics in Medicine. 1998; 17:1623-1634.
See Also
Examples
## Example in Table I Design (Balanced design with high event rates)
## of Hsieh et al. (1998 )
## the power = 0.95
powerLogisticBin(n = 1281, p1 = 0.4, p2 = 0.5, B = 0.5, alpha = 0.05)