This function wraps gtsummary::add_stat() to calculate and display case fatality rates (deaths among cases) with 95% confidence intervals, using the epitabulate::case_fatality_rate_df() function internally.

add_cfr(gts_object, deaths_var)

Arguments

gts_object

A gtsummary object created with functions such as gtsummary::tbl_summary() or gtsummary::tbl_cross().

deaths_var

A logical variable name in the data indicating death status (e.g. TRUE for death).

Value

A modified gtsummary object with additional columns showing the number of deaths, number of cases, case fatality rate, and 95% confidence interval.