Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

another update #292

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 146 additions & 19 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ knitr::opts_chunk$set(echo = TRUE)
- Cleaning
- Analysis
- [PH Integrated Tables](#ph-integrated-tables)
- Execution
- [Potential Errors and How to fix them](#potential-errors-and-how-to-fix-them)
- [Standalone Functions](#standalone-functions)
- [FSL ADD INDICATORS](#fsl-add-indicators)
Expand Down Expand Up @@ -76,11 +77,11 @@ Upon installing the impactR4PHU package, you will be able to access pre-coded pr

To access these projects, follow the following instructions.

![Go to File -> New Project...](./man/figures/projects_1.png)
![](./man/figures/projects_1.png)

![Select New Directory](./man/figures/projects_2.png)
![](./man/figures/projects_2.png)

![Scroll to find the respective projects](./man/figures/projects_3.png)
![](./man/figures/projects_3.png)


### Data Quality
Expand All @@ -94,7 +95,7 @@ The report provides a detailed examination of the datasets, employing a variety
Once the project is selected and saved as shown in the previous section, automatically the respective file that you need to run will open.
First thing, you should select all the line codes in the file, and click run as shown in the following picture.

![Select all the lines and click run](./man/figures/projects_4.png)
![](./man/figures/projects_4.png)

The next step will requires you to answer/click/select/input some information related to the sector that you are trying to check the quality for. Generally this will include:
<ul>
Expand Down Expand Up @@ -196,7 +197,7 @@ The output includes:

Here is an example of the output:

![HTML Output](./man/figures/fsl_quality.png)
![](./man/figures/fsl_quality.png)

#### Mortality Section

Expand Down Expand Up @@ -291,8 +292,8 @@ Here is an example of the output:

Here is an example of the output:

![HTML Output](./man/figures/mortality_quality.png)
![Examples of plots](./man/figures/plot_quality.png)
![](./man/figures/mortality_quality.png)
![](./man/figures/plot_quality.png)

#### IYCF Section

Expand Down Expand Up @@ -373,6 +374,16 @@ Here is an example of the output:
<li> Plots showing the distribution of the data. </li>
</ul>

![](./man/figures/iycf_quality_1.png)

Here is an explanation of each of the plausibility line:

![](./man/figures/iycf_quality_2.png)

Here are examples of the flags to be checked (details of each flag is explained in the cleaning section next):

![](./man/figures/iycf_quality_3.png)

#### What to do next?

Please check each flag and the <strong>ACTION</strong> 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.
Expand All @@ -388,7 +399,7 @@ The report provides a detailed examination of the datasets, employing a variety
Once the project is selected and saved as shown in the previous section, automatically the respective file that you need to run will open.
First thing, you should select all the line codes in the file, and click run as shown in the following picture.

![Select all the lines and click run](./man/figures/projects_4.png)
![](./man/figures/projects_4.png)

The next step will requires you to answer/click/select/input some information related to the sector that you are trying to check the quality for. Generally this will include:
<ul>
Expand Down Expand Up @@ -790,10 +801,13 @@ After running all the line in the run_fsl_descriptive_analysis.R, below are the

As you saw in the output folder, you will have another excel file outputted from the analysis script.
<ul>
<li> 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". </li>
<li> Another output as well will include the IPC table.</li>
<li>HTML file including all the extra selected variables for analysis, as well as the main FSL outcome indicators overalls.</li>
<li> The Excel file includes 2 sheets. The first 2 are all the tables that you will see in the HTML output. You can navigate to respective tables through the first sheet "Table of Contents". </li>
<li> Another output as well is an excel file that includes all the FSL outcome indicators formatted for the IPC.</li>
</ul>

![](./man/figures/fsl_descriptive.png)

#### Mortality Section

After running all the line in the run_mort_descriptive_analysis.R, below are the set of inputs that are required for you to select/fill.<strong>Please note that in case of a missing column, please proceed in selecting cancel. However, make sure with the respective focal point if it is an important column.</strong>
Expand Down Expand Up @@ -895,7 +909,7 @@ As you saw in the output folder, you will have another excel file outputted from
<li>PH integrated table excel file that is used as input for the Integrated PH Tables project.</li>
</ul>

![Disaggregations Mortality](./man/figures/mortality_descriptive.png)
![](./man/figures/mortality_descriptive.png)

#### IYCF

Expand Down Expand Up @@ -970,13 +984,14 @@ After running all the line in the run_iycf_descriptive_analysis.R, below are the
</details>

<ul>
<li>HTML output with the extra analysis done, as well as plots and combined tables for IYCF outcome indicators for different age groups [0-23/0-6/12-23/6-8/6-23 months].</li>
<li>HTML output with the extra analysis done, as well as plots and combined tables for IYCF outcome indicators for different age groups (0-23/0-6/12-23/6-8/6-23 months).</li>
<li>The Excel file includes 2 sheets. The first 2 are all the tables that you see in the First Part of the HTML output. You can navigate to respective tables through the first sheet "Table of Contents".</li>
</ul>

![IYCF 1](./man/figures/iycf_descriptive_1.png)
![](./man/figures/iycf_descriptive_1.png)

![](./man/figures/iycf_descriptive_2.png)

![IYCF 2](./man/figures/iycf_descriptive_2.png)
### IPHRA

The use case for this toolkit is intended to be in acute crises where there is a realistic possibility of deterioration of public health outcomes in the population to be assessed. This is not intended to be an urgent rapid assessment done within the first 72 hours, which tend to be more qualitative, but instead the intended timeline should be after an initial stabilization of a situation and population movements, maybe one month after an initial shock or hazard, depending on the situation. The general objective and purpose of an IPHRA assessment is “to assess the severity of the public health situation and identify initial public health priorities for response to mitigate excess morbidity, malnutrition, and mortality.”
Expand All @@ -1001,7 +1016,7 @@ The Integrated Table serves as a comprehensive tool for evaluating public health

Here is a table showing the different indicators and the thresholds

![PH TABLES](./man/figures/ph_tables.png)
![](./man/figures/ph_tables.png)

#### Impact on Population (Health Outcomes)

Expand Down Expand Up @@ -1060,6 +1075,118 @@ However if (1st quantile - IQR) for the Extremely High threshold is yielding a n

The project will follow a user input requirements method. Some of the WASH inputs might require visiting the [humind package](https://impact-initiatives-hppu.github.io/humind/), to understand the categories of the improved/unimproved drinking water and sanitation questions and potentially other indicators.


#### Execution

Once the project is selected and saved as shown in the previous section, automatically the respective file that you need to run will open.
First thing, you should select all the line codes in the file, and click run as shown in the following picture.

![](./man/figures/projects_4.png)

The next step will requires you to answer/click/select/input some information related to the sector that you are trying to check the quality for. Generally this will include:
<ul>
<li> Data that includes the above mentioned indicators</li>
<li> If mortality collected, the PH Integrated related excel file outputted from the Mortality Descriptive Analysis Project</li>
<li> Inputs of specific columns/values that will be targeted within the quality check.</li>
</ul>


After running all the line in the run_ph_integrated_tables.R, below are the set of inputs that are required for you to select/fill. <strong>Please note that in case of a missing column, please proceed in selecting cancel. However, make sure with the respective focal point if it is an important column.</strong>

<details><summary><h4>Details</h4></summary>

>`Data` <- Dataset.<br>
> If mortality collected:<br>
>`Mortality related output` <- Related mortality integrated outputed from the descriptive analysis script<br>
>`Is your data weighted` <- Question to check if your data is weighted (Yes/No).<br>
>`Weight` <- If yes, select the weight column in your data. <br>
>`Death Cause` <- Cause of Death column in died members individual sheet<br>
>`HH UUID Died column` <- Household unique identifier in died members individual sheet(usually _submission__uuid)<br>
>`Admin 1` <- Admin 1 column<br>
>`FSL indicators` <- FSL indicators you have collected in your data.<br>
>`fsl_fcs_cereal`<- Cereal Column related to Food Consumption Score <br>
>`fsl_fcs_legumes`<- Legumes Column related to Food Consumption Score <br>
>`fsl_fcs_veg`<- Vegetables Column related to Food Consumption Score <br>
>`fsl_fcs_fruit`<- Fruit Column related to Food Consumption Score <br>
>`fsl_fcs_meat`<- Meat Column related to Food Consumption Score <br>
>`fsl_fcs_dairy`<- Dairy Column related to Food Consumption Score <br>
>`fsl_fcs_sugar`<- Sugar Column related to Food Consumption Score <br>
>`fsl_fcs_oil`<- Oil Column related to Food Consumption Score <br>
>If rCSI selected<br>
>`fsl_rcsi_lessquality` <- rCSI Less Quality Food Column<br>
>`fsl_rcsi_borrow` <- rCSI Borrowing Food Column<br>
>`fsl_rcsi_mealsize` <- rCSI Reducing Meal Size Column<br>
>`fsl_rcsi_mealadult` <- rCSI Reduce Meals For Adults and Prioritize Child Meals Column<br>
>`fsl_rcsi_mealnb` <- rCSI Reduce Meal Numbers Column<br>
>If HHS selected<br>
>`fsl_hhs_nofoodhh` <- HHS No Food in the Household Column<br>
>`fsl_hhs_nofoodhh_freq` <- HHS Frequency No Food in the Household Column<br>
>`fsl_hhs_sleephungry` <- HHS Sleeping Hungry Column<br>
>`fsl_hhs_sleephungry_freq` <- HHS Frequency Sleeping Hungry Column<br>
>`fsl_hhs_alldaynight` <- HHS All Day and Night Without Eating Column<br>
>`fsl_hhs_alldaynight_freq` <- HHS All Day and Night Without Eating Column<br>
>`Yes Value` <- HHS Yes value<br>
>`No Value` <- HHS No value<br>
>`Rarely Value` <- HHS Frequency Rarely value<br>
>`Sometimes Value` <- HHS Frequency Sometimes value<br>
>`Often Value` <- HHS Frequency Often value<br>
>If LCSI selected: 4 LCSI Stress, 3 LCSI Crisis, and 3 LCSI Emergency are required<br>
>`fsl_lcsi_stress1` <- LCSI Stress 1 Column<br>
>`fsl_lcsi_stress2` <- LCSI Stress 2 Column<br>
>`fsl_lcsi_stress3` <- LCSI Stress 3 Column<br>
>`fsl_lcsi_stress4` <- LCSI Stress 4 Column<br>
>`fsl_lcsi_crisis1` <- LCSI Crisis 1 Column<br>
>`fsl_lcsi_crisis1` <- LCSI Crisis 1 Column<br>
>`fsl_lcsi_crisis2` <- LCSI Crisis 2 Column<br>
>`fsl_lcsi_emergency2` <- LCSI Emergency 2 Column<br>
>`fsl_lcsi_emergency3` <- LCSI Emergency 3 Column<br>
>`fsl_lcsi_emergency3` <- LCSI Emergency 3 Column<br>
>`Yes Value` <- LCSI Yes value<br>
>`No Value` <- LCSI No had no need value<br>
>`Exhausted Value` <- LCSI No exhausted value<br>
>`Not Applicable Value` <- LCSI Not Applicable value<br>
>`Yes Value` <- HDDS Yes value<br>
>`No Value` <- HDDS No value<br>
>`Survey modality` <- Survey Modality column (remote/face-to-face)<br>
>`Handwashing Facility` <- Handwashing Facility column<br>
>`Yes Value` <- Yes Value for Handwashing Facility Question<br>
>`None Value` <- None Value for Handwashing Facility Question<br>
>`No Permission Value` <- No Permission Value for Handwashing Facility Question<br>
>`Other Value` <- Other Value for Handwashing Facility Question<br>
>`Handwashing Facility Observed Water` <- Handwashing Facility Water Observed column<br>
>`Yes Value` <- Yes Value for Handwashing Facility Observed Water Question<br>
>`No Value` <- No Value for Handwashing Facility Observed Water Question<br>
>`Handwashing Facility Observed Soap` <- Handwashing Facility Soap Observed column<br>
>`Yes Value` <- Yes Value for Handwashing Facility Observed Soap Question<br>
>`No Value` <- No Value for Handwashing Facility Observed Soap Question<br>
>`Alternative Value` <- Alternative Value for Handwashing Facility Observed Soap Question<br>
>`Handwashing Facility Reported` <- Handwashing Facility Reported column<br>
>`Yes Value` <- Yes Value for Handwashing Facility Reported Question<br>
>`No Value` <- No Value for Handwashing Facility Reported Question<br>
>`Undefined Value` <- Undefined Value for Handwashing Facility Reported Question<br>
>`Reported No Permission Soap` <- Reported No Permission Soap column<br>
>`Yes Value` <- Yes Value for Reported No Permission Soap Question<br>
>`No Value` <- No Value for Reported No Permission Soap Question<br>
>`Undefined Value` <- Undefined Value for Reported No Permission Soap Question<br>
>`Reported No Permission Soap Type` <- Reported No Permission Soap Type column<br>
>`Yes Value` <- Yes Value for Reported No Permission Soap Type Question<br>
>`No Value` <- No Value for Reported No Permission Soap Type Question<br>
>`Undefined Value` <- Undefined Value for Reported No Permission Soap Type Question<br>


>`Number of children` <- Number of Children Under 5 Column<br>
>`Income Types` <- Different Income Types Numeric Columns<br>
>`Residence Status` <- Residence Status Column (IDP/HH/Refugee/etc.)<br>
>If Residence Status column exist<br>
>`IDP Value` <- IDP value<br>
>`Teams of Enumerator/Different Organizations` <- Do you have teams of Enumerators or Different Organizations collecting data<br>
>If Yes<br>
>`Teams/Organization` <- Teams of Enumerator/Organizations Column<br>
>`Enumerator` <- Enumerator ID Column<br>

</details>


The output will include 3 sheets:

<ul>
Expand All @@ -1070,21 +1197,21 @@ The output will include 3 sheets:

Here is an example (dummy Somalia Data):

![Example PH TABLES](./man/figures/example_ph.png)
![](./man/figures/example_ph.png)

## Potential Errors and How to fix them

During the run of the integrated projects, some errors might occur. <br> Please see some of these errors that were already caught and the way to solve them.

### lazy-load Error

![Lazy Load Error](./man/figures/just_restart.png)
![](./man/figures/just_restart.png)
This error usually appears after the scripts taking some time (5-10 mins) to load due to the upload of the packages. <br>
To solve this issue, only restart the session or R by going to the tab part -> Session -> Restart R (or CTRL + SHIFT + F10), and rerun the script again.

### 'make' not found

![make not found](./man/figures/make_error.png)
![](./man/figures/make_error.png)
This error usually appears during the installation of packages the first time you are running the scripts. The projects are wrapped within something called R Environment that automatically install and load the necessary packages for the project. Some of these packages are constantly maintained by their owners and new versions are deployed regularly. The script try to check for any updates in the package and upload the newest. However, if the error still shows, specially with <strong>Error: Error Installing package 'XXXX'</strong>, you have two options.
<ul>
<li>If you are comfortable handling some debugging, please try to find the latest version of the mentioned package in the error in the web, usually searching (PACKAGE NAME latest version in r) show you something called the CRAN where you can see the latest version. Then, open renv.lock, and target the actual package (attention, not where it is mentioned as dependency to another package), then replace the version with the latest one. Please do contact Abraham Azar ([email protected]) or the PHU team ([email protected]) mentioning the updated package name and the version.</li>
Expand All @@ -1093,7 +1220,7 @@ This error usually appears during the installation of packages the first time yo

### Wrong dates in mortality

![Wrong dates in mortality](./man/figures/wrong_dates.png)
![](./man/figures/wrong_dates.png)

If the above error appears while running the mortality quality report or descriptive analysis projects, this means that you have a possible issue between the birth dates and the death dates in the death loop. Most probably, one of the death have a recorded birth date after the recorded death date. Make sure to fix the dates before running the scripts.

Expand Down
Loading
Loading