powerEpiCont: Power Calculation for Cox Proportional Hazards Regression...

Description Usage Arguments Details Value Note References See Also Examples

View source: R/powerEpi.R

Description

Power calculation for Cox proportional hazards regression with nonbinary covariates for Epidemiological Studies. Some parameters will be estimated based on a pilot data set.

Usage

1
2
3
4
5
6
7
powerEpiCont(formula, 
	     dat, 
	     var.X1, 
	     var.failureFlag, 
	     n, 
	     theta, 
	     alpha = 0.05)

Arguments

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.

dat

a nPilot by p data frame representing the pilot data set, where nPilot is the number of subjects in the pilot study and the p (>1) columns contains the covariate of interest and other covariates.

var.X1

character. name of the column in the data frame dat, indicating the covariate of interest.

var.failureFlag

character. name of the column in the data frame dat, indicating if a subject is failure (taking value 1) or alive (taking value 0).

n

integer. total number of subjects.

theta

numeric. postulated hazard ratio.

alpha

numeric. type I error rate.

Details

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:

h(t|x_1, \boldsymbol{x}_2)=h_0(t)\exp(β_1 x_1+\boldsymbol{β}_2 \boldsymbol{x}_2),

where the covariate X_1 is a nonbinary variable and \boldsymbol{X}_2 is a vector of other covariates.

Suppose we want to check if the hazard ratio of the main effect X_1=1 to X_1=0 is equal to 1 or is equal to \exp(β_1)=θ. Given the type I error rate α for a two-sided test, the power required to detect a hazard ratio as small as \exp(β_1)=θ is

power=Φ≤ft(-z_{1-α/2}+√{n[\log(θ)]^2 σ^2 ψ (1-ρ^2)}\right),

where z_{a} is the 100 a-th percentile of the standard normal distribution, σ^2=Var(X_1), ψ is the proportion of subjects died of the disease of interest, and ρ is the multiple correlation coefficient of the following linear regression:

x_1=b_0+\boldsymbol{b}^T\boldsymbol{x}_2.

That is, ρ^2=R^2, where R^2 is the proportion of variance explained by the regression of X_1 on the vector of covriates \boldsymbol{X}_2.

rho will be estimated from a pilot study.

Value

power

The power of the test.

rho2

square of the correlation between X_1 and X_2.

sigma2

variance of the covariate of interest.

psi

proportion of subjects died of the disease of interest.

Note

(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.

References

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.

See Also

powerEpiCont.default

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  # 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)

powerSurvEpi documentation built on March 1, 2021, 9:06 a.m.