Calculate Yearly Indicator Ratios Summary with Expected Ratios
Source:R/1a_checks_ratios.R
calculate_ratios_summary.Rd
This function computes yearly summaries for specified indicator ratios, assessing trends across years and providing both actual and expected ratios for each indicator. It evaluates specified indicator pairs to calculate ratios and compares actual values with expected ratios, based on predefined survey coverage values. The summary facilitates monitoring consistency of key health indicators over time.
Arguments
- .data
A data frame containing yearly data for specified indicators. Expected columns include
district
,year
, and additional numeric columns for health indicators, such asanc1
andpenta1
.- survey_coverage
A named vector of assumed coverage rates for each indicator. Default is
c(anc1 = 0.98, penta1 = 0.97, penta3 = 0.89, opv1 = 0.97, opv3 = 0.78, pcv1 = 0.97, rota1 = 0.96)
.- anc1_penta1_mortality
A numeric multiplier applied specifically to the
"ratioAP"
ratio ofanc1
topenta1
, to account for assumed mortality betweenanc1
andpenta1
. Default is1.07
.- ratio_pairs
A named list specifying indicator pairs for which ratios should be calculated. Format:
list("ratioName" = c("numerator", "denominator"))
. Default pairs include:"ratioAP"
: Ratio ofanc1
topenta1
, adjusted withanc1_penta1_mortality
."ratioPP"
: Ratio ofpenta1
topenta3
."ratioOO"
: Ratio ofopv1
toopv3
."ratioPPcv"
: Ratio ofpenta1
topcv1
."ratioPR"
: Ratio ofpenta1
torota1
.
- adequate_range
A numeric vector of length 2 defining the acceptable range for adequacy checks. Ratios within this range are marked adequate; outside this range, inadequate. Default is
c(1, 1.5)
.
Value
A cd_ratios_summary
object, a data frame containing:
year
: Year of each calculated ratio, with an additional row"Expected Ratio"
to represent expected values for each indicator ratio based onsurvey_coverage
.Indicator Ratios: Columns for each ratio, showing actual yearly values and an expected value row based on
survey_coverage
.Additional Columns: Health indicator values for each year.
Details
The function provides insights into indicator relationships over time and evaluates
deviations from expected values. It enables data quality checks and trend analysis
by summarizing ratios yearly and including expected values for comparison. The "Expected Ratio"
row incorporates predefined survey coverage and serves as a reference for assessing
the adequacy of each indicator's ratio.
Examples
if (FALSE) { # \dontrun{
# Basic usage with default parameters
calculate_ratios_summary(cd_data)
# Custom survey coverage and mortality adjustments for "ratioAP"
calculate_ratios_summary(cd_data,
survey_coverage = c(anc1 = 0.95, penta1 = 0.92, penta3 = 0.85),
anc1_penta1_mortality = 1.05)
} # }