powerConLogistic.con {powerSurvEpi} | R Documentation |
Sample Size Calculation for Conditional Logistic Regression with Continuous Covariate
Description
Sample Size Calculation for Conditional Logistic Regression with Continuous Covariate, such as matched logistic regression or nested case-control study.
Usage
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
)
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 |
sigma |
numeric. Standard deviation of the continuous exposure variable. |
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.1, Formulas (24) and (25))
and
where is the cumulative distribution function of the
standard normal distribution
,
is the upper
-th
percentile of
,
and is the Binomial coefficient (
chooses
),
, and
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
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