Skip to contents

This function filters health indicator data to identify the percentage of administrative regions where the coverage for a specified indicator falls below a 10% threshold for a given year. If no regions meet the criteria (i.e., all values are below the threshold), a default output is returned.

Usage

calculate_threshold(
  .data,
  admin_level = c("adminlevel_1", "district"),
  indicator = c("coverage", "dropout")
)

Arguments

.data

A tibble of class cd_data.

admin_level

The level of analysis.

indicator

Character. The specific health indicator to evaluate. Options are:

  • "coverage":coverage indicators.

  • "dropout": dropout indicators.

Value

A tibble with the selected administrative level and coverage value for regions that do not meet the below-10% threshold for the specified indicator and year. If no regions meet the criteria, a default row is returned with "None" and 0 as values.

Examples

if (FALSE) { # \dontrun{
  # Example usage:
  result <- calculate_threshold(data, filter_year = 2023, indicator = "zerodose", source = "dhis2")
  result
} # }