Calculate Threshold Coverage for Health Indicators
Source:R/calculate_indicator_threshold_coverage.R
calculate_indicator_threshold_coverage.Rd
This function calculates the percentage of districts where coverage for specific health indicators falls below a 10% threshold, for each year. The function generates a binary variable for each indicator, denoting whether it is below 10%, and then calculates the average percentage of below-threshold coverage for each indicator.
Arguments
- .data
A data frame or tibble containing health indicator coverage data with columns named in the format
cov_<indicator>_<source>
, where<indicator>
is one of "zerodose", "undervax", "dropout_penta13", "dropout_measles12", "dropout_penta3mcv1", or "dropout_penta1mcv1", and<source>
is one of "dhis2", "penta1", or "anc1".
Value
A tibble with the yearly average percentage of below-threshold coverage for each indicator-source combination, where each value represents the percentage of districts with below 10% coverage for that indicator and source.
Details
The function performs the following steps:
Generate Binary Below-Threshold Variables: For each indicator-source combination, it generates a binary variable indicating if coverage is below 10% (1 if below 10% and 0 otherwise).
Rename Columns: The generated columns are renamed by removing the
cov_
prefix.Summarize: The function then calculates the mean of each below-threshold indicator across all districts, grouped by
year
, resulting in the percentage of districts below 10% for each indicator-source.Round to Percentage: The percentages are then multiplied by 100 and rounded to one decimal place. Any missing values are set to 0%.