This function wraps gtsummary::add_stat() to calculate and display
mortality rates (deaths per given population multiplier) with 95%
confidence intervals, using the epitabulate::mortality_rate() function
internally.
add_mr(
  gts_object,
  deaths_var,
  population = NULL,
  multiplier = 10^4,
  drop_tblsummary_stat = FALSE
)A gtsummary object created with functions such as
gtsummary::tbl_summary() or gtsummary::tbl_cross().
A logical variable name in the data indicating death
status (e.g. TRUE for death).
Optional numeric vector giving the population size for
the denominator. If NULL, the population is inferred from the data.
Numeric multiplier used to scale the mortality rate
(e.g. 1 = proportion, 100 = percent, 10^4 = per 10,000).
Logical; if TRUE, removes the original
tbl_summary statistic column (default = FALSE).
A modified gtsummary object with additional columns showing the number of deaths, population, mortality rate, and 95% confidence interval.