calc_dshr_from_ohr: Disease-specific hazard ratio (dsHR) from an overall hazard...

View source: R/dshr_from_ohr.R

calc_dshr_from_ohrR Documentation

Disease-specific hazard ratio (dsHR) from an overall hazard ratio (oHR)

Description

calc_dshr_from_ohr calculates a dsHR from an oHR for a cohort with initial age n_age_init in a trial with duration of trial_time years with a disease-specific mortality rate, mu_Dis, under a specific continuous-time hazard function for background mortality.

Usage

calc_dshr_from_ohr(ohr = 0.55, mu_Dis = 0.05, n_age_init = 50,
  trial_time = 5, mu0 = NULL, alpha = NULL, hazard = c("empirical",
  "exponential", "linear", "geometric"), mortality = NULL)

Arguments

ohr

Overall hazard ratio

mu_Dis

Disease-specific mortality rate

n_age_init

Initial age of the cohort in the trial

trial_time

Length of the trial

mu0

Age-independent mortality rate coefficient

alpha

Age-dependent mortality rate coefficient

hazard

The hazard function to be used for background mortality. Either empirical (e.g., from life tables) or a continuous-time functional form.

mortality

A data.frame with two columns. The first column should have age in yearly increments and the second column should have the mortality rate corresponding to the age. If NULL, the function will use all_cause_mortality.

Value

The disease-specific hazard ratio (dsHR)

Details

This function requires the average background mortality of the cohort, which is computed with the function calc_avg_mort.

Examples

n_age_init <- 50   # Initial age of cohort in trial
trial_time <- 5    # Length of clinial trial in years
ohr        <- 0.55 # Overall hazard ratio (oHR)
mu_Dis     <- 0.05 # Disease-specific mortality rate
## Not run: 
   dshr_emp <- calc_dshr_from_ohr(ohr = ohr, mu_Dis = mu_Dis,
   n_age_init = n_age_init, 
   trial_time = trial_time, 
   hazard = "empirical")
   dshr_emp

## End(Not run)

feralaes/dshr documentation built on Aug. 28, 2023, 2:17 p.m.