powerEpiInt: Power Calculation Testing Interaction Effect for Cox...

Description Usage Arguments Details Value References See Also Examples

View source: R/powerEpi.R

Description

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.

Usage

1
2
3
4
5
6
powerEpiInt(X1, 
	    X2, 
	    failureFlag, 
	    n, 
	    theta, 
	    alpha = 0.05)

Arguments

X1

numeric. a nPilot by 1 vector, where nPilot is the number of subjects in the pilot data set. This vector records the values of the covariate of interest for the nPilot subjects in the pilot study. X1 should be binary and take only two possible values: zero and one.

X2

numeric. a nPilot by 1 vector, where nPilot is the number of subjects in the pilot study. This vector records the values of the second covariate for the nPilot subjects in the pilot study. X2 should be binary and take only two possible values: zero and one.

failureFlag

numeric.a nPilot by 1 vector of indicators indicating if a subject is failure (failureFlag=1) or alive (failureFlag=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 Schmoor et al. (2000) for the following Cox proportional hazards regression in the epidemoilogical studies:

h(t|x_1, x_2)=h_0(t)\exp(β_1 x_1+β_2 x_2 + γ (x_1 x_2)),

where both covariates X_1 and X_2 are binary variables.

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

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

where z_{a} is the 100 a-th percentile of the standard normal distribution,

δ=\frac{1}{p_{00}}+\frac{1}{p_{01}}+\frac{1}{p_{10}} +\frac{1}{p_{11}},

ψ is the proportion of subjects died of the disease of interest, and p_{00}=Pr(X_1=0,\mbox{and}, X_2=0), p_{01}=Pr(X_1=0,\mbox{and}, X_2=1), p_{10}=Pr(X_1=1,\mbox{and}, X_2=0), p_{11}=Pr(X_1=1,\mbox{and}, X_2=1).

p_{00}, p_{01}, p_{10}, p_{11}, and ψ will be estimated from the pilot data.

Value

power

the power of the test.

p

estimated Pr(X_1=1)

q

estimated Pr(X_2=1)

p0

estimated Pr(X_1=1 | X_2=0)

p1

estimated Pr(X_1=1 | X_2=1)

rho2

square of the estimated corr(X_1, X_2)

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 G when an interaction of the same magnitude is to be detected.

mya

estimated number of subjects taking values X_1=0 and X_2=0.

myb

estimated number of subjects taking values X_1=0 and X_2=1.

myc

estimated number of subjects taking values X_1=1 and X_2=0.

myd

estimated number of subjects taking values X_1=1 and X_2=1.

psi

proportion of subjects died of the disease of interest.

References

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.

See Also

powerEpiInt.default0, powerEpiInt2

Examples

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

Example output

$power
[1] 0.8747554

$p
[1] 0.39

$q
[1] 0.62

$p0
[1] 0.4473684

$p1
[1] 0.3548387

$rho2
[1] 0.008478973

$G
[1] 4.1727

$mya
[1] 21

$myb
[1] 40

$myc
[1] 17

$myd
[1] 22

$psi
[1] 0.77

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