powerConLogistic.bin {powerSurvEpi} | R Documentation |
Sample Size Calculation for Conditional Logistic Regression with Binary Covariate
Description
Sample Size Calculation for Conditional Logistic Regression with Binary Covariate, such as matched logistic regression or nested case-control study.
Usage
powerConLogistic.bin(
N = NULL,
power = 0.8,
OR,
pE,
nD,
nH,
R2 = 0,
alpha = 0.05,
nTests = 1,
OR.low = 1.01,
OR.upp = 100
)
Arguments
N |
integer. Number of sets. Each set contains |
power |
numeric. Power of the test for if the exposure variable is associated with the risk of diseases |
OR |
numeric. Odds ratio |
pE |
numeric. Population prevalence of exposure. |
nD |
integer. Number of cases per set. |
nH |
integer. Number of controls per set. |
R2 |
numeric. Coefficient of determination of the exposure variable and other covariates |
alpha |
numeric. family-wise type I error rate. |
nTests |
integer. Number of tests. |
OR.low |
numeric. Lower bound of odds ratio. Only used when |
OR.upp |
numeric. Upper bound of odds ratio. Only used when |
Details
The power and sample size calculation formulas are provided by Lachin (2008, Section 3.3, Formula (38))
power = \Phi\left( \sqrt{N c} - z_{\alpha/(2 nTests)}\right)
and
N = (z_{power} + z_{\alpha/(2 nTests)})^2/ c
where \Phi
is the cumulative distribution function of the
standard normal distribution N(0, 1)
, z_{a}
is the upper 100 a
-th
percentile of N(0, 1)
,
c = \theta^2 pE (1-pE) (1-R^2)nD*nH/(nD+nH)
and R^2
is the coefficient of determination for linear regression
linking the exposure with other covariates.
Value
If the inputs is.null(N) = TRUE
and is.null(power) = FALSE
,
then the function returns the number N
of sets.
If the inputs is.null(N) = FALSE
and is.null(power) = TRUE
,
then the function returns the power.
Otherwise, an error message is output.
References
Lachin, JM Sample Size Evaluation for a Multiply Matched Case-Control Study Using the Score Test From a Conditional Logistic (Discrete Cox PH) Regression Model. Stat Med. 2008 27(14): 2509-2523
Examples
# estimate power
power = powerConLogistic.bin(
N = 59,
power = NULL,
OR = 3.5,
pE = 0.15,
nD = 1,
nH = 2,
R2 = 0,
alpha = 0.05,
nTests = 1)
print(power) # 0.80
# estimate N (number of sets)
N = powerConLogistic.bin(
N = NULL,
power = 0.80,
OR = 3.5,
pE = 0.15,
nD = 1,
nH = 2,
R2 = 0,
alpha = 0.05,
nTests = 1)
print(ceiling(N)) # 59
# estimate OR
OR = powerConLogistic.bin(
N = 59,
power = 0.80,
OR = NULL,
pE = 0.15,
nD = 1,
nH = 2,
R2 = 0,
alpha = 0.05,
nTests = 1,
OR.low = 1.01,
OR.upp = 100)
print(OR) # 3.49