Learn R Programming

powerMediation (version 0.3.4)

SSizeLogisticCon: Calculating sample size for simple logistic regression with continuous predictor

Description

Calculating sample size for simple logistic regression with continuous predictor.

Usage

SSizeLogisticCon(p1, 
                 OR, 
                 alpha = 0.05, 
                 power = 0.8)

Arguments

p1

the event rate at the mean of the continuous predictor X in logistic regression \(logit(p) = a + b X\),

OR

Expected odds ratio. \(\log(OR)\) is the change in log odds for the difference between at the mean of \(X\) and at one SD above the mean.

alpha

Type I error rate.

power

power for testing if the odds ratio is equal to one.

Value

total sample size required.

Details

The logistic regression mode is $$ \log(p/(1-p)) = \beta_0 + \beta_1 X $$ where \(p=prob(Y=1)\), \(X\) is the continuous predictor, and \(\log(OR)\) is the the change in log odds for the difference between at the mean of \(X\) and at one SD above the mean. The sample size formula we used for testing if \(\beta_1=0\) or equivalently \(OR=1\), is Formula (1) in Hsieh et al. (1998): $$ n=(Z_{1-\alpha/2} + Z_{power})^2/[ p_1 (1-p_1) [log(OR)]^2 ] $$ where \(n\) is the required total sample size, \(OR\) is the odds ratio to be tested, \(p_1\) is the event rate at the mean of the predictor \(X\), and \(Z_u\) is the \(u\)-th percentile of the standard normal distribution.

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

powerLogisticCon

Examples

Run this code
# NOT RUN {
    ## Example in Table II Design (Balanced design (1)) of Hsieh et al. (1998 )
    ## the sample size is 317
    SSizeLogisticCon(p1 = 0.5, OR = exp(0.405), alpha = 0.05, power = 0.95)
# }

Run the code above in your browser using DataLab