Skip to content

Set of quality checks / cleaning / analysis / output functions related to public health outcome indicators.

License

Notifications You must be signed in to change notification settings

Ilyas1st/impactR4PHU

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

impactR4PHU

Contributor Covenant R-CMD-check codecov

Overview

impactR4PHU is designed for creating quality check reports, cleaning, analysing and outputing results of core outcome indicators of Public Health Unit. This package will target mainly Food Security and Livelihoods, WASH, Nutrition and Health Sectors.

Table of Contents

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("impact-initiatives/impactR4PHU")

Projects

Upon installing the impactR4PHU package, you will be able to access pre-coded projects related to the various sectors of Public Health. These projects aims to support country missions and the research department to check/clean/and analyse indicatores related to Public Health sectors.

To access these projects, follow the following instructions.

Go to File -> New Project…

Go to File -> New Project…

Select New Directory

Select New Directory

Scroll to find the respective projects

Scroll to find the respective projects

Data Quality

The Data Quality and Plausibility Report serves as a crucial tool for assessing the reliability and accuracy of the data collection of all related public health indicators across different assessments. This comprehensive analysis is designed to identify and address potential issues within the data, ensuring that field teams are being informed on potential issues detected in the data collection.

The report provides a detailed examination of the datasets, employing a variety of metrics and methodologies to evaluate data quality and plausibility. This includes checks for completeness, consistency, and accuracy of the data collected. This report aims to uncover any discrepancies, outliers, or anomalies that may suggest data collection, entry errors, or underlying issues that could impact the integrity of the findings.

FSL Section

This section includes: - Overall Plausibility Report / By Enumerator - All the flags related to Food Security and Livelihoods (details shown for each flag in the section) - Plots showing the distribution of the data.

Mortality Section

This section includes: - Overall Plausibility Report / By Enumerator - All the flags related to Mortality (details shown for each flag in the section) - Number of deaths(overall and under 5)/joiners/leavers as well as person times. - Plots showing the crude, under 5, and birth rates.

IYCF Section

This section includes: - Overall Plausibility Report / By Enumerator - All the flags related to IYCF (details shown for each flag in the section) - Plots showing the distribution of the data.

What to do next?

Please check each flag and the ACTION related to it and act accordingly. Another output will be associated to this HTML, the Excel file of the flags that were fired and requires follow-up with the field team. Please check the README tab in the excel file. This file will again be generated with the full data during the cleaning of the dataset. So please do use this file during data collection and relate to it in the final one to be filled.

Cleaning

The Data Cleaning Template serves as a crucial tool for assessing the data collection of all related public health indicators indicators across different assessments. This comprehensive tool is designed to identify and address potential issues within the data, ensuring that field teams are being followed up on potential issues detected in the data collection.

The report provides a detailed examination of the datasets, employing a variety of metrics and methodologies to evaluate data quality. This report aims to uncover any discrepancies, outliers, or anomalies that may suggest data collection, entry errors, or underlying issues that could impact the integrity of the findings.

FSL Section

Direct Checks - All FCS columns are 0. FCS Score is equal to 0. All values are changed to NA. - All FCS columns are 7. All values are changed to NA. - All LCSI columns are not_applicable. All values are changed to NA. - The LCSI strategy related to Displacement/Migration but HH is not a displaced group. Value of LCSI changed to NA. - The LCSI strategy related to Agriculture but HH do not have income type related to agriculture. Value of LCSI changed to NA. - The LCSI strategy related to Livestock but HH do not have income type related to livestock. Value of LCSI changed to NA.

Follow-Up Checks - Check 1: rCSI Score is high while protein consumption is also reported as frequent. - Check 2: HHs report using crisis or emergency strategies but not stress strategies or Emergency and no crisis. - Check 3: HH that would have an acceptable FCS score and a high rCSI score.

Mortality Section (Individual Level)

Follow-Up Checks - Check 1: Respondent reported more than 2 death in the HH. - Check 2:Respondent reported sex of dead person male and a cause of death related to female only. - Check 3:Respondent reported wrong dates leading to a negative person time.

Mortality Section (Household Level)

Follow-Up Checks - Check 1: Respondent reported more than 2 death in the HH.

What to do next?

Please check the files in the output/ folder. The cleaning_logbook.xlsx already can contain some of the directly cleaned data. The followup_request.xlsm file represent the checks that needs to be followed up with the field team. Please follow the instruction in the READ_ME tab to know how to fill the file. After filling the file, you can merge the [uuid/variable/old.value/new.value/issue] from the filled file with the cleaning_logbook.xlsx and add them to your cleaning scripts.

Descriptive Analysis

The Descriptive Analysis is an analytical platform that presents a multitude of quantitative data tables. It encompasses a wide range of public health indicators collected through the assessment process, empowering users to examine and interpret complex datasets effectively. This tool is structured to support understanding the distribution of your data and support you writing your factsheets/outputs/reports, and create other visualizations.

FSL Section

As you saw in the output folder, you will have another excel file outputed from the analysis script. - The Excel file includes 2 sheets. The first 2 are all the tables that you see in the different sections of this HTML output. You can navigate to respective tables through the first sheet “Table of Contents”. - Another output as well will include the IPC table.

Mortality Section

As you saw in the output folder, you will have another excel file outputed from the analysis script. - The Excel file includes 2 sheets. The first 2 are all the tables that you see in the different sections of this HTML output. You can navigate to respective tables through the first sheet “Table of Contents”.

Standalone Functions (for both Analysis or Quality checks)

library(impactR4PHU)
df <- impactR4PHU_data_template

FSL ADD Indicators

Example:: Add Food Consumption Score (FCS)

df_with_fcs <- df %>% add_fcs(
  cutoffs = "normal",
  fsl_fcs_cereal = "fsl_fcs_cereal",
  fsl_fcs_legumes = "fsl_fcs_legumes",
  fsl_fcs_veg = "fsl_fcs_veg",
  fsl_fcs_fruit = "fsl_fcs_fruit",
  fsl_fcs_meat = "fsl_fcs_meat",
  fsl_fcs_dairy = "fsl_fcs_dairy",
  fsl_fcs_sugar = "fsl_fcs_sugar",
  fsl_fcs_oil = "fsl_fcs_oil"
)

Example:: Add Household Hunger Scale (HHS)

df_with_hhs <- df_with_fcs %>% add_hhs(
  fsl_hhs_nofoodhh = "fsl_hhs_nofoodhh",
  fsl_hhs_nofoodhh_freq = "fsl_hhs_nofoodhh_freq",
  fsl_hhs_sleephungry = "fsl_hhs_sleephungry",
  fsl_hhs_sleephungry_freq = "fsl_hhs_sleephungry_freq",
  fsl_hhs_alldaynight = "fsl_hhs_alldaynight",
  fsl_hhs_alldaynight_freq = "fsl_hhs_alldaynight_freq",
  yes_answer = "yes",
  no_answer = "no",
  rarely_answer = "rarely",
  sometimes_answer = "sometimes",
  often_answer = "often"
)

Example:: Add Livelihood Coping Strategy score (LCSI)

df_with_lcsi <- df_with_hhs %>% add_lcsi(
  fsl_lcsi_stress1 = "fsl_lcsi_stress1",
  fsl_lcsi_stress2 = "fsl_lcsi_stress2",
  fsl_lcsi_stress3 = "fsl_lcsi_stress3",
  fsl_lcsi_stress4 = "fsl_lcsi_stress4",
  fsl_lcsi_crisis1 = "fsl_lcsi_crisis1",
  fsl_lcsi_crisis2 = "fsl_lcsi_crisis2",
  fsl_lcsi_crisis3 = "fsl_lcsi_crisis3",
  fsl_lcsi_emergency1 = "fsl_lcsi_emergency1",
  fsl_lcsi_emergency2 = "fsl_lcsi_emergency2",
  fsl_lcsi_emergency3 = "fsl_lcsi_emergency3",
  yes_val = "yes",
  no_val = "no_had_no_need",
  exhausted_val = "no_exhausted",
  not_applicable_val = "not_applicable"
)

Example:: Add Reduced Household Coping Strategy score (rCSI)

df_with_rcsi <- df_with_lcsi %>% add_rcsi(
  fsl_rcsi_lessquality = "fsl_rcsi_lessquality",
  fsl_rcsi_borrow = "fsl_rcsi_borrow",
  fsl_rcsi_mealsize = "fsl_rcsi_mealsize",
  fsl_rcsi_mealadult = "fsl_rcsi_mealadult",
  fsl_rcsi_mealnb = "fsl_rcsi_mealnb"
)

Example:: Add Household Dietary Diversity Score (HDDS)

df_with_hdds <- df_with_rcsi %>% add_hdds(
   fsl_hdds_cereals = "fsl_hdds_cereals",
   fsl_hdds_tubers = "fsl_hdds_tubers",
   fsl_hdds_veg = "fsl_hdds_veg",
   fsl_hdds_fruit = "fsl_hdds_fruit",
   fsl_hdds_meat = "fsl_hdds_meat",
   fsl_hdds_eggs = "fsl_hdds_eggs",
   fsl_hdds_fish = "fsl_hdds_fish",
   fsl_hdds_legumes = "fsl_hdds_legumes",
   fsl_hdds_dairy = "fsl_hdds_dairy",
   fsl_hdds_oil = "fsl_hdds_oil",
   fsl_hdds_sugar = "fsl_hdds_sugar",
   fsl_hdds_condiments = "fsl_hdds_condiments"
)

Example:: Add Food Consumption Matrix (FCM) using FCS, RCSI, and HHS

Notice that these functions are also pipable

df_with_fcm_1 <- df_with_hdds %>%
  add_fcm_phase(
    fcs_column_name = "fsl_fcs_cat",
    rcsi_column_name = "fsl_rcsi_cat",
    hhs_column_name = "fsl_hhs_cat_ipc",
    fcs_categories_acceptable = "Acceptable",
    fcs_categories_poor = "Poor",
    fcs_categories_borderline = "Borderline",
    rcsi_categories_low = "No to Low",
    rcsi_categories_medium = "Medium",
    rcsi_categories_high = "High",
    hhs_categories_none = "None",
    hhs_categories_little = "No or Little",
    hhs_categories_moderate = "Moderate",
    hhs_categories_severe = "Severe",
    hhs_categories_very_severe = "Very Severe"
  )

Example:: Add Food Consumption Matrix (FCM) using HDDS, RCSI, and HHS

Notice that these functions are also pipable

df_with_fcm_2 <- df_with_hdds %>%
  add_fcm_phase(
    hdds_column_name = "fsl_hdds_cat",
    rcsi_column_name = "fsl_rcsi_cat",
    hhs_column_name = "fsl_hhs_cat_ipc",
    hdds_categories_low = "Low",
    hdds_categories_medium = "Medium",
    hdds_categories_high = "High",
    rcsi_categories_low = "No to Low",
    rcsi_categories_medium = "Medium",
    rcsi_categories_high = "High",
    hhs_categories_none = "None",
    hhs_categories_little = "No or Little",
    hhs_categories_moderate = "Moderate",
    hhs_categories_severe = "Severe",
    hhs_categories_very_severe = "Very Severe"
  )

Example:: Add Food Consumption Matrix (FCM) using FCS and HHS

Notice that these functions are also pipable

df_with_fcm_3 <- df_with_hdds %>%
  add_fcm_phase(
    fcs_column_name = "fsl_fcs_cat",
    hhs_column_name = "fsl_hhs_cat_ipc",
    fcs_categories_acceptable = "Acceptable",
    fcs_categories_poor = "Poor",
    fcs_categories_borderline = "Borderline",
    hhs_categories_none = "None",
    hhs_categories_little = "No or Little",
    hhs_categories_moderate = "Moderate",
    hhs_categories_severe = "Severe",
    hhs_categories_very_severe = "Very Severe"
  )

Example:: Add Food Consumption Matrix (FCM) using HDDS and HHS

Notice that these functions are also pipable

df_with_fcm_4 <- df_with_hdds %>%
  add_fcm_phase(
    hdds_column_name = "fsl_hdds_cat",
    hhs_column_name = "fsl_hhs_cat_ipc",
    hdds_categories_low = "Low",
    hdds_categories_medium = "Medium",
    hdds_categories_high = "High",
    hhs_categories_none = "None",
    hhs_categories_little = "No or Little",
    hhs_categories_moderate = "Moderate",
    hhs_categories_severe = "Severe",
    hhs_categories_very_severe = "Very Severe"
  )

Example:: Add FEWSNET Food Consumption-Livelihood Matrix (FCLCM)

Notice that these functions are also pipable

df_with_fclcm <- df_with_fcm_1 %>% ## Taken from previous Example
  add_fclcm_phase()

NUTRITION ADD Indicators

df_nut <- impactR4PHU_data_nut_template

Example:: Add MUAC

df_with_muac <- df_nut %>% 
  add_muac()

Example:: Add MFAZ

df_with_mfaz <- df_with_muac %>% 
  add_mfaz()
## ================================================================================

Example:: Add IYCF

df_iycf <- impactR4PHU_iycf_template_data
df_with_iycf <- df_iycf %>% 
  add_iycf(uuid = "_submission__uuid",
           age_months = "child_age_months_2")

Checking Flags

tool <- impactR4PHU_survey_template

Example:: Check Food Security and Livelihoods Flags

fsl_flags <- df_with_fclcm %>% 
  check_fsl_flags(tool.survey = tool)

Example:: Check Anthropometric Flags

anthro_flags <- df_with_mfaz %>% 
  check_anthro_flags(loop_index = "loop_index")

Example:: Check WASH Flags

container_df <- impactR4PHU_data_wash_template
wash_flags <- df %>% 
  check_wash_flags(data_container_loop = container_df)
## Joining with `by = join_by(uuid)`

Example:: Check Health Flags (to add more flags related to WGSS)

msna_data <- impactR4PHU_MSNA_template_data
health_flags <- check_health_flags(
  .dataset = msna_data
)

Example:: Check IYCF Flags

iycf_flags <- check_iycf_flags(
  .dataset = df_with_iycf,
  age_months = "child_age_months_2",
  uuid = "_submission__uuid"
)

Code of Conduct

Please note that the impactR4PHU project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

About

Set of quality checks / cleaning / analysis / output functions related to public health outcome indicators.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%