Skip to contents

AHR() 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

AHR(
  enroll_rate = tibble::tibble(stratum = "All", duration = c(2, 2, 10), rate = c(3, 6,
    9)),
  fail_rate = tibble::tibble(stratum = "All", duration = c(3, 100), fail_rate =
    log(2)/c(9, 18), hr = c(0.9, 0.6), dropout_rate = rep(0.001, 2)),
  total_duration = 30,
  ratio = 1,
  simple = TRUE
)

Arguments

enroll_rate

Piecewise constant enrollment rates by stratum and time period.

fail_rate

Piecewise constant control group failure rates, duration for each piecewise constant period, hazard ratio for experimental vs control, and dropout rates by stratum and time period.

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.

simple

logical; if TRUE (default), for each value in input total_duration overall event count, statistical information and average hazard ratio are given; if FALSE, hazard ratio, expected events and statistical information are produced by stratum and underlying hazard ratio.

Value

A tibble with Time (from total_duration), AHR (average hazard ratio), Events (expected number of events), info (information under given scenarios), and info0 (information under related null hypothesis) for each value of total_duration input; if simple=FALSE, stratum and t (beginning of each constant HR period) are also returned and HR is returned instead of AHR

Specification

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

Examples

# Example: default
AHR()
#> # A tibble: 1 × 5
#>    Time   AHR Events  info info0
#>   <dbl> <dbl>  <dbl> <dbl> <dbl>
#> 1    30 0.695   58.5  14.3  14.6

# Example: default with multiple analysis times (varying total_duration)

AHR(total_duration = c(15, 30))
#> # A tibble: 2 × 5
#>    Time   AHR Events  info info0
#>   <dbl> <dbl>  <dbl> <dbl> <dbl>
#> 1    15 0.786   30.3  7.44  7.57
#> 2    30 0.695   58.5 14.3  14.6 

# Stratified population
enroll_rate <- tibble::tibble(
  stratum = c(rep("Low", 2), rep("High", 3)),
  duration = c(2, 10, 4, 4, 8),
  rate = c(5, 10, 0, 3, 6)
)
fail_rate <- tibble::tibble(
  stratum = c(rep("Low", 2), rep("High", 2)),
  duration = 1,
  fail_rate = c(.1, .2, .3, .4),
  hr = c(.9, .75, .8, .6),
  dropout_rate = .001
)
AHR(enroll_rate = enroll_rate, fail_rate = fail_rate, total_duration = c(15, 30))
#> # A tibble: 2 × 5
#>    Time   AHR Events  info info0
#>   <dbl> <dbl>  <dbl> <dbl> <dbl>
#> 1    15 0.733   113.  28.1  28.3
#> 2    30 0.718   166.  41.3  41.5

# Same example, give results by strata and time period
AHR(enroll_rate = enroll_rate, fail_rate = fail_rate, total_duration = c(15, 30), simple = FALSE)
#> # A tibble: 8 × 7
#>    Time stratum     t    HR Events  info info0
#>   <dbl> <chr>   <dbl> <dbl>  <dbl> <dbl> <dbl>
#> 1    15 High        0  0.8   12.1   2.99  3.02
#> 2    15 High        1  0.6   23.1   5.72  5.78
#> 3    15 Low         0  0.9    9.96  2.48  2.49
#> 4    15 Low         1  0.75  68.1  16.9  17.0 
#> 5    30 High        0  0.8   14.2   3.51  3.54
#> 6    30 High        1  0.6   45.2  11.2  11.3 
#> 7    30 Low         0  0.9    9.96  2.48  2.49
#> 8    30 Low         1  0.75  96.8  24.1  24.2