Calculate Percentage of Non-Missing Values by Year
Source:R/1a_checks_missing.R
calculate_completeness_summary.Rd
calculate_completeness_summary
computes the yearly percentage of non-missing
values across specified indicators, summarizing data completeness for each year.
Indicators with missing value flags are identified by a mis_
prefix, representing
the completeness of various indicators for each year.
Usage
calculate_completeness_summary(
.data,
admin_level = c("national", "adminlevel_1", "district"),
include_year = TRUE
)
Arguments
- .data
A
cd_data
object containing indicator data, including columns with themis_
prefix which represent missing value flags for each indicator.- admin_level
Character. The administrative level at which to calculate reporting rates. Must be one of
"national"
,"adminlevel_1"
or"district"
.- include_year
Integer. Whether to include the year
Value
A cd_completeness_summary
object containing a tibble. This tibble shows
the yearly percentages of non-missing values for each indicator and the average
percentage of non-missing values across all indicators per year.
Details
This function aggregates the percentage of non-missing values for each indicator and calculates the overall average completeness across all indicators. This provides a comprehensive view of data availability trends over time.
The function computes non-missing percentages as follows:
For each indicator, calculates the mean percentage of non-missing values by year.
Calculates additional summaries specifically for vaccination and tracer indicators.
Rounds results to two decimal places to maintain readability.