Analyse the dataset using extimators for the the average hazard ratio
Source:R/analyse_ahr.R
analyse_ahr.RdAnalyse the dataset using extimators for the the average hazard ratio
Details
The implementation from the nph package is used, see the documentation there for details.
alternative can be "two.sided" for a two sided test of equality of the
summary statistic or "one.sided" for a one sided test testing H0: treatment
has equal or shorter survival than control vs. H1 treatment has longer
survival than control.
The data.frame returned by the created function includes the follwing columns:
pp value of the test, see Detailsalternativethe alternative usedAHR/gAHRestimated (geometric) average hazard ratioAHR_lower/gAHR_lowerunadjusted lower bound of the confidence interval for the (geometric) average hazard ratioAHR_upper/gAHR_upperunadjusted upper bound of the confidence interval for the (geometric) average hazard ratioCI_levelthe CI level usedN_patnumber of patientsN_evtnumber of events
Examples
condition <- merge(
assumptions_delayed_effect(),
design_fixed_followup(),
by = NULL
) |>
head(1)
dat <- generate_delayed_effect(condition)
analyse_ahr()(condition, dat)
#> $p
#> [1] 0.00150469
#>
#> $alternative
#> [1] "two.sided"
#>
#> $AHR
#> [1] 0.6491712
#>
#> $AHR_lower
#> [1] 0.4971435
#>
#> $AHR_upper
#> [1] 0.8476892
#>
#> $CI_level
#> [1] 0.95
#>
#> $N_pat
#> [1] 300
#>
#> $N_evt
#> [1] 300
#>
analyse_ahr(type = "gAHR")(condition, dat)
#> $p
#> [1] 5.947422e-05
#>
#> $alternative
#> [1] "two.sided"
#>
#> $gAHR
#> [1] 0.6168291
#>
#> $gAHR_lower
#> [1] 0.4872241
#>
#> $gAHR_upper
#> [1] 0.7809099
#>
#> $CI_level
#> [1] 0.95
#>
#> $N_pat
#> [1] 300
#>
#> $N_evt
#> [1] 300
#>
analyse_ahr(max_time = 50, type = "AHR")(condition, dat)
#> $p
#> [1] 0.9891188
#>
#> $alternative
#> [1] "two.sided"
#>
#> $AHR
#> [1] 1.006843
#>
#> $AHR_lower
#> [1] 0.3778458
#>
#> $AHR_upper
#> [1] 2.682928
#>
#> $CI_level
#> [1] 0.95
#>
#> $N_pat
#> [1] 300
#>
#> $N_evt
#> [1] 300
#>
analyse_ahr(max_time = 50, type = "gAHR")(condition, dat)
#> $p
#> [1] 0.9946157
#>
#> $alternative
#> [1] "two.sided"
#>
#> $gAHR
#> [1] 1.003376
#>
#> $gAHR_lower
#> [1] 0.3770532
#>
#> $gAHR_upper
#> [1] 2.670081
#>
#> $CI_level
#> [1] 0.95
#>
#> $N_pat
#> [1] 300
#>
#> $N_evt
#> [1] 300
#>