Skip to contents

compute_dx_gap() calculates a diagnostic gap defined as the proportion of the population with the condition who are undiagnosed.

Usage

compute_dx_gap(data, estimated, notified, ...)

Arguments

data

Input data.

estimated

An unquoted name for estimated cases.

notified

An unquoted name for notified cases.

...

Further arguments passed to mutate().

Value

A tibble, the same dimensions as the input data, but with one additional column called dx_gap containing the computed diagnostic gap values

Calculation

For each country and year in the data, the diagnostic gap can be computed as follows:

diagnostic gap = (estimated cases - notified cases) / estimated cases

In other words, we can define the diagnostic gap as the gap between the estimated number of people who fall ill each year and the number of people who are officially reported as having been diagnosed. This means that the diagnostic gap represents people who have the illness but are not officially diagnosed, due to limitations or challenges in the healthcare system.

Examples

if (FALSE) {
# Calculate diagnostic gap for 2019 TB data:
dx_gap_vars <- c("country_code", "year", "e_inc_num", "c_newinc")
build_tbl("tb", year = 2019, vars = dx_gap_vars) |>
  compute_dx_gap(e_inc_num, c_newinc)
}