
Last chance! 50% off unlimited learning
Sale ends in
Sample Size Calculation for Conditional Logistic Regression with Continuous Covariate, such as matched logistic regression or nested case-control study.
powerConLogistic.con(
N = NULL,
power = 0.8,
OR,
sigma,
nD,
nH,
R2 = 0,
alpha = 0.05,
nTests = 1,
OR.low = 1.01,
OR.upp = 100
)
integer. Number of sets. Each set contains nD
cases and nH
controls.
numeric. Power of the test for if the exposure variable is associated with the risk of diseases
numeric. Odds ratio
numeric. Standard deviation of the continuous exposure variable.
integer. Number of cases per set.
integer. Number of controls per set.
numeric. Coefficient of determination of the exposure variable and other covariates
numeric. family-wise type I error rate.
integer. Number of tests.
numeric. Lower bound of odds ratio. Only used when OR=NULL
and power
and N
are not equal to NULL.
numeric. Upper bound of odds ratio. Only used when OR=NULL
and power
and N
are not equal to NULL.
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.
The power and sample size calculation formulas are provided by Lachin (2008, Section 3.1, Formulas (24) and (25))
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
# NOT RUN {
library(pracma)
# Section 4.1 in Lachin (2008)
# estimate number of sets
N = powerConLogistic.con(N = NULL,
power = 0.85,
OR = 1.39,
sigma = 1,
nD = 1,
nH = 2,
R2 = 0,
alpha = 0.05,
nTests = 1)
print(ceiling(N)) # 125
# estimate power
power = powerConLogistic.con(N = 125,
power = NULL,
OR = 1.39,
sigma = 1,
nD = 1,
nH = 2,
R2 = 0,
alpha = 0.05,
nTests = 1)
print(power) # 0.85
# estimate OR
OR = powerConLogistic.con(N = 125,
power = 0.85,
OR = NULL,
sigma = 1,
nD = 1,
nH = 2,
R2 = 0,
alpha = 0.05,
nTests = 1)
print(OR) # 1.39
# }
Run the code above in your browser using DataLab