Skip to contents

Provides a geometric average hazard ratio under various non-proportional hazards assumptions for either single or multiple strata studies. The piecewise exponential distribution allows a simple method to specify a distribution and enrollment pattern where the enrollment, failure and dropout rates changes over time.

Usage

pw_info(
  enroll_rate = define_enroll_rate(duration = c(2, 2, 10), rate = c(3, 6, 9)),
  fail_rate = define_fail_rate(duration = c(3, 100), fail_rate = log(2)/c(9, 18), hr =
    c(0.9, 0.6), dropout_rate = 0.001),
  total_duration = 30,
  ratio = 1
)

Arguments

enroll_rate

An enroll_rate data frame with or without stratum created by define_enroll_rate().

fail_rate

A fail_rate data frame with or without stratum created by define_fail_rate().

total_duration

Total follow-up from start of enrollment to data cutoff; this can be a single value or a vector of positive numbers.

ratio

Ratio of experimental to control randomization.

Value

A tibble with time (from total_duration), ahr (average hazard ratio), event (expected number of events), info (information under given scenarios), and info0 (information under related null hypothesis) for each value of total_duration input

Specification

The contents of this section are shown in PDF user manual only.

Examples

# Example: default
pw_info()
#>   time stratum t  hr    event     info    info0
#> 1   30     All 0 0.9 21.24782 5.300180 5.311956
#> 2   30     All 3 0.6 37.24314 9.027063 9.310786

# Example: default with multiple analysis times (varying total_duration)
pw_info(total_duration = c(15, 30))
#>   time stratum t  hr    event     info    info0
#> 1   15     All 0 0.9 20.13991 5.023729 5.034979
#> 2   15     All 3 0.6 10.13850 2.417457 2.534625
#> 3   30     All 0 0.9 21.24782 5.300180 5.311956
#> 4   30     All 3 0.6 37.24314 9.027063 9.310786

# Stratified population
enroll_rate <- define_enroll_rate(
  stratum = c(rep("Low", 2), rep("High", 3)),
  duration = c(2, 10, 4, 4, 8),
  rate = c(5, 10, 0, 3, 6)
)
fail_rate <- define_fail_rate(
  stratum = c(rep("Low", 2), rep("High", 2)),
  duration = 1,
  fail_rate = c(.1, .2, .3, .4),
  dropout_rate = .001,
  hr = c(.9, .75, .8, .6)
)
# Give results by change-points in the piecewise model
ahr(enroll_rate = enroll_rate, fail_rate = fail_rate, total_duration = c(15, 30))
#>   time       ahr    event     info    info0
#> 1   15 0.7332218 113.2782 28.11984 28.31954
#> 2   30 0.7175169 166.1836 41.30913 41.54590

# Same example, give results by strata and time period
pw_info(enroll_rate = enroll_rate, fail_rate = fail_rate, total_duration = c(15, 30))
#>   time stratum t   hr     event      info     info0
#> 1   15    High 0 0.80 12.076677  2.990626  3.019169
#> 2   15    High 1 0.60 23.118608  5.716292  5.779652
#> 3   15     Low 0 0.90  9.962824  2.484435  2.490706
#> 4   15     Low 1 0.75 68.120046 16.928485 17.030011
#> 5   30    High 0 0.80 14.169853  3.509171  3.542463
#> 6   30    High 1 0.60 45.213092 11.198980 11.303273
#> 7   30     Low 0 0.90  9.962824  2.484435  2.490706
#> 8   30     Low 1 0.75 96.837847 24.116546 24.209462