powexp2: Power for two sample exponential (or logrank)

View source: R/powexp2.R

powexp2R Documentation

Power for two sample exponential (or logrank)

Description

Computes power for a stratified test comparing two groups with exponential failure time distributions. The power can also be used for the logrank test under proportional hazards.

Usage

powexp2(
  acc.rate,
  acc.per,
  add.fu,
  l1,
  r1o2,
  p1,
  prop.strat = rep(1, length(l1)),
  alpha2 = 0.05,
  nullh = 1
)

Arguments

acc.rate

Accrual rate

acc.per

Accrual period

add.fu

Additional follow-up after the end of accrual before data are analyzed

l1

Hazard rates in group 1 (one per stratum)

r1o2

Hazard ratios for group 1 over group 2; either length 1 or length = number of strata

p1

Proportion in group 1; either length 1 or length = number of strata. Can be different for different strata.

prop.strat

Proportion of the total sample in each stratum

alpha2

Two-sided type I error rate

nullh

Null hypothesis hazard ratio (1 over 2)

Details

Computes the power for a stratified test in the two sample exponential problem. The test is actually based on the optimally weighted average of the log hazard ratio estimates from each stratum. Unlike other sample size functions, any of the input parameters (except alpha2) can take different values for different strata. For example, the proportion in each stratum can be specified through either prop.strat or by giving difference accrual rates for each stratum, and the follow-up time can be different for different stratum to allow for different strata to have opened or closed at different times.

Value

A vector of length 4 giving the overall expected standard error of with weighted average log hazard ratio (se), the expected value under the alternative of the weighted average log hazard ratio (me), the expected total number of failure events under the alternative (n.fail), and the power (power).

See Also

seqopr; powlgrnk; correl.power

Examples

powexp2(200, 2, 3, log(2) / 4, 1.5, 0.5)
powexp2(200, 2, 3, log(2) / 4, 1.33, 0.5)
powexp2(200, 2, 3, log(2) / 4, c(1.5, 1), 0.5, c(0.7, 0.3))
powexp2(10, 31.5, 13.75, c(log(2) / 6, log(2) / 8), c(1.4, 1.2), 0.5, c(0.9, 0.1))
powexp2(c(9, 1), 31.5, 13.75, c(log(2) / 6, log(2) / 8), c(1.4, 1.2), 0.5)


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