Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/powerLogisticsReg.R

Calculating power for simple logistic regression with continuous predictor.

1 2 3 4 | ```
powerLogisticCon(n,
p1,
OR,
alpha = 0.05)
``` |

`n` |
total sample size. |

`p1` |
the event rate at the mean of the continuous predictor |

`OR` |
Expected odds ratio. |

`alpha` |
Type I error rate. |

The logistic regression mode is

*
\log(p/(1-p)) = β_0 + β_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 *β_1=0* or equivalently
*OR=1*, is Formula (1) in Hsieh et al. (1998):

*
n=(Z_{1-α/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.

Estimated power.

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.

Weiliang Qiu stwxq@channing.harvard.edu

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.

1 2 3 | ```
## Example in Table II Design (Balanced design (1)) of Hsieh et al. (1998 )
## the power is 0.95
powerLogisticCon(n=317, p1=0.5, OR=exp(0.405), alpha=0.05)
``` |

```
[1] 0.9500611
```

powerMediation documentation built on March 24, 2021, 1:06 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.