condpow: Perform Simulation to Calculate Conditional Power of a...

View source: R/condpow.R

condpowR Documentation

Perform Simulation to Calculate Conditional Power of a Logrank Test

Description

Performs a simulation to calculate conditional power of a logrank test in a group sequential experiment with exponential failure times.

Usage

condpow(
  time,
  status,
  rx,
  nsamp = 500,
  crit.val = 1.96,
  control = 0,
  control.rate,
  test.rate,
  inf.time = 1,
  total.inf,
  add.acc = 0,
  add.acc.period,
  p.con = 0.5,
  strat = rep(1, length(time))
)

Arguments

time

Failure/censoring times in the current data

status

failure indicator for current data (1=failure, 0=censored)

rx

treatment variable in current data

nsamp

number of samples to generate in the simulation

crit.val

critical values to be used at future analyses

control

the code of rx for the control group

control.rate

exponential failure rate for the control group

test.rate

exponential failure rate for the experimental treatment group

inf.time

information times of future analyses

total.inf

Number of failures at full information

add.acc

Additional number of cases that will be accrued

add.acc.period

Duration of time over which the add.acc cases will be accrued

p.con

The proportion randomized to the control group

strat

Variable defining the strata for a stratified test

Details

Adds add.acc cases and generates additional follow-up for subjects already entered but censored in the current data. Failure times are generated from exponential distributions. Additional interim analyses are performed when inf.time * total.inf failures are observed. The critical values used for rejecting the null at these additional interim analyses are specified in crit.value. The number of additional analyses is the length of inf.time and crit.value. The information of the current data should not be included. Full information (inf.time = 1) must be explicitly included. Information times should be in increasing order.

After generating the additional data, the function performs the interim analyses, and determines whether the upper boundary is crossed (note that all analyses are performed, to calculate additional quantities, even if the boundary is crossed at an early analysis). This is repeated nsamp times, giving an estimate of the probability of eventually rejecting the null under the specified distributions, conditional on the current data. Low conditional power under the target alternative for the study might be justification for stopping early.

It is very important that consistent time units be used for all arguments and for the current data.

If strat is used and add.acc > 0, then the new observations are generated in a new stratum.

Value

Returns the estimated rejection probability and its simulation standard error. Also prints the value of the logrank statistic for the current data, several approximations to the conditional power (based on large sample normality and independent increments – each based on slightly different approximations to the distribution of the logrank statistic), the average number of events in each group at full information, the average increment in the logrank score from the current data to full information, and the average calendar time of full information.

References

Jennison and Turnbull (1990). Statistical Science 5:299-317.

Betensky (1997). Biometrics 53:794-806.

See Also

condpowcure; sequse; acondpow

Examples

## current data
set.seed(3)
ft <- c(rexp(100), rexp(100) / 0.95)
ct <- runif(200) * 3
fi <- ifelse(ct < ft, 0, 1)
ft <- pmin(ft, ct)
rx <- c(rep(0, 100), rep(1, 100))

## currently at 0.43 information -- assume no prior interim analyses
critv <- sequse(c(0.43, 0.7, 1))[-1]

condpow(ft, fi, rx, nsamp = 10, crit.val = critv, control.rate = 1, test.rate = 0.75,
        inf.time = c(0.7, 1), total.inf = 300, add.acc = 200, add.acc.period = 1)

## Not run: 
# use larger nsamp in practice, eg
condpow(ft, fi, rx, nsamp = 1000, crit.val = critv, control.rate = 1, test.rate = 0.75,
        inf.time = c(0.7, 1), total.inf = 300, add.acc = 200, add.acc.period = 1)

## End(Not run)


raredd/desmon documentation built on May 7, 2024, 3:46 p.m.