Description Usage Arguments Details Value References Examples
View source: R/powerConLogistic.R
Sample Size Calculation for Conditional Logistic Regression with Binary Covariate, such as matched logistic regression or nested case-control study.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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
)
|
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 =exp(θ), where θ is the regression coefficient of the exposure variable. |
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 |
The power and sample size calculation formulas are provided by Lachin (2008, Section 3.3, Formula (38))
power = Φ≤ft( √{N c} - z_{α/(2 nTests)}\right)
and
N = (z_{power} + z_{α/(2 nTests)})^2/ c
where Φ 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 = θ^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.
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.
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.