Title: | Power and Sample Size Calculation for Survival Analysis of Epidemiological Studies |
---|---|
Description: | Functions to calculate power and sample size for testing main effect or interaction effect in the survival analysis of epidemiological studies (non-randomized studies), taking into account the correlation between the covariate of the interest and other covariates. Some calculations also take into account the competing risks and stratified analysis. This package also includes a set of functions to calculate power and sample size for testing main effect in the survival analysis of randomized clinical trials and conditional logistic regression for nested case-control study. |
Authors: | Weiliang Qiu, Jorge Chavarro, Ross Lazarus, Bernard Rosner, Jing Ma. |
Maintainer: | Weiliang Qiu <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.3 |
Built: | 2024-11-09 04:22:13 UTC |
Source: | https://github.com/cran/powerSurvEpi |
Calculate number of deaths required for Cox proportional hazards regression with two covariates for epidemiological Studies. The covariate of interest should be a binary variable. The other covariate can be either binary or non-binary. The formula takes into account competing risks and the correlation between the two covariates. Some parameters will be estimated based on a pilot data set.
numDEpi(X1, X2, power, theta, alpha = 0.05)
numDEpi(X1, X2, power, theta, alpha = 0.05)
X1 |
numeric. a |
X2 |
numeric. a |
power |
numeric. the postulated power. |
theta |
numeric. postulated hazard ratio |
alpha |
numeric. type I error rate. |
This is an implementation of the calculation of the number of required deaths derived by Latouche et al. (2004) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is of our interest. The covariate
should be
a binary variable taking two possible values: zero and one, while the
covariate
can be binary or continuous.
Suppose we want to check if the hazard of is equal to
the hazard of
or not. Equivalently, we want to check if
the hazard ratio of
to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of deaths required to achieve a power of
is
where is the
-th percentile of the standard normal distribution,
and
,
,
,
and
.
and
will be estimated from a pilot data set.
D |
the number of deaths required to achieve the desired power with given type I error rate. |
p |
proportion of subjects taking |
rho2 |
square of the correlation between |
(1) The formula can be used to calculate
power for a randomized trial study by setting rho2=0
.
(2) When rho2=0
, the formula derived by Latouche et al. (2004)
looks the same as that derived by Schoenfeld (1983). Latouche et al. (2004) pointed out that in this situation, the interpretations are different hence
the two formulae are actually different. In Latouched et al. (2004), the
hazard ratio measures the difference of effect of a covariate
at two different levels on the subdistribution hazard for a particular failure,
while in Schoenfeld (1983), the hazard ratio
measures
the difference of effect on the cause-specific hazard.
Schoenfeld DA. (1983). Sample-size formula for the proportional-hazards regression model. Biometrics. 39:499-503.
Latouche A., Porcher R. and Chevret S. (2004). Sample size formula for proportional hazards modelling of competing risks. Statistics in Medicine. 23:3263-3274.
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) res <- numDEpi(X1 = X1, X2 = X2, power = 0.8, theta = 2, alpha = 0.05) print(res) # proportion of subjects died of the disease of interest. psi <- 0.505 # total number of subjects required to achieve the desired power ceiling(res$D / psi)
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) res <- numDEpi(X1 = X1, X2 = X2, power = 0.8, theta = 2, alpha = 0.05) print(res) # proportion of subjects died of the disease of interest. psi <- 0.505 # total number of subjects required to achieve the desired power ceiling(res$D / psi)
Calculate number of deaths required for Cox proportional hazards regression with two covariates for epidemiological Studies. The covariate of interest should be a binary variable. The other covariate can be either binary or non-binary. The formula takes into account competing risks and the correlation between the two covariates.
numDEpi.default(power, theta, p, rho2, alpha = 0.05)
numDEpi.default(power, theta, p, rho2, alpha = 0.05)
power |
numeric. the postulated power. |
theta |
numeric. postulated hazard ratio |
p |
numeric. proportion of subjects taking the value one for the covariate of interest. |
rho2 |
numeric. square of the correlation between the covariate of interest and the other covariate. |
alpha |
numeric. type I error rate. |
This is an implementation of the calculation of the number of required deaths derived by Latouche et al. (2004) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is of our interest. The covariate
should be
a binary variable taking two possible values: zero and one, while the
covariate
can be binary or continuous.
Suppose we want to check if the hazard of is equal to
the hazard of
or not. Equivalently, we want to check if
the hazard ratio of
to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of deaths required to achieve a power of
is
where is the
-th percentile of the standard normal distribution,
and
,
,
,
and
.
The number of deaths required to achieve the desired power with given type I error rate.
(1) The formula can be used to calculate
power for a randomized trial study by setting rho2=0
.
(2) When rho2=0
, the formula derived by Latouche et al. (2004)
looks the same as that derived by Schoenfeld (1983). Latouche et al. (2004) pointed out that in this situation, the interpretations are different hence
the two formulae are actually different. In Latouched et al. (2004), the
hazard ratio measures the difference of effect of a covariate
at two different levels on the subdistribution hazard for a particular failure,
while in Schoenfeld (1983), the hazard ratio
measures
the difference of effect on the cause-specific hazard.
Schoenfeld DA. (1983). Sample-size formula for the proportional-hazards regression model. Biometrics. 39:499-503.
Latouche A., Porcher R. and Chevret S. (2004). Sample size formula for proportional hazards modelling of competing risks. Statistics in Medicine. 23:3263-3274.
# Example at the end of Section 5.2 of Latouche et al. (2004) # for a cohort study. D <- numDEpi.default(power = 0.8, theta = 2, p = 0.39, rho2 = 0.132^2, alpha = 0.05) # proportion of subjects died of the disease of interest. psi <- 0.505 # total number of subjects required to achieve the desired power ceiling(D / psi)
# Example at the end of Section 5.2 of Latouche et al. (2004) # for a cohort study. D <- numDEpi.default(power = 0.8, theta = 2, p = 0.39, rho2 = 0.132^2, alpha = 0.05) # proportion of subjects died of the disease of interest. psi <- 0.505 # total number of subjects required to achieve the desired power ceiling(D / psi)
The Ophthalmology data set is described in Example 14.41 on page 807 in Rosner (2006).
data(Oph)
data(Oph)
A data frame with 354 observations on the following 3 variables.
times
a numeric vector recording the survival/censoring time for each event/censoring.
status
a numeric vector recording if a observed time is event time (status=1
)
or censoring time (status=0
).
group
a factor with levels C
(indicating control group) and E
(indicating
experimental group).
This data set was from a clinical trial (Berson et al., 1993) conducted to test the efficacy of different vitamin supplements in preventing visual loss in patients with retinitis pigmentosa. Rosner (2006) used the data from this clinical trial to illustrate the analysis of survival data (Sections 14.9-14.12 of Rosner (2006)).
The data set consists of two groups of participants: (1) the experimental group (i.e., group E in which participants receiving 15,000 IU of vitamin A per day) and (2) the control group (i.e., group C in which participants receiving 75 IU of vitamin A per day).
The participants were enrolled over a 2-year period (1984-1987) and followed for a maximum of 6 years. The follow-up was terminated in September 1991. Some participants dropped out of the study before September 1991 and had not failed. Dropouts were due to death, other diseases, or side effects possibly due to the study medications, or unwillingness to comply (take study medications). There are 6 time points (at 1st year, 2nd year, 3rd year, 4th year, 5-th year, and 6-th year) in this data set.
Rosner (2006, page 786) defined
the participants who do not reach a disease endpoint during their period of follow-up as censored observations.
A participant has been censored at time if the participant has been followed up to time
and has
not failed. Noninformative censoring is assumed. That is, participants who are censored have the same
underlying survival curve after their censoring time as patients who are not censored.
Created based on Table 14.12 on page 787 of Rosner (2006).
Berson, E.L., Rosner, B., Sandberg, M.A., Hayes, K.C., Nicholson, B.W., Weigel-DiFranco, C., and Willett, W.C. (1993). A randomized trial of vitamin A and vitamin E supplementation for retinitis pigmentosa. Archives of Ophthalmology. 111:761-772.
Rosner B. (2006). Fundamentals of Biostatistics. (6-th edition). Thomson Brooks/Cole.
data(Oph)
data(Oph)
Power calculation for survival analysis with binary predictor and exponential survival function.
power.stratify( n, timeUnit, gVec, PVec, HR, lambda0Vec, power.ini = 0.8, power.low = 0.001, power.upp = 0.999, alpha = 0.05, verbose = TRUE)
power.stratify( n, timeUnit, gVec, PVec, HR, lambda0Vec, power.ini = 0.8, power.low = 0.001, power.upp = 0.999, alpha = 0.05, verbose = TRUE)
n |
integer. Sample size. |
timeUnit |
numeric. Total study length. |
gVec |
numerc. m by 1 vector. The s-th element is the proportion of the total sample size for the s-th stratum, where m is the number of strata. |
PVec |
numeric. m by 1 vector. The s-th element is the proportion of subjects in treatment group 1 for the s-th stratum, where m is the number of strata. |
HR |
numeric. Hazard ratio (Ratio of the hazard for treatment group 1 to the hazard for treatment group 0, i.e. reference group). |
lambda0Vec |
numeric. m by 1 vector. The s-th element is the hazard for treatment group 0 (i.e., reference group) in the s-th stratum. |
power.ini |
numeric. Initial power estimate. |
power.low |
numeric. Lower bound for power. |
power.upp |
numeric. Upper bound for power. |
alpha |
numeric. Type I error rate. |
verbose |
Logical. Indicating if intermediate results will be output or not. |
We assume (1) there is only one predictor and no covariates in the survival model
(exponential survival function); (2) there are m
strata; (3) the predictor x
is a binary variable indicating treatment group 1 () or treatment group 0
(
); (3) the treatment effect is constant over time (proportional hazards);
(4) the hazard ratio is the same in all strata, and (5) the data will be analyzed by
the stratified log rank test.
The sample size formula is Formula (1) on page 801 of Palta M and Amini SB (1985):
where is the Type I error rate,
is the Type II error rate (power
),
is the
-th percentile of standard normal distribution, and
and
In the above formulas, is the number of strata,
is the total study length,
is the hazard ratio,
is the proportion of the total sample size in stratum
,
is the proportion of stratum
, which is in treatment group 1,
and
is the hazard for the
-th treatment group in
stratum
.
A list of 2 elments.
power |
Estimated power |
res.optim |
Object returned by funciton |
Palta M and Amini SB. (1985). Consideration of covariates and stratification in sample size determination for survival time studies. Journal of Chronic Diseases. 38(9):801-809.
# example on page 803 of Palta M and Amini SB. (1985). res.power <- power.stratify( n = 146, timeUnit = 1.25, gVec = c(0.5, 0.5), PVec = c(0.5, 0.5), HR = 1 / 1.91, lambda0Vec = c(2.303, 1.139), power.ini = 0.8, power.low = 0.001, power.upp = 0.999, alpha = 0.05, verbose = TRUE )
# example on page 803 of Palta M and Amini SB. (1985). res.power <- power.stratify( n = 146, timeUnit = 1.25, gVec = c(0.5, 0.5), PVec = c(0.5, 0.5), HR = 1 / 1.91, lambda0Vec = c(2.303, 1.139), power.ini = 0.8, power.low = 0.001, power.upp = 0.999, alpha = 0.05, verbose = TRUE )
Sample Size Calculation for Conditional Logistic Regression with Binary Covariate, such as matched logistic regression or nested case-control study.
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 )
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 |
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))
and
where is the cumulative distribution function of the
standard normal distribution
,
is the upper
-th
percentile of
,
and 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
# 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
# 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
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 )
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 )
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 |
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.
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
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
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
Power calculation for the Comparison of Survival Curves Between Two Groups under the Cox Proportional-Hazards Model for clinical trials. Some parameters will be estimated based on a pilot data set.
powerCT(formula, dat, nE, nC, RR, alpha = 0.05)
powerCT(formula, dat, nE, nC, RR, alpha = 0.05)
formula |
A formula object, e.g. |
dat |
a data frame representing the pilot data set and containing at least 3 columns: (1) survival/censoring time; (2) censoring indicator;
(3) group indicator which is a factor object in R and takes only two possible values ( |
nE |
integer. number of participants in the experimental group. |
nC |
integer. number of participants in the control group. |
RR |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation method described in Section 14.12 (page 807) of Rosner (2006). The method was proposed by Freedman (1982).
The movitation of this function is that some times we do not have information about or
and
available, but we have a pilot data set that can be used to estimate
and
hence
, where
is the expected total number of events over both groups,
and
are numbers of participants in group E (experimental group) and group C (control group), respectively.
is the probability of failure in group E (experimental group) over the maximum time period of the study (t years).
is the probability of failure in group C (control group) over the maximum time period of the study
(t years).
Suppose we want to compare the survival curves between an experimental group () and
a control group (
) in a clinical trial with a maximum follow-up of
years.
The Cox proportional hazards regression model is assumed to have the form:
Let be the number of participants in the
group
and
be the number of participants in the
group.
We wish to test the hypothesis
versus
not equal to 1,
where
underlying hazard ratio
for the
group versus the
group. Let
be the postulated hazard ratio,
be the significance level. Assume that the test is a two-sided test.
If the ratio of participants in group
E compared to group C
, then the power of the test is
where
and
is the
-th percentile of
the standard normal distribution
,
is the cumulative distribution function (CDF)
of
.
and
can be calculated from the following formulaes:
where ,
,
,
,
. And
is the probability of failure at time
i
among participants in the
control group, given that a participant has survived to time and is not censored at time
,
i.e., the approximate hazard time
in the control group,
;
is the probability of failure at time
i
among participants in the
experimental group, given that a participant has survived to time and is not censored at time
,
i.e., the approximate hazard time
in the experimental group,
;
is the prbability that a participant is censored at time
given that he was
followed up to time
and has not failed,
, which is assumed the same in each group.
mat.lambda |
a matrix with 9 columns and |
mat.event |
a matrix with 5 columns and |
pC |
estimated probability of failure in group C (control group) over the maximum time period of the study (t years). |
pE |
estimated probability of failure in group E (experimental group) over the maximum time period of the study (t years). |
power |
the power of the test. |
(1) The estimates of . That is,
RRlambda
is not directly estimated based on data
from the experimental group;
(2) The power formula assumes that the central-limit theorem is valid and hence is appropriate for large samples.
Freedman, L.S. (1982). Tables of the number of patients required in clinical trials using the log-rank test. Statistics in Medicine. 1: 121-129
Rosner B. (2006). Fundamentals of Biostatistics. (6-th edition). Thomson Brooks/Cole.
powerCT.default0
,
powerCT.default
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 library(survival) data(Oph) res <- powerCT(formula = Surv(times, status) ~ group, dat = Oph, nE = 200, nC = 200, RR = 0.7, alpha = 0.05) # Table 14.24 on page 809 of Rosner (2006) print(round(res$mat.lambda, 4)) # Table 14.12 on page 787 of Rosner (2006) print(round(res$mat.event, 4)) # the power print(round(res$power, 2))
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 library(survival) data(Oph) res <- powerCT(formula = Surv(times, status) ~ group, dat = Oph, nE = 200, nC = 200, RR = 0.7, alpha = 0.05) # Table 14.24 on page 809 of Rosner (2006) print(round(res$mat.lambda, 4)) # Table 14.12 on page 787 of Rosner (2006) print(round(res$mat.event, 4)) # the power print(round(res$power, 2))
Power calculation for the Comparison of Survival Curves Between Two Groups under the Cox Proportional-Hazards Model for clinical trials.
powerCT.default(nE, nC, pE, pC, RR, alpha = 0.05)
powerCT.default(nE, nC, pE, pC, RR, alpha = 0.05)
nE |
integer. number of participants in the experimental group. |
nC |
integer. number of participants in the control group. |
pE |
numeric. probability of failure in group E (experimental group) over the maximum time period of the study (t years). |
pC |
numeric. probability of failure in group C (control group) over the maximum time period of the study (t years). |
RR |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation method described in Section 14.12 (page 807) of Rosner (2006). The method was proposed by Freedman (1982).
Suppose we want to compare the survival curves between an experimental group () and
a control group (
) in a clinical trial with a maximum follow-up of
years.
The Cox proportional hazards regression model is assumed to have the form:
Let be the number of participants in the
group
and
be the number of participants in the
group.
We wish to test the hypothesis
versus
not equal to 1,
where
underlying hazard ratio
for the
group versus the
group. Let
be the postulated hazard ratio,
be the significance level. Assume that the test is a two-sided test.
If the ratio of participants in group
E compared to group C
, then the power of the test is
where
and
is the
-th percentile of
the standard normal distribution
,
is the cumulative distribution function (CDF)
of
.
The power of the test.
The power formula assumes that the central-limit theorem is valid and hence is appropriate for large samples.
Freedman, L.S. (1982). Tables of the number of patients required in clinical trials using the log-rank test. Statistics in Medicine. 1: 121-129
Rosner B. (2006). Fundamentals of Biostatistics. (6-th edition). Thomson Brooks/Cole.
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 powerCT.default(nE = 200, nC = 200, pE = 0.3707, pC = 0.4890, RR = 0.7, alpha = 0.05)
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 powerCT.default(nE = 200, nC = 200, pE = 0.3707, pC = 0.4890, RR = 0.7, alpha = 0.05)
Power calculation for the Comparison of Survival Curves Between Two Groups under the Cox Proportional-Hazards Model for clinical trials.
powerCT.default0(k, m, RR, alpha = 0.05)
powerCT.default0(k, m, RR, alpha = 0.05)
k |
numeric. ratio of participants in group E (experimental group) compared to group C (control group). |
m |
integer. expected total number of events over both groups. |
RR |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation method described in Section 14.12 (page 807) of Rosner (2006). The method was proposed by Freedman (1982).
Suppose we want to compare the survival curves between an experimental group () and
a control group (
) in a clinical trial with a maximum follow-up of
years.
The Cox proportional hazards regression model is assumed to have the form:
Let be the number of participants in the
group
and
be the number of participants in the
group.
We wish to test the hypothesis
versus
not equal to 1,
where
underlying hazard ratio
for the
group versus the
group. Let
be the postulated hazard ratio,
be the significance level. Assume that the test is a two-sided test.
If the ratio of participants in group
E compared to group C
, then the power of the test is
where
is the
-th percentile of
the standard normal distribution
,
is the cumulative distribution function (CDF)
of
.
The power of the test.
The power formula assumes that the central-limit theorem is valid and hence is appropriate for large samples.
Freedman, L.S. (1982). Tables of the number of patients required in clinical trials using the log-rank test. Statistics in Medicine. 1: 121-129
Rosner B. (2006). Fundamentals of Biostatistics. (6-th edition). Thomson Brooks/Cole.
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 powerCT.default0(k = 1, m = 171.9, RR = 0.7, alpha = 0.05)
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 powerCT.default0(k = 1, m = 171.9, RR = 0.7, alpha = 0.05)
Power calculation for Cox proportional hazards regression with two covariates for epidemiological Studies. The covariate of interest should be a binary variable. The other covariate can be either binary or non-binary. The formula takes into account competing risks and the correlation between the two covariates. Some parameters will be estimated based on a pilot data set.
powerEpi(X1, X2, failureFlag, n, theta, alpha = 0.05)
powerEpi(X1, X2, failureFlag, n, theta, alpha = 0.05)
X1 |
numeric. a |
X2 |
numeric. a |
failureFlag |
numeric. a |
n |
integer. total number of subjects |
theta |
numeric. postulated hazard ratio |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation formula derived by Latouche et al. (2004) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is of our interest. The covariate
should be
a binary variable taking two possible values: zero and one, while the
covariate
can be binary or continuous.
Suppose we want to check if the hazard of is equal to
the hazard of
or not. Equivalently, we want to check if
the hazard ratio of
to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the power
required to detect a hazard ratio as small as
is
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
and
,
,
,
and
.
,
, and
will be estimated from a pilot data set.
power |
the power of the test. |
p |
proportion of subjects taking |
rho2 |
square of the correlation between |
psi |
proportion of subjects died of the disease of interest. |
(1) The formula can be used to calculate
power for a randomized trial study by setting rho2=0
.
(2) When , the formula derived by Latouche et al. (2004)
looks the same as that derived by Schoenfeld (1983). Latouche et al. (2004) pointed out that in this situation, the interpretations are different hence
the two formulae are actually different. In Latouched et al. (2004), the
hazard ratio
measures the difference of effect of a covariate
at two different levels on the subdistribution hazard for a particular failure,
while in Schoenfeld (1983), the hazard ratio
measures
the difference of effect on the cause-specific hazard.
Schoenfeld DA. (1983). Sample-size formula for the proportional-hazards regression model. Biometrics. 39:499-503.
Latouche A., Porcher R. and Chevret S. (2004). Sample size formula for proportional hazards modelling of competing risks. Statistics in Medicine. 23:3263-3274.
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.5, 0.5), replace = TRUE) powerEpi(X1 = X1, X2 = X2, failureFlag = failureFlag, n = 139, theta = 2, alpha = 0.05)
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.5, 0.5), replace = TRUE) powerEpi(X1 = X1, X2 = X2, failureFlag = failureFlag, n = 139, theta = 2, alpha = 0.05)
Power calculation for Cox proportional hazards regression with two covariates for epidemiological Studies. The covariate of interest should be a binary variable. The other covariate can be either binary or non-binary. The formula takes into account competing risks and the correlation between the two covariates.
powerEpi.default(n, theta, p, psi, rho2, alpha = 0.05)
powerEpi.default(n, theta, p, psi, rho2, alpha = 0.05)
n |
integer. total number of subjects |
theta |
numeric. postulated hazard ratio |
p |
numeric. proportion of subjects taking the value one for the covariate of interest. |
psi |
numeric. proportion of subjects died of the disease of interest. |
rho2 |
numeric. square of the correlation between the covariate of interest and the other covariate. |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation formula derived by Latouche et al. (2004) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is of our interest. The covariate
should be
a binary variable taking two possible values: zero and one, while the
covariate
can be binary or continuous.
Suppose we want to check if the hazard of is equal to
the hazard of
or not. Equivalently, we want to check if
the hazard ratio of
to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the power
required to detect a hazard ratio as small as
is
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
and
,
,
,
and
.
The power of the test.
(1) The formula can be used to calculate
power for a randomized trial study by setting rho2=0
.
(2) When rho2=0
, the formula derived by Latouche et al. (2004)
looks the same as that derived by Schoenfeld (1983). Latouche et al. (2004) pointed out that in this situation, the interpretations are different hence
the two formulae are actually different. In Latouched et al. (2004), the
hazard ratio measures the difference of effect of a covariate
at two different levels on the subdistribution hazard for a particular failure,
while in Schoenfeld (1983), the hazard ratio
measures
the difference of effect on the cause-specific hazard.
Schoenfeld DA. (1983). Sample-size formula for the proportional-hazards regression model. Biometrics. 39:499-503.
Latouche A., Porcher R. and Chevret S. (2004). Sample size formula for proportional hazards modelling of competing risks. Statistics in Medicine. 23:3263-3274.
# Example at the end of Section 5.2 of Latouche et al. (2004) # for a cohort study. powerEpi.default(n = 139, theta = 2, p = 0.39, psi = 0.505, rho2 = 0.132^2, alpha = 0.05)
# Example at the end of Section 5.2 of Latouche et al. (2004) # for a cohort study. powerEpi.default(n = 139, theta = 2, p = 0.39, psi = 0.505, rho2 = 0.132^2, alpha = 0.05)
Power calculation for Cox proportional hazards regression with nonbinary covariates for Epidemiological Studies. Some parameters will be estimated based on a pilot data set.
powerEpiCont(formula, dat, var.X1, var.failureFlag, n, theta, alpha = 0.05)
powerEpiCont(formula, dat, var.X1, var.failureFlag, n, theta, alpha = 0.05)
formula |
a formula object relating the covariate of interest
to other covariates to calculate the multiple correlation coefficient. The
variables in formula must be in the data frame |
dat |
a |
var.X1 |
character. name of the column in the data frame |
var.failureFlag |
character. name of the column in the data frame |
n |
integer. total number of subjects. |
theta |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation formula derived by Hsieh and Lavori (2000) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is a nonbinary variable and
is a vector of other covariates.
Suppose we want to check if
the hazard ratio of the main effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the power
required to detect a hazard ratio as small as
is
where is the
-th percentile of the standard normal distribution,
,
is the proportion of subjects died of
the disease of interest, and
is the multiple correlation coefficient
of the following linear regression:
That is, , where
is the proportion of variance
explained by the regression of
on the vector of covriates
.
will be estimated from a pilot study.
power |
The power of the test. |
rho2 |
square of the correlation between |
sigma2 |
variance of the covariate of interest. |
psi |
proportion of subjects died of the disease of interest. |
(1) Hsieh and Lavori (2000) assumed one-sided test, while this implementation assumed two-sided test.
(2) The formula can be used to calculate
power for a randomized trial study by setting rho2=0
.
Hsieh F.Y. and Lavori P.W. (2000). Sample-size calculation for the Cox proportional hazards regression model with nonbinary covariates. Controlled Clinical Trials. 21:552-560.
# generate a toy pilot data set set.seed(123456) X1 <- rnorm(100, mean = 0, sd = 0.3126) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.25, 0.75), replace = TRUE) dat <- data.frame(X1 = X1, X2 = X2, failureFlag = failureFlag) powerEpiCont(formula = X1 ~ X2, dat = dat, var.X1 = "X1", var.failureFlag = "failureFlag", n = 107, theta = exp(1), alpha = 0.05)
# generate a toy pilot data set set.seed(123456) X1 <- rnorm(100, mean = 0, sd = 0.3126) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.25, 0.75), replace = TRUE) dat <- data.frame(X1 = X1, X2 = X2, failureFlag = failureFlag) powerEpiCont(formula = X1 ~ X2, dat = dat, var.X1 = "X1", var.failureFlag = "failureFlag", n = 107, theta = exp(1), alpha = 0.05)
Power calculation for Cox proportional hazards regression with nonbinary covariates for Epidemiological Studies.
powerEpiCont.default(n, theta, sigma2, psi, rho2, alpha = 0.05)
powerEpiCont.default(n, theta, sigma2, psi, rho2, alpha = 0.05)
n |
integer. total number of subjects. |
theta |
numeric. postulated hazard ratio. |
sigma2 |
numeric. variance of the covariate of interest. |
psi |
numeric. proportion of subjects died of the disease of interest. |
rho2 |
numeric. square of the multiple correlation coefficient between the covariate of interest and other covariates. |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation formula derived by Hsieh and Lavori (2000) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is a nonbinary variable and
is a vector of other covariates.
Suppose we want to check if
the hazard ratio of the main effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the power
required to detect a hazard ratio as small as
is
where is the
-th percentile of the standard normal distribution,
,
is the proportion of subjects died of
the disease of interest, and
is the multiple correlation coefficient
of the following linear regression:
That is, , where
is the proportion of variance
explained by the regression of
on the vector of covriates
.
The power of the test.
(1) Hsieh and Lavori (2000) assumed one-sided test, while this implementation assumed two-sided test.
(2) The formula can be used to calculate
power for a randomized trial study by setting rho2=0
.
Hsieh F.Y. and Lavori P.W. (2000). Sample-size calculation for the Cox proportional hazards regression model with nonbinary covariates. Controlled Clinical Trials. 21:552-560.
# example in the EXAMPLE section (page 557) of Hsieh and Lavori (2000). # Hsieh and Lavori (2000) assumed one-sided test, # while this implementation assumed two-sided test. # Hence alpha=0.1 here (two-sided test) will correspond # to alpha=0.05 of one-sided test in Hsieh and Lavori's (2000) example. powerEpiCont.default(n = 107, theta = exp(1), sigma2 = 0.3126^2, psi = 0.738, rho2 = 0.1837, alpha = 0.1)
# example in the EXAMPLE section (page 557) of Hsieh and Lavori (2000). # Hsieh and Lavori (2000) assumed one-sided test, # while this implementation assumed two-sided test. # Hence alpha=0.1 here (two-sided test) will correspond # to alpha=0.05 of one-sided test in Hsieh and Lavori's (2000) example. powerEpiCont.default(n = 107, theta = exp(1), sigma2 = 0.3126^2, psi = 0.738, rho2 = 0.1837, alpha = 0.1)
Power calculation testing interaction effect for Cox proportional hazards regression with two covariates for Epidemiological Studies. Both covariates should be binary variables. The formula takes into account the correlation between the two covariates. Some parameters will be estimated based on a pilot study.
powerEpiInt(X1, X2, failureFlag, n, theta, alpha = 0.05)
powerEpiInt(X1, X2, failureFlag, n, theta, alpha = 0.05)
X1 |
numeric. a |
X2 |
numeric. a |
failureFlag |
numeric.a |
n |
integer. total number of subjects. |
theta |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation formula derived by Schmoor et al. (2000) for the following Cox proportional hazards regression in the epidemoilogical studies:
where both covariates and
are binary variables.
Suppose we want to check if
the hazard ratio of the interaction effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the power
required to detect a hazard ratio as small as
is:
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
,
,
,
.
,
,
,
, and
will be
estimated from the pilot data.
power |
the power of the test. |
p |
estimated |
q |
estimated |
p0 |
estimated |
p1 |
estimated |
rho2 |
square of the estimated |
G |
a factor adjusting the sample size. The sample size needed to
detect an effect of a prognostic factor with given error probabilities has
to be multiplied by the factor |
mya |
estimated number of subjects taking values |
myb |
estimated number of subjects taking values |
myc |
estimated number of subjects taking values |
myd |
estimated number of subjects taking values |
psi |
proportion of subjects died of the disease of interest. |
Schmoor C., Sauerbrei W., and Schumacher M. (2000). Sample size considerations for the evaluation of prognostic factors in survival analysis. Statistics in Medicine. 19:441-452.
powerEpiInt.default0
, powerEpiInt2
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.25, 0.75), replace = TRUE) powerEpiInt(X1 = X1, X2 = X2, failureFlag = failureFlag, n = 184, theta = 3, alpha = 0.05)
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.25, 0.75), replace = TRUE) powerEpiInt(X1 = X1, X2 = X2, failureFlag = failureFlag, n = 184, theta = 3, alpha = 0.05)
Power calculation testing interaction effect for Cox proportional hazards regression with two covariates for Epidemiological Studies. Both covariates should be binary variables. The formula takes into account the correlation between the two covariates.
powerEpiInt.default0(n, theta, p, psi, G, rho2, alpha = 0.05)
powerEpiInt.default0(n, theta, p, psi, G, rho2, alpha = 0.05)
n |
integer. total number of subjects. |
theta |
numeric. postulated hazard ratio. |
p |
numeric. proportion of subjects taking the value one for the covariate of interest. |
psi |
numeric. proportion of subjects died of the disease of interest. |
G |
numeric. a factor adjusting the sample size. The sample size needed to
detect an effect of a prognostic factor with given error probabilities has
to be multiplied by the factor |
rho2 |
numeric. square of the correlation between the covariate of interest and the other covariate. |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation formula derived by Schmoor et al. (2000) for the following Cox proportional hazards regression in the epidemiological studies:
where both covariates and
are binary variables.
Suppose we want to check if
the hazard ratio of the interaction effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the power
required to detect a hazard ratio as small as
is
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
and
,
,
,
and
, and
If and
are uncorrelated, we have
leading to
. For
, we have
.
The power of the test.
Schmoor C., Sauerbrei W., and Schumacher M. (2000). Sample size considerations for the evaluation of prognostic factors in survival analysis. Statistics in Medicine. 19:441-452.
powerEpiInt.default1
, powerEpiInt2
# Example at the end of Section 4 of Schmoor et al. (2000). powerEpiInt.default0(n = 184, theta = 3, p = 0.61, psi = 139 / 184, G = 4.79177, rho2 = 0.015^2, alpha = 0.05)
# Example at the end of Section 4 of Schmoor et al. (2000). powerEpiInt.default0(n = 184, theta = 3, p = 0.61, psi = 139 / 184, G = 4.79177, rho2 = 0.015^2, alpha = 0.05)
Power calculation testing interaction effect for Cox proportional hazards regression with two covariates for Epidemiological Studies. Both covariates should be binary variables. The formula takes into account the correlation between the two covariates.
powerEpiInt.default1(n, theta, psi, p00, p01, p10, p11, alpha = 0.05)
powerEpiInt.default1(n, theta, psi, p00, p01, p10, p11, alpha = 0.05)
n |
integer. total number of subjects. |
theta |
numeric. postulated hazard ratio. |
psi |
numeric. proportion of subjects died of the disease of interest. |
p00 |
numeric. proportion of subjects taking values |
p01 |
numeric. proportion of subjects taking values |
p10 |
numeric. proportion of subjects taking values |
p11 |
numeric. proportion of subjects taking values |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation formula derived by Schmoor et al. (2000) for the following Cox proportional hazards regression in the epidemoilogical studies:
where both covariates and
are binary variables.
Suppose we want to check if
the hazard ratio of the interaction effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the power
required to detect a hazard ratio as small as
is:
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
,
,
,
.
The power of the test.
Schmoor C., Sauerbrei W., and Schumacher M. (2000). Sample size considerations for the evaluation of prognostic factors in survival analysis. Statistics in Medicine. 19:441-452.
powerEpiInt.default0
, powerEpiInt2
# Example at the end of Section 4 of Schmoor et al. (2000). # p00, p01, p10, and p11 are calculated based on Table III on page 448 # of Schmoor et al. (2000). powerEpiInt.default1(n = 184, theta = 3, psi = 139 / 184, p00 = 50 / 184, p01 = 21 / 184, p10 = 78 / 184, p11 = 35 / 184, alpha = 0.05)
# Example at the end of Section 4 of Schmoor et al. (2000). # p00, p01, p10, and p11 are calculated based on Table III on page 448 # of Schmoor et al. (2000). powerEpiInt.default1(n = 184, theta = 3, psi = 139 / 184, p00 = 50 / 184, p01 = 21 / 184, p10 = 78 / 184, p11 = 35 / 184, alpha = 0.05)
Power calculation testing interaction effect for Cox proportional hazards regression with two covariates for Epidemiological Studies. Both covariates should be binary variables. The formula takes into account the correlation between the two covariates.
powerEpiInt2(n, theta, psi, mya, myb, myc, myd, alpha = 0.05)
powerEpiInt2(n, theta, psi, mya, myb, myc, myd, alpha = 0.05)
n |
integer. total number of subjects. |
theta |
numeric. postulated hazard ratio. |
psi |
numeric. proportion of subjects died of the disease of interest. |
mya |
integer. number of subjects taking values |
myb |
integer. number of subjects taking values |
myc |
integer. number of subjects taking values |
myd |
integer. number of subjects taking values |
alpha |
numeric. type I error rate. |
This is an implementation of the power calculation formula derived by Schmoor et al. (2000) for the following Cox proportional hazards regression in the epidemiological studies:
where both covariates and
are binary variables.
Suppose we want to check if
the hazard ratio of the interaction effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the power
required to detect a hazard ratio as small as
is
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
and
,
,
,
and
, and
and
,
,
,
,
.
,
,
,
.
The power of the test.
Schmoor C., Sauerbrei W., and Schumacher M. (2000). Sample size considerations for the evaluation of prognostic factors in survival analysis. Statistics in Medicine. 19:441-452.
powerEpiInt.default0
, powerEpiInt.default1
# Example at the end of Section 4 of Schmoor et al. (2000). # mya, myb, myc, and myd are obtained from Table III on page 448 # of Schmoor et al. (2000). powerEpiInt2(n = 184, theta = 3, psi = 139 / 184, mya = 50, myb = 21, myc = 78, myd = 35, alpha = 0.05)
# Example at the end of Section 4 of Schmoor et al. (2000). # mya, myb, myc, and myd are obtained from Table III on page 448 # of Schmoor et al. (2000). powerEpiInt2(n = 184, theta = 3, psi = 139 / 184, mya = 50, myb = 21, myc = 78, myd = 35, alpha = 0.05)
Sample size calculation for survival analysis with binary predictor and exponential survival function.
ssize.stratify( power, timeUnit, gVec, PVec, HR, lambda0Vec, alpha = 0.05, verbose = TRUE)
ssize.stratify( power, timeUnit, gVec, PVec, HR, lambda0Vec, alpha = 0.05, verbose = TRUE)
power |
numeric. Power of the test. |
timeUnit |
numeric. Total study length. |
gVec |
numeric. m by 1 vector. The s-th element is the proportion of the total sample size for the s-th stratum, where m is the number of strata. |
PVec |
numeric. m by 1 vector. The s-th element is the proportion of subjects in treatment group 1 for the s-th stratum, where m is the number of strata. |
HR |
numeric. Hazard ratio (Ratio of the hazard for treatment group 1 to the hazard for treatment group 0, i.e. reference group). |
lambda0Vec |
numeric. m by 1 vector. The s-th element is the hazard for treatment group 0 (i.e., reference group) in the s-th stratum. |
alpha |
numeric. Type I error rate. |
verbose |
Logical. Indicating if intermediate results will be output or not. |
We assume (1) there is only one predictor and no covariates in the survival model
(exponential survival function); (2) there are m
strata; (3) the predictor x
is a binary variable indicating treatment group 1 () or treatment group 0
(
); (3) the treatment effect is constant over time (proportional hazards);
(4) the hazard ratio is the same in all strata, and (5) the data will be analyzed by
the stratified log rank test.
The sample size formula is Formula (1) on page 801 of Palta M and Amini SB (1985):
where is the Type I error rate,
is the Type II error rate (power
),
is the
-th percentile of standard normal distribution, and
and
In the above formulas, is the number of strata,
is the total study length,
is the hazard ratio,
is the proportion of the total sample size in stratum
,
is the proportion of stratum
, which is in treatment group 1,
and
is the hazard for the
-th treatment group in
stratum
.
The sample size.
Palta M and Amini SB. (1985). Consideration of covariates and stratification in sample size determination for survival time studies. Journal of Chronic Diseases. 38(9):801-809.
# example on page 803 of Palta M and Amini SB. (1985). n <- ssize.stratify( power = 0.9, timeUnit = 1.25, gVec = c(0.5, 0.5), PVec = c(0.5, 0.5), HR = 1 / 1.91, lambda0Vec = c(2.303, 1.139), alpha = 0.05, verbose = TRUE )
# example on page 803 of Palta M and Amini SB. (1985). n <- ssize.stratify( power = 0.9, timeUnit = 1.25, gVec = c(0.5, 0.5), PVec = c(0.5, 0.5), HR = 1 / 1.91, lambda0Vec = c(2.303, 1.139), alpha = 0.05, verbose = TRUE )
Sample size calculation for the Comparison of Survival Curves Between Two Groups under the Cox Proportional-Hazards Model for clinical trials. Some parameters will be estimated based on a pilot data set.
ssizeCT(formula, dat, power, k, RR, alpha = 0.05)
ssizeCT(formula, dat, power, k, RR, alpha = 0.05)
formula |
A formula object, e.g. |
dat |
a data frame representing the pilot data set and containing at least 3 columns: (1) survival/censoring time; (2) censoring indicator;
(3) group indicator which is a factor object in R and takes only two possible values ( |
power |
numeric. power to detect the magnitude of the hazard ratio as small as that specified by |
k |
numeric. ratio of participants in group E (experimental group) compared to group C (control group). |
RR |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the sample size calculation method described in Section 14.12 (page 807) of Rosner (2006). The method was proposed by Freedman (1982).
The movitation of this function is that some times we do not have information about or
and
available, but we have a pilot data set that can be used to estimate
and
hence
, where
is the expected total number of events over both groups,
and
are numbers of participants in group E (experimental group) and group C (control group), respectively.
is the probability of failure in group E (experimental group) over the maximum time period of the study (t years).
is the probability of failure in group C (control group) over the maximum time period of the study
(t years).
Suppose we want to compare the survival curves between an experimental group () and
a control group (
) in a clinical trial with a maximum follow-up of
years.
The Cox proportional hazards regression model is assumed to have the form:
Let be the number of participants in the
group
and
be the number of participants in the
group.
We wish to test the hypothesis
versus
not equal to 1,
where
underlying hazard ratio
for the
group versus the
group. Let
be the postulated hazard ratio,
be the significance level. Assume that the test is a two-sided test.
If the ratio of participants in group
E compared to group C
, then the number of participants needed in each group to
achieve a power of
is
where
and
is the
-th percentile of
the standard normal distribution
.
and
can be calculated from the following formulaes:
where ,
,
,
,
. And
is the probability of failure at time
i
among participants in the
control group, given that a participant has survived to time and is not censored at time
,
i.e., the approximate hazard time
in the control group,
;
is the probability of failure at time
i
among participants in the
experimental group, given that a participant has survived to time and is not censored at time
,
i.e., the approximate hazard time
in the experimental group,
;
is the prbability that a participant is censored at time
given that he was
followed up to time
and has not failed,
, which is assumed the same in each group.
mat.lambda |
a matrix with 9 columns and |
mat.event |
a matrix with 5 columns and |
pC |
estimated probability of failure in group C (control group) over the maximum time period of the study (t years). |
pE |
estimated probability of failure in group E (experimental group) over the maximum time period of the study (t years). |
ssize |
a two-element vector. The first element is |
(1) The estimates of . That is,
RRlambda
is not directly estimated based on data
from the experimental group;
(2) The sample size formula assumes that the central-limit theorem is valid and hence is appropriate for large samples.
(3) and
will be rounded up to integers.
Freedman, L.S. (1982). Tables of the number of patients required in clinical trials using the log-rank test. Statistics in Medicine. 1: 121-129
Rosner B. (2006). Fundamentals of Biostatistics. (6-th edition). Thomson Brooks/Cole.
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 library(survival) data(Oph) res <- ssizeCT(formula = Surv(times, status) ~ group, dat = Oph, power = 0.8, k = 1, RR = 0.7, alpha = 0.05) # Table 14.24 on page 809 of Rosner (2006) print(round(res$mat.lambda, 4)) # Table 14.12 on page 787 of Rosner (2006) print(round(res$mat.event, 4)) # the sample size print(res$ssize)
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 library(survival) data(Oph) res <- ssizeCT(formula = Surv(times, status) ~ group, dat = Oph, power = 0.8, k = 1, RR = 0.7, alpha = 0.05) # Table 14.24 on page 809 of Rosner (2006) print(round(res$mat.lambda, 4)) # Table 14.12 on page 787 of Rosner (2006) print(round(res$mat.event, 4)) # the sample size print(res$ssize)
Sample size calculation for the Comparison of Survival Curves Between Two Groups under the Cox Proportional-Hazards Model for clinical trials.
ssizeCT.default(power, k, pE, pC, RR, alpha = 0.05)
ssizeCT.default(power, k, pE, pC, RR, alpha = 0.05)
power |
numeric. power to detect the magnitude of the hazard ratio as small as that specified by |
k |
numeric. ratio of participants in group E (experimental group) compared to group C (control group). |
pE |
numeric. probability of failure in group E (experimental group) over the maximum time period of the study (t years). |
pC |
numeric. probability of failure in group C (control group) over the maximum time period of the study (t years). |
RR |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the sample size calculation method described in Section 14.12 (page 807) of Rosner (2006). The method was proposed by Freedman (1982).
Suppose we want to compare the survival curves between an experimental group () and
a control group (
) in a clinical trial with a maximum follow-up of
years.
The Cox proportional hazards regression model is assumed to have the form:
Let be the number of participants in the
group
and
be the number of participants in the
group.
We wish to test the hypothesis
versus
not equal to 1,
where
underlying hazard ratio
for the
group versus the
group. Let
be the postulated hazard ratio,
be the significance level. Assume that the test is a two-sided test.
If the ratio of participants in group
E compared to group C
, then the number of participants needed in each group to
achieve a power of
is
where
and
is the
-th percentile of
the standard normal distribution
.
A two-element vector. The first element is and the second
element is
.
(1) The sample size formula assumes that the central-limit theorem is valid and hence is appropriate for large samples.
(2) and
will be rounded up to integers.
Freedman, L.S. (1982). Tables of the number of patients required in clinical trials using the log-rank test. Statistics in Medicine. 1: 121-129
Rosner B. (2006). Fundamentals of Biostatistics. (6-th edition). Thomson Brooks/Cole.
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 ssizeCT.default(power = 0.8, k = 1, pE = 0.3707, pC = 0.4890, RR = 0.7, alpha = 0.05)
# Example 14.42 in Rosner B. Fundamentals of Biostatistics. # (6-th edition). (2006) page 809 ssizeCT.default(power = 0.8, k = 1, pE = 0.3707, pC = 0.4890, RR = 0.7, alpha = 0.05)
Sample size calculation for Cox proportional hazards regression with two covariates for Epidemiological Studies. The covariate of interest should be a binary variable. The other covariate can be either binary or non-binary. The formula takes into account competing risks and the correlation between the two covariates.
ssizeEpi(X1, X2, failureFlag, power, theta, alpha = 0.05)
ssizeEpi(X1, X2, failureFlag, power, theta, alpha = 0.05)
X1 |
numeric. a |
X2 |
numeric. a |
failureFlag |
numeric. a |
power |
numeric. postulated power. |
theta |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the sample size formula derived by Latouche et al. (2004) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is of our interest. The covariate
has to be
a binary variable taking two possible values: zero and one, while the
covariate
can be binary or continuous.
Suppose we want to check if the hazard of is equal to
the hazard of
or not. Equivalently, we want to check if
the hazard ratio of
to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of subjects required to achieve a power of
is
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
and
,
,
,
and
.
,
, and
will be estimated from a pilot study.
n |
the total number of subjects required. |
p |
the proportion that |
rho2 |
square of the correlation between |
psi |
proportion of subjects died of the disease of interest. |
(1) The calculated sample size will be round up to an integer.
(2) The formula can be used to calculate
sample size required for a randomized trial study by setting rho2=0
.
(3) When rho2=0
, the formula derived by Latouche et al. (2004)
looks the same as that derived by Schoenfeld (1983). Latouche et al. (2004) pointed out that in this situation, the interpretations are different hence
the two formulae are actually different. In Latouched et al. (2004), the
hazard ratio measures the difference of effect of a covariate
at two different levels on the subdistribution hazard for a particular failure,
while in Schoenfeld (1983), the hazard ratio
measures
the difference of effect on the cause-specific hazard.
Schoenfeld DA. (1983). Sample-size formula for the proportional-hazards regression model. Biometrics. 39:499-503.
Latouche A., Porcher R. and Chevret S. (2004). Sample size formula for proportional hazards modelling of competing risks. Statistics in Medicine. 23:3263-3274.
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.5, 0.5), replace = TRUE) ssizeEpi(X1 = X1, X2 = X2, failureFlag = failureFlag, power = 0.80, theta = 2, alpha = 0.05)
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.5, 0.5), replace = TRUE) ssizeEpi(X1 = X1, X2 = X2, failureFlag = failureFlag, power = 0.80, theta = 2, alpha = 0.05)
Sample size calculation for Cox proportional hazards regression with two covariates for Epidemiological Studies. The covariate of interest should be a binary variable. The other covariate can be either binary or non-binary. The formula takes into account competing risks and the correlation between the two covariates.
ssizeEpi.default(power, theta, p, psi, rho2, alpha = 0.05)
ssizeEpi.default(power, theta, p, psi, rho2, alpha = 0.05)
power |
numeric. postulated power. |
theta |
numeric. postulated hazard ratio. |
p |
numeric. proportion of subjects taking value one for the covariate of interest. |
psi |
numeric. proportion of subjects died of the disease of interest. |
rho2 |
numeric. square of the correlation between the covariate of interest and the other covariate. |
alpha |
numeric. type I error rate. |
This is an implementation of the sample size formula derived by Latouche et al. (2004) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is of our interest. The covariate
has to be
a binary variable taking two possible values: zero and one, while the
covariate
can be binary or continuous.
Suppose we want to check if the hazard of is equal to
the hazard of
or not. Equivalently, we want to check if
the hazard ratio of
to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of subjects required to achieve a power of
is
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
and
,
,
,
and
.
The required sample size to achieve the specified power with the given type I error rate.
(1) The calculated sample size will be round up to an integer.
(2) The formula can be used to calculate
sample size required for a randomized trial study by setting rho2=0
.
(3) When rho2=0
, the formula derived by Latouche et al. (2004)
looks the same as that derived by Schoenfeld (1983). Latouche et al. (2004) pointed out that in this situation, the interpretations are different hence
the two formulae are actually different. In Latouched et al. (2004), the
hazard ratio measures the difference of effect of a covariate
at two different levels on the subdistribution hazard for a particular failure,
while in Schoenfeld (1983), the hazard ratio
measures
the difference of effect on the cause-specific hazard.
Schoenfeld DA. (1983). Sample-size formula for the proportional-hazards regression model. Biometrics. 39:499-503.
Latouche A., Porcher R. and Chevret S. (2004). Sample size formula for proportional hazards modelling of competing risks. Statistics in Medicine. 23:3263-3274.
# Examples at the end of Section 5.2 of Latouche et al. (2004) # for a cohort study. ssizeEpi.default(power = 0.80, theta = 2, p = 0.39, psi = 0.505, rho2 = 0.132^2, alpha = 0.05)
# Examples at the end of Section 5.2 of Latouche et al. (2004) # for a cohort study. ssizeEpi.default(power = 0.80, theta = 2, p = 0.39, psi = 0.505, rho2 = 0.132^2, alpha = 0.05)
Sample size calculation for Cox proportional hazards regression with nonbinary covariates for Epidemiological Studies.
ssizeEpiCont(formula, dat, var.X1, var.failureFlag, power, theta, alpha = 0.05)
ssizeEpiCont(formula, dat, var.X1, var.failureFlag, power, theta, alpha = 0.05)
formula |
a formula object relating the covariate of interest
to other covariates to calculate the multiple correlation coefficient. The
variables in formula must be in the data frame |
dat |
a |
var.X1 |
character. name of the column in the data frame |
var.failureFlag |
character. name of the column in the data frame |
power |
numeric. postulated power. |
theta |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the sample size calculation formula derived by Hsieh and Lavori (2000) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is a nonbinary variable and
is a vector of other covariates.
Suppose we want to check if
the hazard ratio of the main effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of subjects required to achieve a sample size of
is
where is the
-th percentile of the standard normal distribution,
,
is the proportion of subjects died of
the disease of interest, and
is the multiple correlation coefficient
of the following linear regression:
That is, , where
is the proportion of variance
explained by the regression of
on the vector of covriates
.
,
, and
will be estimated from a pilot study.
n |
the total number of subjects required. |
rho2 |
square of the correlation between |
sigma2 |
variance of the covariate of interest. |
psi |
proportion of subjects died of the disease of interest. |
(1) Hsieh and Lavori (2000) assumed one-sided test, while this implementation assumed two-sided test.
(2) The formula can be used to calculate
ssize for a randomized trial study by setting rho2=0
.
Hsieh F.Y. and Lavori P.W. (2000). Sample-size calculation for the Cox proportional hazards regression model with nonbinary covariates. Controlled Clinical Trials. 21:552-560.
# generate a toy pilot data set set.seed(123456) X1 <- rnorm(100, mean = 0, sd = 0.3126) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.25, 0.75), replace = TRUE) dat <- data.frame(X1 = X1, X2 = X2, failureFlag = failureFlag) ssizeEpiCont(formula = X1 ~ X2, dat = dat, var.X1 = "X1", var.failureFlag = "failureFlag", power = 0.806, theta = exp(1), alpha = 0.05)
# generate a toy pilot data set set.seed(123456) X1 <- rnorm(100, mean = 0, sd = 0.3126) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.25, 0.75), replace = TRUE) dat <- data.frame(X1 = X1, X2 = X2, failureFlag = failureFlag) ssizeEpiCont(formula = X1 ~ X2, dat = dat, var.X1 = "X1", var.failureFlag = "failureFlag", power = 0.806, theta = exp(1), alpha = 0.05)
Sample size calculation for Cox proportional hazards regression with nonbinary covariates for Epidemiological Studies.
ssizeEpiCont.default(power, theta, sigma2, psi, rho2, alpha = 0.05)
ssizeEpiCont.default(power, theta, sigma2, psi, rho2, alpha = 0.05)
power |
numeric. postulated power. |
theta |
numeric. postulated hazard ratio. |
sigma2 |
numeric. variance of the covariate of interest. |
psi |
numeric. proportion of subjects died of the disease of interest. |
rho2 |
numeric. square of the multiple correlation coefficient between the covariate of interest and other covariates. |
alpha |
numeric. type I error rate. |
This is an implementation of the sample size calculation formula derived by Hsieh and Lavori (2000) for the following Cox proportional hazards regression in the epidemiological studies:
where the covariate is a nonbinary variable and
is a vector of other covariates.
Suppose we want to check if
the hazard ratio of the main effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of subjects required to achieve a sample size of
is
where is the
-th percentile of the standard normal distribution,
,
is the proportion of subjects died of
the disease of interest, and
is the multiple correlation coefficient
of the following linear regression:
That is, , where
is the proportion of variance
explained by the regression of
on the vector of covriates
.
The total number of subjects required.
(1) Hsieh and Lavori (2000) assumed one-sided test, while this implementation assumed two-sided test.
(2) The formula can be used to calculate
ssize for a randomized trial study by setting rho2=0
.
Hsieh F.Y. and Lavori P.W. (2000). Sample-size calculation for the Cox proportional hazards regression model with nonbinary covariates. Controlled Clinical Trials. 21:552-560.
# example in the EXAMPLE section (page 557) of Hsieh and Lavori (2000). # Hsieh and Lavori (2000) assumed one-sided test, # while this implementation assumed two-sided test. # Hence alpha=0.1 here (two-sided test) will correspond # to alpha=0.05 of one-sided test in Hsieh and Lavori's (2000) example. ssizeEpiCont.default(power = 0.806, theta = exp(1), sigma2 = 0.3126^2, psi = 0.738, rho2 = 0.1837, alpha = 0.1)
# example in the EXAMPLE section (page 557) of Hsieh and Lavori (2000). # Hsieh and Lavori (2000) assumed one-sided test, # while this implementation assumed two-sided test. # Hence alpha=0.1 here (two-sided test) will correspond # to alpha=0.05 of one-sided test in Hsieh and Lavori's (2000) example. ssizeEpiCont.default(power = 0.806, theta = exp(1), sigma2 = 0.3126^2, psi = 0.738, rho2 = 0.1837, alpha = 0.1)
Sample size calculation testing interaction effect for Cox proportional hazards regression with two covariates for Epidemiological Studies. Both covariates should be binary variables. The formula takes into account the correlation between the two covariates.
ssizeEpiInt(X1, X2, failureFlag, power, theta, alpha = 0.05)
ssizeEpiInt(X1, X2, failureFlag, power, theta, alpha = 0.05)
X1 |
numeric. a |
X2 |
numeric. a |
failureFlag |
numeric. a |
power |
numeric. postulated power. |
theta |
numeric. postulated hazard ratio. |
alpha |
numeric. type I error rate. |
This is an implementation of the sample size calculation formula derived by Schmoor et al. (2000) for the following Cox proportional hazards regression in the epidemoilogical studies:
where both covariates and
are binary variables.
Suppose we want to check if
the hazard ratio of the interaction effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of subjects required to achieve the desired power
is:
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
and
,
,
,
and
, and
and
,
,
,
,
.
,
,
,
.
,
,
,
, and
will be
estimated from the pilot data.
n |
the total number of subjects required. |
p |
estimated |
q |
estimated |
p0 |
estimated |
p1 |
estimated |
rho2 |
square of the estimated |
G |
a factor adjusting the sample size. The sample size needed to
detect an effect of a prognostic factor with given error probabilities has
to be multiplied by the factor |
mya |
estimated number of subjects taking values |
myb |
estimated number of subjects taking values |
myc |
estimated number of subjects taking values |
myd |
estimated number of subjects taking values |
psi |
proportion of subjects died of the disease of interest. |
Schmoor C., Sauerbrei W., and Schumacher M. (2000). Sample size considerations for the evaluation of prognostic factors in survival analysis. Statistics in Medicine. 19:441-452.
ssizeEpiInt.default0
, ssizeEpiInt2
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.25, 0.75), replace = TRUE) ssizeEpiInt(X1 = X1, X2 = X2, failureFlag = failureFlag, power = 0.88, theta = 3, alpha = 0.05)
# generate a toy pilot data set X1 <- c(rep(1, 39), rep(0, 61)) set.seed(123456) X2 <- sample(c(0, 1), 100, replace = TRUE) failureFlag <- sample(c(0, 1), 100, prob = c(0.25, 0.75), replace = TRUE) ssizeEpiInt(X1 = X1, X2 = X2, failureFlag = failureFlag, power = 0.88, theta = 3, alpha = 0.05)
Sample size calculation testing interaction effect for Cox proportional hazards regression with two covariates for Epidemiological Studies. Both covariates should be binary variables. The formula takes into account the correlation between the two covariates.
ssizeEpiInt.default0(power, theta, p, psi, G, rho2, alpha = 0.05)
ssizeEpiInt.default0(power, theta, p, psi, G, rho2, alpha = 0.05)
power |
numeric. postulated power. |
theta |
numeric. postulated hazard ratio. |
p |
numeric. proportion of subjects taking value one for the covariate of interest. |
psi |
numeric. proportion of subjects died of the disease of interest. |
G |
numeric. a factor adjusting the sample size. The sample size needed to
detect an effect of a prognostic factor with given error probabilities has
to be multiplied by the factor |
rho2 |
numeric. square of the correlation between the covariate of interest and the other covariate. |
alpha |
numeric. type I error rate. |
This is an implementation of the sample size calculation formula derived by Schmoor et al. (2000) for the following Cox proportional hazards regression in the epidemiological studies:
where both covariates and
are binary variables.
Suppose we want to check if
the hazard ratio of the interaction effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of subjects required to achieve a power of
is
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
and
,
,
,
and
, and
.
If and
are uncorrelated, we have
leading to
. For
, we have
.
The total number of subjects required.
Schmoor C., Sauerbrei W., and Schumacher M. (2000). Sample size considerations for the evaluation of prognostic factors in survival analysis. Statistics in Medicine. 19:441-452.
ssizeEpiInt.default1
, ssizeEpiInt2
# Example at the end of Section 4 of Schmoor et al. (2000). ssizeEpiInt.default0(power = 0.8227, theta = 3, p = 0.61, psi = 139 / 184, G = 4.79177, rho2 = 0.015^2, alpha = 0.05)
# Example at the end of Section 4 of Schmoor et al. (2000). ssizeEpiInt.default0(power = 0.8227, theta = 3, p = 0.61, psi = 139 / 184, G = 4.79177, rho2 = 0.015^2, alpha = 0.05)
Sample size calculation testing interaction effect for Cox proportional hazards regression with two covariates for Epidemiological Studies. Both covariates should be binary variables. The formula takes into account the correlation between the two covariates.
ssizeEpiInt.default1(power, theta, psi, p00, p01, p10, p11, alpha = 0.05)
ssizeEpiInt.default1(power, theta, psi, p00, p01, p10, p11, alpha = 0.05)
power |
numeric. postulated power. |
theta |
numeric. postulated hazard ratio. |
psi |
numeric. proportion of subjects died of the disease of interest. |
p00 |
numeric. proportion of subjects taking values |
p01 |
numeric. proportion of subjects taking values |
p10 |
numeric. proportion of subjects taking values |
p11 |
numeric. proportion of subjects taking values |
alpha |
type I error rate. |
This is an implementation of the sample size calculation formula derived by Schmoor et al. (2000) for the following Cox proportional hazards regression in the epidemoilogical studies:
where both covariates and
are binary variables.
Suppose we want to check if
the hazard ratio of the interaction effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of subjects required to achieve a power of
is
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest,
and
,
,
,
.
The ssize of the test.
Schmoor C., Sauerbrei W., and Schumacher M. (2000). Sample size considerations for the evaluation of prognostic factors in survival analysis. Statistics in Medicine. 19:441-452.
ssizeEpiInt.default0
, ssizeEpiInt2
# Example at the end of Section 4 of Schmoor et al. (2000). # p00, p01, p10, and p11 are calculated based on Table III on page 448 # of Schmoor et al. (2000). ssizeEpiInt.default1(power = 0.8227, theta = 3, psi = 139 / 184, p00 = 50/184, p01 = 21 / 184, p10 = 78 / 184, p11 = 35 / 184, alpha = 0.05)
# Example at the end of Section 4 of Schmoor et al. (2000). # p00, p01, p10, and p11 are calculated based on Table III on page 448 # of Schmoor et al. (2000). ssizeEpiInt.default1(power = 0.8227, theta = 3, psi = 139 / 184, p00 = 50/184, p01 = 21 / 184, p10 = 78 / 184, p11 = 35 / 184, alpha = 0.05)
Sample size calculation testing interaction effect for Cox proportional hazards regression with two covariates for Epidemiological Studies. Both covariates should be binary variables. The formula takes into account the correlation between the two covariates.
ssizeEpiInt2(power, theta, psi, mya, myb, myc, myd, alpha = 0.05)
ssizeEpiInt2(power, theta, psi, mya, myb, myc, myd, alpha = 0.05)
power |
numeric. postulated power. |
theta |
numeric. postulated hazard ratio. |
psi |
numeric. proportion of subjects died of the disease of interest. |
mya |
integer. number of subjects taking values |
myb |
integer. number of subjects taking values |
myc |
integer. number of subjects taking values |
myd |
integer. number of subjects taking values |
alpha |
numeric. type I error rate. |
This is an implementation of the sample size calculation formula derived by Schmoor et al. (2000) for the following Cox proportional hazards regression in the epidemiological studies:
where both covariates and
are binary variables.
Suppose we want to check if
the hazard ratio of the interaction effect to
is equal to
or is equal to
.
Given the type I error rate
for a two-sided test, the total
number of subjects required to achieve a power of
is
where is the
-th percentile of the standard normal distribution,
is the proportion of subjects died of
the disease of interest, and
and
,
,
,
and
, and
and
,
,
,
,
.
,
,
,
.
The total number of subjects required.
Schmoor C., Sauerbrei W., and Schumacher M. (2000). Sample size considerations for the evaluation of prognostic factors in survival analysis. Statistics in Medicine. 19:441-452.
ssizeEpiInt.default0
, ssizeEpiInt.default1
# Example at the end of Section 4 of Schmoor et al. (2000). # mya, myb, myc, and myd are obtained from Table III on page 448 # of Schmoor et al. (2000). ssizeEpiInt2(power = 0.8227, theta = 3, psi = 139 / 184, mya = 50, myb = 21, myc = 78, myd = 35, alpha = 0.05)
# Example at the end of Section 4 of Schmoor et al. (2000). # mya, myb, myc, and myd are obtained from Table III on page 448 # of Schmoor et al. (2000). ssizeEpiInt2(power = 0.8227, theta = 3, psi = 139 / 184, mya = 50, myb = 21, myc = 78, myd = 35, alpha = 0.05)