Analyse the dataset using extimators for the the average hazard ratio
Source:R/analyse_ahr.R
analyse_ahr.Rd
Analyse 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:
p
p value of the test, see Detailsalternative
the alternative usedAHR
/gAHR
estimated (geometric) average hazard ratioAHR_lower
/gAHR_lower
unadjusted lower bound of the confidence interval for the (geometric) average hazard ratioAHR_upper
/gAHR_upper
unadjusted upper bound of the confidence interval for the (geometric) average hazard ratioCI_level
the CI level usedN_pat
number of patientsN_evt
number 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.0002724291
#>
#> $alternative
#> [1] "two.sided"
#>
#> $AHR
#> [1] 0.6076783
#>
#> $AHR_lower
#> [1] 0.4647279
#>
#> $AHR_upper
#> [1] 0.7946001
#>
#> $CI_level
#> [1] 0.95
#>
#> $N_pat
#> [1] 300
#>
#> $N_evt
#> [1] 300
#>
analyse_ahr(type = "gAHR")(condition, dat)
#> $p
#> [1] 1.171566e-05
#>
#> $alternative
#> [1] "two.sided"
#>
#> $gAHR
#> [1] 0.5910285
#>
#> $gAHR_lower
#> [1] 0.4671682
#>
#> $gAHR_upper
#> [1] 0.7477279
#>
#> $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.8071216
#>
#> $alternative
#> [1] "two.sided"
#>
#> $AHR
#> [1] 0.8881195
#>
#> $AHR_lower
#> [1] 0.34261
#>
#> $AHR_upper
#> [1] 2.302199
#>
#> $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.8049128
#>
#> $alternative
#> [1] "two.sided"
#>
#> $gAHR
#> [1] 0.8870164
#>
#> $gAHR_lower
#> [1] 0.3425746
#>
#> $gAHR_upper
#> [1] 2.29672
#>
#> $CI_level
#> [1] 0.95
#>
#> $N_pat
#> [1] 300
#>
#> $N_evt
#> [1] 300
#>