├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── Bug-Report.YML │ ├── bug_report.md │ ├── config.yml │ ├── indicator.yml │ └── test.yml ├── .gitignore ├── Analysis ├── Debt-analysis │ ├── Debt-analysis.do │ └── Debt-analysis.sps ├── Gap-analysis │ ├── Gap_Analysis_Example.do │ ├── Gap_Analysis_Example.sps │ ├── Gap_Analysis_Example_tidyverse.R │ └── README.md └── README.md ├── CONTRIBUTING.md ├── Indicators ├── ABI-CRF-25 │ ├── abi25.sps │ └── abi25_tidyverse.R ├── Consolidated-Approach-to-Reporting-Indicators-of-Food-Security │ ├── CARI-ECMEN.do │ ├── CARI-ECMEN.sps │ ├── CARI-FES.do │ └── CARI-FES.sps ├── ENA-vulnerability-classification │ ├── ENA_vulnerability.do │ └── ENA_vulnerability.sps ├── Economic-Capacity-to-Meet-Essential-Needs │ ├── ECMEN_Excluding_Assistance_Assessment.do │ ├── ECMEN_Excluding_Assistance_Assessment.sps │ ├── ECMEN_Excluding_Assistance_Assessment_tidyverse.R │ ├── ECMEN_Including_Assistance_Monitoring.do │ ├── ECMEN_Including_Assistance_Monitoring.sps │ └── ECMEN_Including_Assistance_Monitoring_tidyverse.R ├── Engagement-in-income-generating-activities │ ├── EIG-indicator.do │ └── README.md ├── Environmental-Benefit-Indicator-CRF-26 │ ├── ebi26.sps │ └── ebi26_tidyverse.R ├── Food-consumption-score-nutrition │ ├── FCSN-indicator-calculation.do │ ├── FCSN-indicator-calculation.sps │ ├── FCSN_indicator_tidyverse.R │ └── README.md ├── Food-consumption-score │ ├── FCS-indicator-calculation.R │ ├── FCS-indicator-calculation.do │ ├── FCS-indicator-calculation.sps │ ├── FCS_indicator_tidyverse.R │ └── README.md ├── Food-consumption-sources │ └── Food-consumption-sources.sps ├── Food-expenditure-share │ ├── FES.do │ └── FES.sps ├── Gender-CRF-C31 │ ├── genC31.sps │ └── genC31_tidyverse.R ├── Household-Dietary-Diversity-Score │ └── Household-Dietary-Diversity-Score.sps ├── Household-hunger-scale │ ├── Household-Hunger-Scale.sps │ └── README.md ├── Livelihood-Coping-Strategies-EN │ ├── LCS-EN-indicator.R │ ├── LCS-EN-indicator.do │ └── LCS-EN-indicator.sps ├── Livelihood-Coping-Strategies-FS │ ├── LCS-FS-indicator.R │ ├── LCS-FS-indicator.do │ └── LCS-FS-indicator.sps ├── Multidimensional-deprivation-index │ ├── MDDI-indicator.do │ ├── MDDI-indicator.sps │ └── README.md ├── Nutrition-CRF-7-coverage │ ├── nut7_coverage.sps │ └── nut7_coverage_tidyverse.R ├── Nutrition-CRF-8-adherence │ ├── nut8_adherence.do │ ├── nut8_adherence.sps │ └── nut8_adherence_tidyverse.R ├── Nutrition-MAD │ ├── nutMAD.sps │ └── nutMAD_tidyverse.R ├── Nutrition-MDDW │ ├── README.md │ ├── nutMDDW.do │ ├── nutMDDW.sps │ └── nutMDDW_tidyverse.R ├── Perceived-needs │ ├── Perceived-needs-indicator.do │ └── Perceived-needs-indicator.sps ├── Protection-CRF-CC1-1 │ ├── pro-CC-1-1.sps │ └── pro-CC-1-1_tidyverse.R ├── Protection-CRF-CC1-2 │ ├── pro-CC-1-2.sps │ └── pro-CC-1-2_tidyverse.R ├── Protection-CRF-CC1-3 │ ├── pro-CC-1-3.sps │ └── pro-CC1-3_tidyverse.R ├── Protection-CRF-CC1-4 │ ├── pro-CC-1-4_hoh.sps │ ├── pro-CC-1-4_roster.sps │ ├── pro-CC1-4_hoh_tidyverse.R │ └── pro-CC1-4_roster_tidyverse.R ├── Protection-CRF-CC2-1 │ ├── pro-CC2-1.sps │ └── pro-CC2-1_tidyverse.R ├── README.md ├── Reduced-coping-strategy-index │ ├── README.md │ ├── rCSI-indicator.do │ ├── rCSI-indicator.sps │ └── rCSI_tidyverse.R ├── Resilience-capacity-score │ └── RCS-indicator-calculation.do ├── SAMS-CRF-30-PHL │ ├── SAMS30_PHL.sps │ └── SAMS30_PHL_tidyverse.R ├── SAMS-CRF-31-NUT │ ├── SAMS31_NUT.sps │ └── SAMS31_NUT_tidyverse.R ├── SchoolBasedProgrammes-CRF63-MinimumDietaryDiversity │ ├── SBP_CRF63_MDD.sps │ └── SBP_CRF63_MDD_tidyverse.R └── SchoolBasedProgrammes-CRF93-SchoolAbseentism │ ├── SBP_CRF93_Abseentism.sps │ └── SBP_CRF93_Abseentism_tidyverse.R ├── LICENSE.md ├── LogicalCleaning ├── Logical_Data_Cleaning.R └── README.md ├── Outputs └── README.md ├── README.md ├── Static ├── ABI_Sample_Survey.csv ├── CARI_Sample_Survey │ └── CARI_Sample_Data.csv ├── EBI_Sample_Survey.csv ├── EIG_Sample_Survey.csv ├── ENA_vulnerability_classification │ └── ENA_vulnerability_classification_Test.csv ├── Expcleaning_Sample_Raw.csv ├── FCSN_Sample_Survey.csv ├── FCS_Sample_Survey.csv ├── Gender_CRF_C31_Sample_Survey.csv ├── LCS_Sample_Survey │ ├── LHCS_EN_Sample_Survey.csv │ └── LHCS_FS_Sample_Survey.csv ├── Nut_CRF_7_coverage_Sample_Survey │ ├── Nutrition_module_NutProg_submodule_RepeatNutProg.csv │ └── data.csv ├── Nut_CRF_8_adherence_Sample_Survey │ ├── Nutrition_module_NutProg_submodule_RepeatNutProg.csv │ └── data.csv ├── Nut_MAD_Sample_Survey │ ├── MAD_submodule_RepeatMAD.csv │ └── data.csv ├── Nut_MDDW_Sample_Survey │ ├── Nutrition_module_MDD_W_submodule_RepeatMDDW.csv │ └── data.csv ├── PROP_AAP_CRF_Sample_Survey.csv ├── PRO_WG_Sample_Survey │ ├── HoHMethod │ │ └── PRO_WG_HoH_Sample_Survey.csv │ └── RosterMethod │ │ ├── Demographic_module_DisabilityHHMemb_submodule_RepeatDisabHHMembers.csv │ │ └── data.csv ├── Perceived_Needs_Sample_Survey │ └── Perceived_Needs.csv ├── RCSI_Sample_Survey.csv ├── RCS_Sample_Survey.csv ├── README.md ├── SAMS_CRF_30_PHL_Sample_Survey │ ├── SAMS_module_Indicator30_submodule_RepeatSAMSPHL.csv │ └── data.csv ├── SAMS_CRF_31_NUT_Sample_Survey │ ├── SAMS_module_Indicator31_submodule_RepeatNutCrop.csv │ └── data.csv └── SBP_CRF_63and93_Sample_Survey │ ├── SBPProcessM_module_SchoolAgeChildRoster_submodule_RepeatSchoolAgeChild.csv │ ├── data.csv │ └── spss_examplefiles.zip ├── StatisticalCleaning ├── Expenditures │ ├── Expenditure_cleaning.R │ ├── Expenditure_cleaning.do │ ├── Expenditure_cleaning.py │ └── Expenditure_cleaning.sps └── README.md ├── bug_report.md └──  contribs.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Bug-Report.YML: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report 3 | title: "[Bug]: " 4 | labels: ["bug", "triage"] 5 | assignees: 6 | - octocat 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | Thanks for taking the time to fill out this bug report! 12 | - type: input 13 | id: contact 14 | attributes: 15 | label: Contact Details 16 | description: How can we get in touch with you if we need more info? 17 | placeholder: ex. email@example.com 18 | validations: 19 | required: false 20 | - type: textarea 21 | id: what-happened 22 | attributes: 23 | label: What happened? 24 | description: Also tell us, what did you expect to happen? 25 | placeholder: Tell us what you see! 26 | value: "A bug happened!" 27 | validations: 28 | required: true 29 | - type: dropdown 30 | id: version 31 | attributes: 32 | label: Version 33 | description: What version of our software are you running? 34 | options: 35 | - 1.0.2 (Default) 36 | - 1.0.3 (Edge) 37 | validations: 38 | required: true 39 | - type: dropdown 40 | id: browsers 41 | attributes: 42 | label: What browsers are you seeing the problem on? 43 | multiple: true 44 | options: 45 | - Firefox 46 | - Chrome 47 | - Safari 48 | - Microsoft Edge 49 | - type: textarea 50 | id: logs 51 | attributes: 52 | label: Relevant log output 53 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. 54 | render: shell 55 | - type: checkboxes 56 | id: terms 57 | attributes: 58 | label: Code of Conduct 59 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) 60 | options: 61 | - label: I agree to follow this project's Code of Conduct 62 | required: true 63 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: VAM Resource Centre Support - World Food Programme 4 | url: https://resources.vam.wfp.org/ 5 | about: Please ask and answer questions here. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/indicator.yml: -------------------------------------------------------------------------------- 1 | name: Indicator 2 | description: Request the modification or addition of an indicator 3 | title: "[Indicator]: " 4 | labels: ["new", "enhancements"] 5 | assignees: 6 | - ValerioGiuffrida 7 | body: 8 | - type: markdown 9 | id: intro 10 | attributes: 11 | value: | 12 | Thanks for taking the time to fill out this request, please keep the Indicator tag at the beginning of the title 13 | 14 | - type: input 15 | id: indicator-name 16 | attributes: 17 | label: Indicator name 18 | description: please provide full name of the indicator 19 | validations: 20 | required: true 21 | 22 | - type: dropdown 23 | id: create-or-modify 24 | attributes: 25 | label: Create or modify indicator? 26 | description: Is the request about creating or adding an indicator? 27 | options: 28 | - Create 29 | - Modify 30 | validations: 31 | required: true 32 | 33 | - type: input 34 | id: contact 35 | attributes: 36 | label: Contact Details 37 | description: How can we get in touch with you if we need more info? 38 | placeholder: ex. email@example.com 39 | 40 | - type: dropdown 41 | id: isCrf 42 | attributes: 43 | label: Corporate Result Framework 44 | description: Is the indicator included in the CRF or piloted in the indicator compendium? 45 | options: 46 | - Not included nor piloted 47 | - CRF 48 | - Pilot 49 | validations: 50 | required: true 51 | 52 | - type: input 53 | id: owner-unit 54 | attributes: 55 | label: Unit owning the indicator 56 | description: Which unit has designed the indicator (in particular if CRF indicator)? 57 | placeholder: ex. RAM-E 58 | 59 | - type: textarea 60 | id: batch-creation 61 | attributes: 62 | label: Batch of tasks created - DO NOT MODIFY 63 | description: Do not modify this area. 64 | value: "- [ ] [Task]: R script - {{ data.indicator-name }} 65 | 66 | - [ ] [Task]: SPSS script - {{ data.indicator-name }} 67 | 68 | - [ ] [Task]: Stata script - {{ data.indicator-name }}" 69 | 70 | - type: dropdown 71 | id: Software-version 72 | attributes: 73 | label: Software version 74 | multiple: true 75 | description: What software would you like to use for the calculation of this index? 76 | options: 77 | - R 78 | - SPSS 79 | - Stata 80 | - Python 81 | 82 | - type: textarea 83 | id: logs 84 | attributes: 85 | label: Relevant log output 86 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. 87 | render: shell 88 | 89 | - type: checkboxes 90 | id: terms 91 | attributes: 92 | label: Code of Conduct 93 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) 94 | options: 95 | - label: I agree to follow this project's Code of Conduct 96 | required: true 97 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Indicator 3 | description: Request the modification or addition of an indicator 4 | title: "Indicator: " 5 | labels: ["new"] 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for taking the time to fill out this issue! 11 | - type: input 12 | id: test-approval 13 | attributes: 14 | label: Who should receive the test email for final approval 15 | description: Provide final assets approver's contact 16 | placeholder: brunochester@github.com 17 | validations: 18 | required: true 19 | - type: input 20 | id: contact 21 | attributes: 22 | label: Contact Details 23 | description: How can we get in touch with you if we need more info? 24 | placeholder: ex. email@example.com 25 | validations: 26 | required: true 27 | - type: input 28 | id: isCrf 29 | attributes: 30 | label: Corporate Result Framework 31 | description: Is the indicator included in the CRF or piloted in the indicator compendium? 32 | placeholder: Please give us a `Yes` or `No` answer 33 | validations: 34 | required: true 35 | - type: input 36 | id: owner-unit 37 | attributes: 38 | label: Unit owning the indicator 39 | description: Which unit has designed the indicator? In particular if CRF indicator. 40 | placeholder: ex. RAMAE 41 | validations: 42 | required: true 43 | - type: input 44 | id: test 45 | attributes: 46 | label: Test Email Recepients 47 | description: Who should receive the test email? 48 | placeholder: ex. brunochester@github.com 49 | validations: 50 | required: true 51 | - type: input 52 | id: sfid 53 | attributes: 54 | label: Salesforce Campaign ID 55 | description: Please provide Salesforce Campaign ID if this email is part of a SFDC campaign 56 | placeholder: ex. 7013o000002SggXXXX 57 | validations: 58 | required: false 59 | - type: input 60 | attributes: 61 | label: Email name 62 | description: Please add the email name followed by its send order. 63 | placeholder: Campaign_name-Invite-Email-1 64 | validations: 65 | required: true 66 | - type: input 67 | attributes: 68 | label: Email preheader 69 | description: Please add the pre-header for your email 70 | placeholder: You are invited to GitHub webinar 71 | validations: 72 | required: false 73 | - type: dropdown 74 | id: Software-version 75 | attributes: 76 | label: Software version 77 | multiple: true 78 | description: What software would you like to use for the calculation of this index? 79 | options: 80 | - R 81 | - SPSS 82 | - Stata 83 | - Python 84 | validations: 85 | required: true 86 | - type: dropdown 87 | id: browsers 88 | attributes: 89 | label: What browsers are you seeing the problem on? 90 | multiple: true 91 | options: 92 | - Firefox 93 | - Chrome 94 | - Safari 95 | - Microsoft Edge 96 | - type: textarea 97 | id: logs 98 | attributes: 99 | label: Relevant log output 100 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. 101 | render: shell 102 | - type: checkboxes 103 | id: terms 104 | attributes: 105 | label: Code of Conduct 106 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) 107 | options: 108 | - label: I agree to follow this project's Code of Conduct 109 | required: true 110 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # R GITIGNORE TEMPLATE https://github.com/github/gitignore 2 | 3 | # History files 4 | .Rhistory 5 | .Rapp.history 6 | 7 | # Session Data files 8 | .RData 9 | .RDataTmp 10 | 11 | # User-specific files 12 | .Ruserdata 13 | 14 | # Example code in package build process 15 | *-Ex.R 16 | 17 | # Output files from R CMD build 18 | /*.tar.gz 19 | 20 | # Output files from R CMD check 21 | /*.Rcheck/ 22 | 23 | # RStudio files 24 | .Rproj.user/ 25 | 26 | # produced vignettes 27 | vignettes/*.html 28 | vignettes/*.pdf 29 | 30 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 31 | .httr-oauth 32 | 33 | # knitr and R markdown default cache directories 34 | *_cache/ 35 | /cache/ 36 | 37 | # Temporary files created by R markdown 38 | *.utf8.md 39 | *.knit.md 40 | 41 | # R Environment Variables 42 | .Renviron 43 | 44 | # pkgdown site 45 | docs/ 46 | 47 | # translation temp files 48 | po/*~ 49 | 50 | # RStudio Connect folder 51 | rsconnect/ 52 | 53 | # STATA GITIGNORE 54 | 55 | # .gitignore file for git projects containing Stata files 56 | # Commercial statistical software: http://www.stata.com 57 | 58 | # Stata dataset and output files 59 | *.dta 60 | *.gph 61 | *.log 62 | *.smcl 63 | *.stpr 64 | *.stsem 65 | 66 | # Graphic export files from Stata 67 | # Stata command graph export: http://www.stata.com/manuals14/g-2graphexport.pdf 68 | # 69 | # You may add graphic export files to your .gitignore. However you should be 70 | # aware that this will exclude all image files from this main directory 71 | # and subdirectories. 72 | # *.ps 73 | # *.eps 74 | # *.wmf 75 | # *.emf 76 | # *.pdf 77 | # *.png 78 | # *.tif 79 | 80 | # CUSTOM 81 | Indicators/Food-consumption-score/.Rhistory 82 | *.xlsx 83 | *.sav 84 | node_modules -------------------------------------------------------------------------------- /Analysis/Debt-analysis/Debt-analysis.do: -------------------------------------------------------------------------------- 1 | 2 | * Objective: Debt Analysis for the standard module: 3 | * https://docs.wfp.org/api/documents/WFP-0000122078/download/ 4 | 5 | *----------------------------------------------------------------------------------------------------------------------------------------------------------------* 6 | *Calculate mean and median debt for the last 30 days and for the total outstanding debt 7 | *----------------------------------------------------------------------------------------------------------------------------------------------------------------* 8 | *Label Variables 9 | lab var HHDebt_Est "Total outstanding debt" 10 | lab var HHBorrowEst_1M "Total borrowed money/contracted debt in the last 30 days" 11 | 12 | tabstat HHDebt_Est HHBorrowEst_1M, stats(mean median) 13 | hist HHDebt_Est 14 | hist HHBorrowEst_1M 15 | 16 | 17 | *----------------------------------------------------------------------------------------------------------------------------------------------------------------* 18 | *% of household with debt by reason disaggregated for total debt and total debt in the last 30 days 19 | *----------------------------------------------------------------------------------------------------------------------------------------------------------------* 20 | *Label variables 21 | lab var HHBorrowFrom "From whom did you borrow money or contracted debt" 22 | lab var HHBorrowFrom_1M "From whom did you borrow money or contracted debt in the last 30 days" 23 | 24 | *Define values 25 | lab def HHBorrowFrom_label 100 "Relatives" 101"Relatives (excluding remittances from migrants abroad)" 102"Relatives (living outside the country)" 200"Traders/shopkeepers" 300"Bank/ Credit institution/Micro-credit project" 301"Humanitarian agencies" 302"Cooperative" 400"Money lender" 500"Landlord (more than 1 month behind in rent)" 600"Informal savings group" 700"Employer" 999"Other" 26 | 27 | lab val HHBorrowFrom HHBorrowFrom_label 28 | lab val HHBorrowFrom_1M HHBorrowFrom_label 29 | 30 | tab HHBorrowFrom 31 | tab HHBorrowFrom_1M 32 | 33 | 34 | *----------------------------------------------------------------------------------------------------------------------------------------------------------------* 35 | *% of households with debt by source disaggregated for total debt and total debt in the last 30 days 36 | *----------------------------------------------------------------------------------------------------------------------------------------------------------------* 37 | *Label Variables 38 | lab var HHBorrowWhy "The main reason to borrow money or to contract debt" 39 | lab var HHBorrowWhy_1M "The main reason to borrow money or contract debt in the last 30 days" 40 | 41 | *Define values 42 | lab def HHBorrowWhy_label 10100"To buy food" 10200"To buy non-food items (clothes, small furniture...)" 10300"To rent an accommodation" 10400"To pay school, education costs" 10500"To cover health expenses" 20100"To pay for durable goods (scooter, TV,...)" 20200"To pay for ceremonies/social events" 20300"To rent/buy a flat/house" 30100"To pay ticket/cover travel for migration" 40100"To buy agricultural land, inputs or livestock" 40200"To invest in business" 50100"To pay back another loan" 999"Other (Please specify.)" 43 | 44 | lab val HHBorrowWhy HHBorrowWhy_label 45 | lab val HHBorrowWhy_1M HHBorrowWhy_label 46 | 47 | tab HHBorrowWhy 48 | tab HHBorrowWhy_1M 49 | *----------------------------------------------------------------------------------------------------------------------------------------------------------------* 50 | *The estimated time for repayment (in months) can be used as an indicator of over-indebtedness 51 | *----------------------------------------------------------------------------------------------------------------------------------------------------------------* 52 | *Label variable 53 | lab var HHDebtPaidWhen "How many months will you need to be able to repay the debts?" 54 | tabstat HHDebtPaidWhen, stats(mean median) 55 | histogram HHDebtPaidWhen 56 | -------------------------------------------------------------------------------- /Analysis/Debt-analysis/Debt-analysis.sps: -------------------------------------------------------------------------------- 1 | /*Debt Indicators for Essential Needs Assessments 2 | ************************************************************************************************************** 3 | ** Objective: Debt Analysis for the standard module 4 | /* Survey module : https://docs.wfp.org/api/documents/WFP-0000122078/download/ 5 | 6 | ***Calculate mean and median debt for the last 30 days and for the total outstanding debt. 7 | 8 | Variable labels 9 | HHDebt_Est 'Total outstanding debt' 10 | HHBorrowEst_1M 'Total borrowed money/contracted debt in the last 30 days'. 11 | execute. 12 | 13 | 14 | frequencies HHDebt_Est HHBorrowEst_1M /statistics=mean /statistics=median /histogram. 15 | 16 | *** % of households with debt by reason disaggregated for total debt and total debt in the last 30 days** 17 | /* Add value and variable labels 18 | 19 | variable labels 20 | HHBorrowFrom 'From whom did you borrow money or contracted debt' 21 | HHBorrowFrom_1M ' From whom did you borrow money or contracted debt in the last 30 days'. 22 | execute. 23 | value labels HHBorrowFrom_1M HHBorrowFrom 24 | 100 'Relatives' 25 | 101 'Relatives (excluding remittances from migrants abroad)' 26 | 102 'Relatives (living outside the country)' 27 | 200 'Traders/shopkeepers' 28 | 300 'Bank/ Credit institution/Micro-credit project' 29 | 301 'Humanitarian agencies' 30 | 302 'Cooperative' 31 | 400 'Money lender' 32 | 500 'Landlord (more than 1 month behind in rent)' 33 | 600 'Informal savings group' 34 | 700 'Employer' 35 | 999 'Other'. 36 | execute. 37 | 38 | frequencies HHBorrowFrom_1M HHBorrowFrom. 39 | 40 | *** % of households with debt by source disaggregated for total debt and total debt in the last 30 days** 41 | /* Add value and variable labels 42 | 43 | 44 | variable labels 45 | HHBorrowWhy 'The main reason to borrow money or to contract debt' 46 | HHBorrowWhy_1M 'The main reason to borrow money or contract debt in the last 30 days'. 47 | execute. 48 | 49 | value labels HHBorrowWhy_1M HHBorrowWhy 50 | 10100 'To buy food' 51 | 10200 'To buy non-food items (clothes, small furniture...)' 52 | 10300 'To rent an accommodation' 53 | 10400 'To pay school, education costs' 54 | 10500 'To cover health expenses' 55 | 20100 'To pay for durable goods (scooter, TV,...)' 56 | 20200 'To pay for ceremonies/social events' 57 | 20300 'To rent/buy a flat/house' 58 | 30100 'To pay ticket/cover travel for migration' 59 | 40100 'To buy agricultural land, inputs or livestock' 60 | 40200 'To invest in business' 61 | 50100 'To pay back another loan' 62 | 999 'Other (Please specify.)'. 63 | execute. 64 | 65 | frequencies HHBorrowWhy_1M HHBorrowWhy. 66 | 67 | *** The estimated time for repayment (in months) can be used as an indicator of over-indebtedness** 68 | 69 | 70 | variable labels HHDebtPaidWhen ' How many months will you need to be able to repay the debts?'. 71 | execute. 72 | frequencies HHDebtPaidWhen /statistics=mean /statistics=median /histogram. 73 | -------------------------------------------------------------------------------- /Analysis/Gap-analysis/README.md: -------------------------------------------------------------------------------- 1 | # Gap analysis to inform transfer values for CBT programmes 2 | # RAM Resources - Scripts 3 | 4 | This folder contains examples of scripts (in R, STATA, and SPSS) to conduct a gap analysis according to the guide ["Gap analysis to inform transfer values for CBT programmes"] (https://resources.vam.wfp.org/data-analysis/quantitative/essential-needs/gap-analysis) 5 | 6 | A sample zipped dataset is internally available in this [SharePoint folder](https://wfp.sharepoint.com/:u:/s/HQEssentialNeedsCoordinationGroup/EaA9HkJvWdBIgL9yq7hrg5gBa5xT5ZQSVxETRhFEVB0uAA?e=JBcjgs) 7 | 8 | For more information, please contact the Needs Assessments and Targeting Unit or the Economic & Markets Unit in HQ RAM. 9 | -------------------------------------------------------------------------------- /Analysis/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources Scripts - Analysis 2 | 3 | This folder contains all standardized scripts for computing plots, cross-tabulations & summary output tables for indicators 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing to RAM Resources Scripts 3 | 4 | Thank you for considering contributing to RAM Resources Scripts! We welcome and appreciate any contributions, whether it be code, documentation, or bug reports. 5 | 6 | See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. 7 | 8 | ## How to contribute and submit changes 9 | 10 | 1. Pick a task from the Project board or from the Issues. The tasks displayed in the board have been created and prioritized by the project members and admins. 11 | 2. Fork the repository 12 | 3. Clone the forked repository to your local machine 13 | 4. Create a new branch on your local machine with a descriptive name (e.g. fix-typo-in-documentation). 14 | 5. Make your changes in a new branch 15 | 6. Commit your changes with a clear and concise message, using conventional-changelog format. 16 | 7. Push the changes to your forked repository. 17 | 8. Submit a pull request to the original repository, on the **main** branch. The pull request should be self-contained, limited in scope and well-described (e.g. one pull request per indicator changed). This will speed up the review and merge process. 18 | 9. Maintainers will review the request and merge the PR into the **main** branch. 19 | 20 | > **Note:** Do not commit passwords or other secret/sensitive information, as they will be publicly available and can remain recorded in the GitHub history. If this happens, invalidate secrets immediately (e.g.: change password). 21 | 22 | ### Script structure 23 | If you're adding a new script/indicator, this should be **properly commented and organized as follows:** 24 | 1. If an environment argument is empty, ingest a sample dataset. Use relative paths (versus absolute paths such as: C:\Projects\RAMResourcesScripts\Static\Nut_CRF_7_coverage_Sample_Survey) 25 | 2. Generate new variables 26 | 3. Label and recode variables 27 | 4. Aggregate to obtain final indicator 28 | 5. Label and recode final indicator 29 | 6. Remove intermediate variables to leave a clean dataset. 30 | 31 | > **Note:** It is important that the original dataset is not replaced. Avoid replacing the original dataset and minimize read-save operations on disk. 32 | 33 | ### Sample file creation 34 | The RAM Resource Scripts repository should have also sample files for specific indicators for experimentation and testing of the script. These should be in CSV or SPS formats and containing no real PII. Sample files should be composed by max 30 entries and remove group and repeat prefixes. 35 | Each file should be named in a clear, understandable way, hinting to the intended use for that file. Alternatively, a sub-folder for a specific indicator could be created, including also a README.md explaining the use of the different files in the sub-folder. 36 | 37 | 38 | ## How to report a bug or request a new indicator 39 | 40 | > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . 41 | 42 | We use GitHub issues to track bugs and errors, request a new indicator or changes to an existing one or ask questions. If you run into an issue with the project: 43 | 44 | - Open an [Issue](https://github.com/WFP-VAM/RAMResourcesScripts/issues/new/choose). 45 | - Choose whether you need to file a Bug report, request a new Indicator or changes to an existing one or just ask a question. 46 | - If it's a Bug, please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. 47 | - If it's an Indicator, provide the name of the indicator, language/software that the indicator should be calculated in, the WFP unit that owns the indicator and whether it's part of the WFP Corporate Result Framework 48 | - Once it's filed the project team will prioritize the issue accordingly, also considering the reproducibility of the issue. 49 | 50 | ## Styleguide for commit messages 51 | 52 | When committing changes, please make sure that your commit message follows this style guide: 53 | 54 | - Start the commit message with a brief summary of the changes, written in the present tense and in imperative mood. 55 | - Leave a blank line after the summary. 56 | - Add a more detailed explanation of the changes, if necessary. 57 | - Use bullet points to list specific changes, if applicable. 58 | - Keep the commit message concise and to the point. 59 | 60 | **Example:** 61 | ``` 62 | Fix typo in documentation 63 | 64 | - Change "form" to "from" in the first paragraph on page 3. 65 | ``` 66 | 67 | This format makes it easy for other contributors to understand the changes you have made and why they were made. 68 | -------------------------------------------------------------------------------- /Indicators/ABI-CRF-25/abi25.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | * define variable and value labels 4 | 5 | Variable labels HHFFAPart "Have you or any of your household member participated in the asset creation activities and received a food assistance transfer?". 6 | Variable labels HHAssetProtect "Do you think that the assets that were built or rehabilitated in your community are better protecting your household, from floods / drought / landslides / mudslides?". 7 | Variable labels HHAssetProduct "Do you think that the assets that were built or rehabilitated in your community have allowed your household to increase or diversify its production (agriculture / livestock / other)?". 8 | Variable labels HHAssetDecHardship "Do you think that the assets that were built or rehabilitated in your community have decreased the day-to-day hardship and released time for any of your family members (including women and children)?". 9 | Variable labels HHAssetAccess "Do you think that the assets that were built or rehabilitated in your community have improved the ability of any of your household member to access markets and/or basic services (water, sanitation, health, education, etc)?". 10 | Variable labels HHTrainingAsset "Do you think that the trainings and other support provided in your community have improved your household’s ability to manage and maintain assets?". 11 | Variable labels HHAssetEnv "Do you think that the assets that were built or rehabilitated in your community have improved your natural environment (for example more vegetal cover, water table increased, less erosion, etc.)?". 12 | Variable labels HHWorkAsset "Do you think that the works undertaken in your community have restored your ability to access and/or use basic asset functionalities?". 13 | 14 | Value labels HHFFAPart 1 'Yes' 0 'No'. 15 | Value labels HHAssetProtect HHAssetProduct HHAssetDecHardship HHAssetAccess HHTrainingAsset HHAssetEnv HHWorkAsset 1 'Yes' 0 'No' 9999 "Not applicable". 16 | 17 | *take a look at of responses by community and note how many questions (and which were not answered by each community) for each community 18 | 19 | CROSSTABS 20 | /TABLES= HHAssetProtect HHAssetProduct HHAssetDecHardship HHAssetAccess HHTrainingAsset HHAssetEnv HHWorkAsset BY ADMIN5Name 21 | /CELLS=COUNT 22 | /COUNT ROUND CELL. 23 | 24 | * recode 9999 to 0 25 | 26 | RECODE HHAssetProtect HHAssetProduct HHAssetDecHardship HHAssetAccess HHTrainingAsset HHAssetEnv HHWorkAsset (9999=0) (0=0) (1=1). 27 | EXECUTE. 28 | 29 | 30 | *create values with the denominator of questions asked for each community - should scan through the data and values from tables above to generate these values 31 | 32 | do if ADMIN5Name = "Community A". 33 | compute ABIdenom =5. 34 | else. 35 | compute ABIdenom = 6. 36 | end if. 37 | EXECUTE. 38 | 39 | *Create ABI score (summing all response) and ABI percent (dividing total score by denominator of applicaple questions) 40 | 41 | Compute ABIScore = sum(HHAssetProtect,HHAssetProduct,HHAssetDecHardship,HHAssetAccess,HHTrainingAsset,HHAssetEnv,HHWorkAsset). 42 | Compute ABIPerc = ((ABIScore / ABIdenom) * 100). 43 | EXECUTE. 44 | 45 | 46 | * Creates table of values - participants vs non-participants 47 | 48 | DATASET DECLARE ABIperc_particp. 49 | AGGREGATE 50 | /OUTFILE='ABIperc_particp' 51 | /BREAK=HHFFAPart 52 | /ABIPerc_mean=MEAN(ABIPerc). 53 | 54 | * calculate the ABI across using weight value of 2 for non-participants which accounts for sampling imbalance between participants and non-participants 55 | * if ration of participants vs non-participants is not 2/1 then a more sophisticated method for creating weights should be used 56 | 57 | Dataset Activate ABIperc_particp. 58 | do if HHFFAPart = 0. 59 | compute ABIperc_wtd =2. 60 | else. 61 | compute ABIperc_wtd = 1. 62 | end if. 63 | EXECUTE. 64 | 65 | * add weight for non particpant and compute average 66 | 67 | compute ABIperc_total_partic = ((ABIPerc_mean * ABIperc_wtd)/3). 68 | EXECUTE. 69 | 70 | AGGREGATE 71 | /OUTFILE=* MODE=ADDVARIABLES 72 | /BREAK= 73 | /ABIperc_total =SUM(ABIperc_total_partic). 74 | -------------------------------------------------------------------------------- /Indicators/ABI-CRF-25/abi25_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #import dataset 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/ABI_Sample_Survey.csv") 7 | 8 | #assign variable and value labels 9 | var_label(data$HHFFAPart) <- "Have you or any of your household member participated in the asset creation activities and received a food assistance transfer?" 10 | var_label(data$HHAssetProtect) <- "Do you think that the assets that were built or rehabilitated in your community are better protecting your household, its belongings and its production capacities (fields, equipment, etc.) from floods / drought / landslides / mudslides?" 11 | var_label(data$HHAssetProduct) <- "Do you think that the assets that were built or rehabilitated in your community have allowed your household to increase or diversify its production (agriculture / livestock / other)?" 12 | var_label(data$HHAssetDecHardship) <- "Do you think that the assets that were built or rehabilitated in your community have decreased the day-to-day hardship and released time for any of your family members (including women and children)?" 13 | var_label(data$HHAssetAccess) <- "Do you think that the assets that were built or rehabilitated in your community have improved the ability of any of your household member to access markets and/or basic services (water, sanitation, health, education, etc)?" 14 | var_label(data$HHTrainingAsset) <- "Do you think that the trainings and other support provided in your community have improved your household’s ability to manage and maintain assets?" 15 | var_label(data$HHAssetEnv) <- "Do you think that the assets that were built or rehabilitated in your community have improved your natural environment (for example more vegetal cover, water table increased, less erosion, etc.)?" 16 | var_label(data$HHWorkAsset) <- "Do you think that the works undertaken in your community have restored your ability to access and/or use basic asset functionalities?" 17 | 18 | data <- data %>% 19 | mutate(across(c(HHAssetProtect,HHAssetProduct,HHAssetDecHardship,HHAssetAccess,HHTrainingAsset,HHAssetEnv,HHWorkAsset), ~labelled(., labels = c( 20 | "No" = 0, 21 | "Yes" = 1, 22 | "Not applicable" = 9999 23 | )))) 24 | 25 | val_lab(data$HHFFAPart) = num_lab(" 26 | 0 No 27 | 1 Yes 28 | ") 29 | 30 | #recode 999 to 0 31 | data <- data %>% 32 | mutate(across(HHAssetProtect:HHWorkAsset, ~ dplyr::recode(.x, "0" = 0, "1" = 1, "9999" = 0))) 33 | 34 | 35 | #sum ABI rows 36 | data <- data %>% 37 | mutate(ABIScore = rowSums(across(c(HHAssetProtect:HHWorkAsset)))) 38 | 39 | #create denominator of questions asked 40 | data <- data %>% mutate(ABIdenom = case_when( 41 | ADMIN5Name == "Community A" ~ 5, 42 | ADMIN5Name == "Community B" ~ 6 43 | )) 44 | 45 | #create % ABI for each respondent 46 | data <- data %>% mutate(ABIperc = round((ABIScore/ABIdenom)*100)) 47 | 48 | #create table comparing ABI % of participants and non-participants by village 49 | ABIperc_particp_ADMIN5Name <- data %>% mutate(HHFFAPart_lab = to_character(HHFFAPart)) %>% group_by(ADMIN5Name, HHFFAPart_lab) %>% summarize(ABIperc = mean(ABIperc)) 50 | 51 | #create table presenting ABI % participants vs non-particpants (average across villages) 52 | ABIperc_particp <- data %>% mutate(HHFFAPart_lab = to_character(HHFFAPart)) %>% group_by(HHFFAPart_lab) %>% summarize(ABIperc = mean(ABIperc)) 53 | 54 | #calculate the ABI across using weight value of 2 for non-participants which accounts for sampling imbalance between nonparticipants and participants 55 | #if ratio of participants/vs non-participants is not 2/1 then a more sophisticated method for creating weights should be used. 56 | ABIperc_total <- ABIperc_particp %>% mutate(ABIperc_wtd = case_when(HHFFAPart_lab == "No" ~ ABIperc *2, TRUE ~ ABIperc)) %>% ungroup() %>% summarize(ABIperc_total = sum(ABIperc_wtd)/3) 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Indicators/Consolidated-Approach-to-Reporting-Indicators-of-Food-Security/CARI-ECMEN.do: -------------------------------------------------------------------------------- 1 | *** ----------------------------------------------------------------------------------------------------------------* 2 | 3 | *** WFP Standard Scripts 4 | *** Consolidated Approach for Reporting Indicators of Food Security (CARI) 5 | *** CALCULATE CARI using FCS, rCSI, LCS and ECMEN 6 | 7 | *** ----------------------------------------------------------------------------------------------------------------* 8 | /* 9 | Note that there are two ways to calculate CARI - using ECMEN or FES. This syntax file is for calculating CARI using ECMEN (version excluding assistance). However, please navigate to the script for CARI using FES as relevant. 10 | Guidance on CARI can be found here: https://www.wfp.org/publications/consolidated-approach-reporting-indicators-food-security-cari-guidelines. 11 | 12 | Note: this syntax file is based on the assumption that the scripts of the various indicators that compose this version of the CARI (FCS, rCSI, LCS-FS, ECMEN) have already been run. 13 | You can find these scripts here: https://github.com/WFP-VAM/RAMResourcesScripts/tree/main/Indicators. 14 | The following variables should have been defined before running this file: 15 | FCSCat21 and/or FCSCat28 16 | rCSI 17 | Max_coping_behaviourFS 18 | ECMEN_exclAsst 19 | ECMEN_exclAsst_SMEB. 20 | */ 21 | 22 | 23 | *-------------------------------------------------------------------------------* 24 | * Process FCS for CARI computation 25 | *-------------------------------------------------------------------------------* 26 | 27 | * Create FCS_4pt for CARI calculation. 28 | recode FCSCat21 (1=4) (2=3) (3=1), generate(FCS_4pt) 29 | label variable FCS_4pt "4pt FCG" 30 | label define FCS_4pt 1 "Acceptable" 3 "Borderline" 4 "Poor" 31 | label values FCS_4pt FCS_4pt 32 | 33 | *-------------------------------------------------------------------------------* 34 | * Combine rCSI with FCS_4pt for CARI calculation (current consumption) 35 | *-------------------------------------------------------------------------------* 36 | 37 | recode FCS_4pt (1=2) if rCSI >= 4 38 | label define FCS_4pt_lbl 1 "Acceptable" 2 "Acceptable and rCSI>4" 3 "Borderline" 4 "Poor" 39 | label values FCS_4pt FCS_4pt_lbl 40 | 41 | *-------------------------------------------------------------------------------* 42 | * Process ECMEN for CARI computation 43 | *-------------------------------------------------------------------------------* 44 | 45 | * Recode ECMEN. 46 | gen ECMEN_MEB = . 47 | replace ECMEN_MEB = 1 if ECMEN_exclAsst == 1 48 | replace ECMEN_MEB = 2 if ECMEN_exclAsst == 0 & ECMEN_exclAsst_SMEB == 1 49 | replace ECMEN_MEB = 3 if ECMEN_exclAsst == 0 & ECMEN_exclAsst_SMEB == 0 50 | 51 | * Recode the `ECMEN_MEB' variable into a 4pt scale for CARI console. 52 | recode ECMEN_MEB (1=1) (2=3) (3=4), generate(ECMEN_class_4pt) 53 | label variable ECMEN_class_4pt "ECMEN 4pt" 54 | label define ECMEN_class_4pt_lbl 1 "Least vulnerable" 3 "Vulnerable" 4 "Highly vulnerable" 55 | label values ECMEN_class_4pt ECMEN_class_4pt_lbl 56 | 57 | *-------------------------------------------------------------------------------* 58 | * Computation of CARI 59 | *-------------------------------------------------------------------------------* 60 | 61 | egen Mean_coping_capacity_ECMEN = rowmean(Max_coping_behaviourFS ECMEN_class_4pt) 62 | egen CARI_unrounded_ECMEN = rowmean(FCS_4pt Mean_coping_capacity_ECMEN) 63 | gen CARI_ECMEN = round(CARI_unrounded_ECMEN) 64 | label variable CARI_ECMEN "CARI classification (using ECMEN)" 65 | label define CARI_ECMEN_lbl 1 "Food secure" 2 "Marginally food secure" 3 "Moderately food insecure" 4 "Severely food insecure" 66 | label values CARI_ECMEN CARI_ECMEN_lbl 67 | 68 | tabulate CARI_ECMEN 69 | 70 | * Create population distribution table, to explore how the domains interact within the different food security categories 71 | table ( ECMEN_class_4pt) (FCS_4pt Max_coping_behaviourFS ), statistic(percent, across(Max_coping_behaviourFS)) nototal 72 | 73 | *-------------------------------------------------------------------------------* 74 | * Drop variables that are not needed 75 | *-------------------------------------------------------------------------------* 76 | 77 | drop ECMEN_MEB Mean_coping_capacity_ECMEN CARI_unrounded_ECMEN 78 | -------------------------------------------------------------------------------- /Indicators/Consolidated-Approach-to-Reporting-Indicators-of-Food-Security/CARI-ECMEN.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | *** ----------------------------------------------------------------------------------------------------------------* 4 | 5 | *** WFP Standard Scripts 6 | *** Consolidated Approach for Reporting Indicators of Food Security (CARI) 7 | *** CALCULATE CARI using FCS, rCSI, LCS and ECMEN 8 | 9 | *** ----------------------------------------------------------------------------------------------------------------* 10 | 11 | *Note that there are two ways to calculate CARI - using ECMEN or FES. This syntax file is for calculating CARI using ECMEN (version excluding assistance). However, please navigate to the script for CARI using FES as relevant. 12 | * Guidance on CARI can be found here: https://www.wfp.org/publications/consolidated-approach-reporting-indicators-food-security-cari-guidelines. 13 | 14 | *Note: this syntax file is based on the assumption that the scripts of the various indicators that compose this version of the CARI (FCS, rCSI, LCS-FS, ECMEN) have already been run. 15 | * You can find these scripts here: https://github.com/WFP-VAM/RAMResourcesScripts/tree/main/Indicators. 16 | *The following variables should have been defined before running this file: 17 | FCSCat21 and/or FCSCat28 18 | rCSI 19 | Max_coping_behaviourFS 20 | ECMEN_exclAsst 21 | ECMEN_exclAsst_SMEB. 22 | 23 | *-------------------------------------------------------------------------------* 24 | * Process FCS for CARI computation 25 | *-------------------------------------------------------------------------------* 26 | 27 | * Important note: pay attention to the threshold used by your CO when selecting the syntax (FCSCat21 or FCSCat28). In this example, the 21-35 treshold is used. 28 | 29 | *** Create FCS_4pt for CARI calculation. 30 | Recode FCSCat21 (1=4) (2=3) (3=1) INTO FCS_4pt. 31 | Variable labels FCS_4pt '4pt FCG'. 32 | Value labels FCS_4pt 1.00 'Acceptable' 3.00 'Borderline' 4.00 'Poor'. 33 | EXECUTE. 34 | 35 | *-------------------------------------------------------------------------------* 36 | * Combine rCSI with FCS_4pt for CARI calculation (current consumption) 37 | *-------------------------------------------------------------------------------* 38 | 39 | Do if (rCSI >= 4). 40 | Recode FCS_4pt (1=2). 41 | End if. 42 | EXECUTE. 43 | 44 | Value labels FCS_4pt 1.00 'Acceptable' 2.00 ' Acceptable and rCSI>4' 3.00 'Borderline' 4.00 'Poor'. 45 | EXECUTE. 46 | 47 | *-------------------------------------------------------------------------------* 48 | * Process ECMEN for CARI computation 49 | *-------------------------------------------------------------------------------* 50 | 51 | ***Recode ECMEN. 52 | IF (ECMEN_exclAsst=1) ECMEN_MEB=1. 53 | IF (ECMEN_exclAsst=0 & ECMEN_exclAsst_SMEB=1) ECMEN_MEB=2. 54 | IF (ECMEN_exclAsst=0 & ECMEN_exclAsst_SMEB=0) ECMEN_MEB=3. 55 | 56 | ***Recode the `ECMEN_MEB' variable into a 4pt scale for CARI console. 57 | Recode ECMEN_MEB (1=1) (2=3) (3=4) INTO ECMEN_class_4pt. 58 | Variable labels ECMEN_class_4pt 'ECMEN 4pt'. 59 | EXECUTE. 60 | 61 | Value labels ECMEN_class_4pt 1.00 'Least vulnerable' 3.00 'Vulnerable' 4.00 'Highly vulnerable'. 62 | EXECUTE. 63 | 64 | *-------------------------------------------------------------------------------* 65 | * Computation of CARI 66 | *-------------------------------------------------------------------------------* 67 | 68 | Compute Mean_coping_capacity_ECMEN = MEAN (Max_coping_behaviourFS, ECMEN_class_4pt). 69 | Compute CARI_unrounded_ECMEN = MEAN (FCS_4pt, Mean_coping_capacity_ECMEN). 70 | Compute CARI_ECMEN = RND (CARI_unrounded_ECMEN). 71 | Variable labels CARI_ECMEN 'CARI classification (using ECMEN)'. 72 | EXECUTE. 73 | 74 | Value labels CARI_ECMEN 1 'Food secure' 2 'Marginally food secure' 3 'Moderately food insecure' 4 'Severely food insecure'. 75 | EXECUTE. 76 | 77 | Frequencies CARI_ECMEN. 78 | 79 | ***create population distribution table, to to explore how the domains interact within the different food security categories. 80 | CTABLES 81 | /VLABELS VARIABLES= ECMEN_class_4pt FCS_4pt Max_coping_behaviourFS DISPLAY=LABEL 82 | /TABLE ECMEN_class_4pt [C] BY FCS_4pt [C] > Max_coping_behaviourFS [C][ROWPCT.COUNT PCT40.1] 83 | /CATEGORIES VARIABLES= ECMEN_class_4pt ORDER=A KEY=VALUE EMPTY=EXCLUDE 84 | /CATEGORIES VARIABLES=FCS_4pt Max_coping_behaviourFS ORDER=A KEY=VALUE EMPTY=INCLUDE. 85 | 86 | *-------------------------------------------------------------------------------* 87 | * Drop variables that are not needed 88 | *-------------------------------------------------------------------------------* 89 | 90 | DELETE VARIABLES ECMEN_MEB Mean_coping_capacity_ECMEN CARI_unrounded_ECMEN. 91 | EXECUTE. 92 | -------------------------------------------------------------------------------- /Indicators/Consolidated-Approach-to-Reporting-Indicators-of-Food-Security/CARI-FES.do: -------------------------------------------------------------------------------- 1 | *** ----------------------------------------------------------------------------------------------------------------* 2 | 3 | *** WFP Standard Scripts 4 | *** Consolidated Approach for Reporting Indicators of Food Security (CARI) 5 | *** CALCULATE CARI using FCS, rCSI, LCS and FES 6 | 7 | *** ----------------------------------------------------------------------------------------------------------------* 8 | /* 9 | Note that there are two ways to calculate CARI - using ECMEN or FES. This syntax file is for calculating CARI using FES. However, please navigate to the script for CARI using ECMEN as relevant. 10 | Guidance on CARI can be found here: https://www.wfp.org/publications/consolidated-approach-reporting-indicators-food-security-cari-guidelines. 11 | 12 | Note: this syntax file is based on the assumption that the scripts of the various indicators that compose this version of the CARI (FCS, rCSI, LCS-FS, FES) have already been run. 13 | You can find these scripts here: https://github.com/WFP-VAM/RAMResourcesScripts/tree/main/Indicators. 14 | The following variables should have been defined before running this file: 15 | FCSCat21 and/or FCSCat28 16 | rCSI 17 | Max_coping_behaviourFS 18 | FES 19 | Foodexp_4pt. 20 | */ 21 | 22 | *-------------------------------------------------------------------------------* 23 | * Process FCS for CARI computation 24 | *-------------------------------------------------------------------------------* 25 | 26 | * Create FCS_4pt for CARI calculation. 27 | recode FCSCat21 (1=4) (2=3) (3=1), generate(FCS_4pt) 28 | label variable FCS_4pt "4pt FCG" 29 | label define FCS_4pt 1 "Acceptable" 3 "Borderline" 4 "Poor" 30 | label values FCS_4pt FCS_4pt 31 | 32 | *-------------------------------------------------------------------------------* 33 | * Combine rCSI with FCS_4pt for CARI calculation (current consumption) 34 | *-------------------------------------------------------------------------------* 35 | 36 | recode FCS_4pt (1=2) if rCSI >= 4 37 | label define FCS_4pt_lbl 1 "Acceptable" 2 "Acceptable and rCSI>4" 3 "Borderline" 4 "Poor" 38 | label values FCS_4pt FCS_4pt_lbl 39 | 40 | *-------------------------------------------------------------------------------* 41 | * Computation of CARI 42 | *-------------------------------------------------------------------------------* 43 | 44 | egen Mean_coping_capacity_FES = rowmean(Max_coping_behaviourFS Foodexp_4pt) 45 | egen CARI_unrounded_FES = rowmean(FCS_4pt Mean_coping_capacity_FES) 46 | gen CARI_FES = round(CARI_unrounded_FES) 47 | label variable CARI_FES "CARI classification (using FES)" 48 | label define CARI_FES_lbl 1 "Food secure" 2 "Marginally food secure" 3 "Moderately food insecure" 4 "Severely food insecure" 49 | label values CARI_FES CARI_FES_lbl 50 | 51 | tabulate CARI_FES 52 | 53 | * Create population distribution table, to explore how the domains interact within the different food security categories 54 | table (Foodexp_4pt) (FCS_4pt Max_coping_behaviourFS ), statistic(percent, across(Max_coping_behaviourFS)) nototal 55 | 56 | *-------------------------------------------------------------------------------* 57 | * Drop variables that are not needed 58 | *-------------------------------------------------------------------------------* 59 | drop Mean_coping_capacity_FES CARI_unrounded_FES 60 | -------------------------------------------------------------------------------- /Indicators/Consolidated-Approach-to-Reporting-Indicators-of-Food-Security/CARI-FES.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | *** ----------------------------------------------------------------------------------------------------------------* 4 | 5 | *** WFP Standard Scripts 6 | *** Consolidated Approach for Reporting Indicators of Food Security (CARI) 7 | *** CALCULATE CARI using FCS, rCSI, LCS and FES 8 | 9 | *** ----------------------------------------------------------------------------------------------------------------* 10 | 11 | *Note that there are two ways to calculate CARI - using ECMEN or FES. This syntax file is for calculating CARI using FES. However, please navigate to the script for CARI using ECMEN as relevant. 12 | * Guidance on CARI can be found here: https://www.wfp.org/publications/consolidated-approach-reporting-indicators-food-security-cari-guidelines. 13 | 14 | *Note: this syntax file is based on the assumption that the scripts of the various indicators that compose this version of the CARI (FCS, rCSI, LCS-FS, FES) have already been run. 15 | * You can find these scripts here: https://github.com/WFP-VAM/RAMResourcesScripts/tree/main/Indicators. 16 | *The following variables should have been defined before running this file: 17 | FCSCat21 and/or FCSCat28 18 | rCSI 19 | Max_coping_behaviourFS 20 | FES 21 | Foodexp_4pt. 22 | 23 | *-------------------------------------------------------------------------------* 24 | * Process FCS for CARI computation 25 | *-------------------------------------------------------------------------------* 26 | 27 | * Important note: pay attention to the threshold used by your CO when selecting the syntax (FCSCat21 or FCSCat28). In this example, the 21-35 treshold is used. 28 | 29 | *** Create FCS_4pt for CARI calculation. 30 | Recode FCSCat21 (1=4) (2=3) (3=1) INTO FCS_4pt. 31 | Variable labels FCS_4pt '4pt FCG'. 32 | Value labels FCS_4pt 1.00 'Acceptable' 3.00 'Borderline' 4.00 'Poor'. 33 | EXECUTE. 34 | 35 | *-------------------------------------------------------------------------------* 36 | * Combine rCSI with FCS_4pt for CARI calculation (current consumption) 37 | *-------------------------------------------------------------------------------* 38 | 39 | Do if (rCSI >= 4). 40 | Recode FCS_4pt (1=2). 41 | End if. 42 | EXECUTE. 43 | 44 | Value labels FCS_4pt 1.00 'Acceptable' 2.00 ' Acceptable and rCSI>4' 3.00 'Borderline' 4.00 'Poor'. 45 | EXECUTE. 46 | 47 | *-------------------------------------------------------------------------------* 48 | * Computation of CARI 49 | *-------------------------------------------------------------------------------* 50 | 51 | Compute Mean_coping_capacity_FES = MEAN(Max_coping_behaviourFS, Foodexp_4pt). 52 | Compute CARI_unrounded_FES = MEAN(FCS_4pt, Mean_coping_capacity_FES). 53 | Compute CARI_FES = RND(CARI_unrounded_FES). 54 | EXECUTE. 55 | 56 | Value labels CARI_FES 1 'Food secure' 2 'Marginally food secure' 3 'Moderately food insecure' 4 'Severely food insecure'. 57 | EXECUTE. 58 | 59 | Frequencies CARI_FES. 60 | 61 | ***create population distribution table, to to explore how the domains interact within the different food security categories 62 | 63 | CTABLES 64 | /VLABELS VARIABLES=Foodexp_4pt FCS_4pt Max_coping_behaviourFS DISPLAY=LABEL 65 | /TABLE Foodexp_4pt [C] BY FCS_4pt [C] > Max_coping_behaviourFS [C][ROWPCT.COUNT PCT40.1] 66 | /CATEGORIES VARIABLES=Foodexp_4pt ORDER=A KEY=VALUE EMPTY=EXCLUDE 67 | /CATEGORIES VARIABLES=FCS_4pt Max_coping_behaviourFS ORDER=A KEY=VALUE EMPTY=INCLUDE. 68 | 69 | *-------------------------------------------------------------------------------* 70 | * Drop variables that are not needed 71 | *-------------------------------------------------------------------------------* 72 | 73 | DELETE VARIABLES Mean_coping_capacity_FES CARI_unrounded_FES. 74 | EXECUTE. 75 | -------------------------------------------------------------------------------- /Indicators/ENA-vulnerability-classification/ENA_vulnerability.do: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | * STATA Syntax for the ENA vulnerability classification methodology 3 | ******************************************************************************* 4 | 5 | /* 6 | NOTES: 7 | 8 | - This syntax file is based on the vulnerability classification methodology recommended for Essential Needs Assessments. This classification is based on the combination of three indicators: the Economic Capacity to Meet Essential Needs (ECMEN), the Livelihood Coping Index for Essential Needs (LCS-EN), and the Food Consumption Score (FCS). However, the vulnerability classification methodolgy can be adapted based on programme needs. See chapter 6 of the Essential Needs Assessment guidance note for more details. 9 | 10 | - The syntax files assumes that ECMEN, LCS-EN, and FCS have already been computed based on standard syntax available in github (https://github.com/WFP-VAM/RAMResourcesScripts/tree/main/Indicators). The following variables should have been defined before running this file: 11 | ECMEN_exclAsst 12 | ECMEN_exclAsst_SMEB 13 | Max_coping_behaviourEN 14 | FCSCat28 15 | FCSCat21 16 | */ 17 | 18 | *------------------------------------------------------------------------------* 19 | *1. Create temporary variables 20 | *------------------------------------------------------------------------------* 21 | 22 | *** Create a categorical variable for ECMEN that inform if a household is above MEB, betweeen MEB and SMEB, or below SMEB 23 | 24 | gen temp_ECMEN_categ = . 25 | replace temp_ECMEN_categ = 0 if ECMEN_exclAsst == 1 26 | replace temp_ECMEN_categ = 1 if ECMEN_exclAsst == 0 & ECMEN_exclAsst_SMEB == 1 27 | replace temp_ECMEN_categ = 2 if ECMEN_exclAsst_SMEB == 0 28 | 29 | ** Label the values 30 | label define ECMEN_categ 2 "below SMEB" 1 "below MEB and above SMEB" 0 "above MEB" 31 | label value temp_ECMEN_categ ECMEN_categ 32 | 33 | *** Declare whether the 21 or 28 treshold is used for FCS 34 | gen temp_FCS_categ = FCSCat21 // ! replace with FCSCat28 if the CO uses 28 treshold ! 35 | 36 | 37 | *------------------------------------------------------------------------------* 38 | *2. Classify households into vulnerability categories 39 | *------------------------------------------------------------------------------* 40 | 41 | gen ENA_vulnerability = . 42 | 43 | replace ENA_vulnerability = 3 if temp_ECMEN_categ == 2 | Max_coping_behaviourEN == 4 | temp_FCS_categ == 1 44 | 45 | replace ENA_vulnerability = 4 if temp_ECMEN_categ == 2 & Max_coping_behaviourEN == 4 46 | replace ENA_vulnerability = 4 if temp_ECMEN_categ == 2 & temp_FCS_categ == 1 47 | replace ENA_vulnerability = 4 if Max_coping_behaviourEN == 4 & temp_FCS_categ == 1 48 | 49 | replace ENA_vulnerability = 2 if temp_ECMEN_categ == 1 & Max_coping_behaviourEN < 4 & inrange(temp_FCS_categ,2,3) 50 | replace ENA_vulnerability = 2 if temp_ECMEN_categ == 0 & Max_coping_behaviourEN == 3 & inrange(temp_FCS_categ,2,3) 51 | replace ENA_vulnerability = 2 if temp_ECMEN_categ == 0 & Max_coping_behaviourEN < 3 & temp_FCS_categ == 2 52 | 53 | replace ENA_vulnerability = 1 if temp_ECMEN_categ == 0 & Max_coping_behaviourEN < 3 & temp_FCS_categ ==3 54 | 55 | * Label the variable 56 | label define vulnerability_tiers 1 "Not vulnerable" 2 "Moderately vulnerable" 3 "Highly vulnerable" 4 "Extremely vulnerable" 57 | label values ENA_vulnerability vulnerability_tiers 58 | 59 | *** Calculate the population share in vulnerability tiers 60 | tab ENA_vulnerability 61 | 62 | * drop unnecessary variables 63 | drop temp_ECMEN_categ temp_FCS_categ -------------------------------------------------------------------------------- /Indicators/ENA-vulnerability-classification/ENA_vulnerability.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | ******************************************************************************** 4 | * SPSS Syntax for the ENA vulnerability classification methodology 5 | ******************************************************************************* 6 | 7 | 8 | *NOTES: 9 | 10 | * This syntax file is based on the vulnerability classification methodology recommended for Essential Needs Assessments. 11 | * This classification is based on the combination of three indicators: the Economic Capacity to Meet Essential Needs (ECMEN), the Livelihood Coping Index for Essential Needs (LCS-EN), and the Food Consumption Score (FCS). 12 | *However, the vulnerability classification methodolgy can be adapted based on programme needs. See chapter 6 of the Essential Needs Assessment guidance note for more details. 13 | 14 | * The syntax files assumes that ECMEN, LCS-EN, and FCS have already been computed based on standard syntax available in 15 | github (https://github.com/WFP-VAM/RAMResourcesScripts/tree/main/Indicators). The following variables should have been defined before running this file: 16 | ECMEN_exclAsst 17 | ECMEN_exclAsst_SMEB 18 | Max_coping_behaviourEN 19 | FCSCat28 20 | FCSCat21 21 | */ 22 | 23 | *------------------------------------------------------------------------------. 24 | * 1. Create temporary variables. 25 | *------------------------------------------------------------------------------. 26 | 27 | * Create a categorical variable for ECMEN that informs if a household is above MEB, between MEB and SMEB, or below SMEB. 28 | COMPUTE temp_ECMEN_categ = 0. 29 | IF (ECMEN_exclAsst = 1) temp_ECMEN_categ = 0. 30 | IF (ECMEN_exclAsst = 0 & ECMEN_exclAsst_SMEB = 1) temp_ECMEN_categ = 1. 31 | IF (ECMEN_exclAsst_SMEB = 0) temp_ECMEN_categ = 2. 32 | 33 | * Label the values. 34 | VALUE LABELS temp_ECMEN_categ 35 | 2 'below SMEB' 36 | 1 'below MEB and above SMEB' 37 | 0 'above MEB'. 38 | 39 | * Declare whether the 21 or 28 threshold is used for FCS. 40 | COMPUTE temp_FCS_categ = FCSCat21 /* ! replace with FCSCat28 if the CO uses 28 threshold ! */. 41 | 42 | *------------------------------------------------------------------------------. 43 | * 2. Classify households into vulnerability categories. 44 | *------------------------------------------------------------------------------. 45 | 46 | COMPUTE ENA_vulnerability = 3. 47 | IF (temp_ECMEN_categ = 2 | Max_coping_behaviourEN = 4 | temp_FCS_categ = 1) ENA_vulnerability = 3. 48 | 49 | IF (temp_ECMEN_categ = 2 & Max_coping_behaviourEN = 4) ENA_vulnerability = 4. 50 | IF (temp_ECMEN_categ = 2 & temp_FCS_categ = 1) ENA_vulnerability = 4. 51 | IF (Max_coping_behaviourEN = 4 & temp_FCS_categ = 1) ENA_vulnerability = 4. 52 | 53 | IF (temp_ECMEN_categ = 1 & Max_coping_behaviourEN < 4 & temp_FCS_categ >= 2 & temp_FCS_categ <= 3) ENA_vulnerability = 2. 54 | IF (temp_ECMEN_categ = 0 & Max_coping_behaviourEN = 3 & temp_FCS_categ >= 2 & temp_FCS_categ <= 3) ENA_vulnerability = 2. 55 | IF (temp_ECMEN_categ = 0 & Max_coping_behaviourEN < 3 & temp_FCS_categ = 2) ENA_vulnerability = 2. 56 | 57 | IF (temp_ECMEN_categ = 0 & Max_coping_behaviourEN < 3 & temp_FCS_categ = 3) ENA_vulnerability = 1. 58 | 59 | * Label the variable. 60 | VALUE LABELS ENA_vulnerability 61 | 1 'Not vulnerable' 62 | 2 'Moderately vulnerable' 63 | 3 'Highly vulnerable' 64 | 4 'Extremely vulnerable'. 65 | 66 | * Calculate the population share in vulnerability tiers. 67 | FREQUENCIES ENA_vulnerability. 68 | 69 | * Drop unnecessary variables. 70 | DELETE VARIABLES temp_ECMEN_categ temp_FCS_categ. 71 | 72 | -------------------------------------------------------------------------------- /Indicators/Engagement-in-income-generating-activities/EIG-indicator.do: -------------------------------------------------------------------------------- 1 | ***Create Engagement in Income Generation Activities [EIG] using standard variables names 2 | 3 | /* Import static sample data */ 4 | import delim using "../../Static/EIG_Sample_Survey.csv", clear case(preserve) bindquotes(strict) varn(1) 5 | 6 | /* Rearrange variable names and codes to ensure consistency in the dataset*/ 7 | * in particular, variables within repeats are imported with progressive integer names (v1-v2-v3...) as they would be all assigned the same name otherwise 8 | * the loop below names variables as [Variablename]+[_number of option]+[_number of repetition] 9 | 10 | qui su RepeatPAsstEIG_count 11 | loc RepeatNum=`r(max)' 12 | 13 | local num1=1 14 | foreach var of varlist v* { 15 | local `var'_lab: variable label `var' 16 | loc `var'_lab=subinstr(`"``var'_lab'"',"/","",.) 17 | di `"``var'_lab'"' 18 | cap rename `var' ``var'_lab' 19 | if _rc==110 { 20 | cap rename ``var'_lab' ``var'_lab'_1 21 | cap rename `var' ``var'_lab'_`num1' 22 | if _rc==110 { 23 | local num1=`num1'+1 24 | cap rename `var' ``var'_lab'_`num1' 25 | } 26 | } 27 | } 28 | 29 | assert `num1'==`RepeatNum' // check if all household members have been accounted in the loop 30 | 31 | qui foreach var of varlist * { 32 | cap destring `var', replace i("n/a") // destring variables that have "n/a", which will be replaced with "." (as per Stata convention) 33 | } 34 | 35 | // repeat for the number of HH members participating. 36 | forval i=1(1)`RepeatNum' { 37 | local PTrainingPart 38 | // loop is set to account for up to 9 training types, with 0 as no training. 39 | forval j=1(1)9 { 40 | cap confirm var PTrainingTypes`j'_`i' 41 | if _rc==0 { 42 | local PTrainingPart `PTrainingPart' PTrainingTypes`j'_`i' 43 | } 44 | } 45 | 46 | egen PostTrainingEngagement_`i'=rowmax(PPostTrainingEmpl_`i' PPostTrainingIncome_`i') // if individual was either employed or started a self-employment 47 | local PostTrainingEngagement `PostTrainingEngagement' PostTrainingEngagement_`i' 48 | 49 | egen PTrainingPart_`i'=rowmax(`PTrainingPart') // if individual participated at least a training activity in the list 50 | local PTrainingPartNb `PTrainingPartNb' PTrainingPart_`i' 51 | 52 | } 53 | // variables (counts and shares) are still at household level 54 | egen PostTrainingEngagement=rowtotal(`PostTrainingEngagement') 55 | label var PostTrainingEngagement "Number of training participants engaging in income generating activities (self-employed or salaried)" 56 | egen PTrainingPartNb=rowtotal(`PTrainingPartNb') 57 | label var PTrainingPartNb "Number of training participants" 58 | 59 | gen EIG=PostTrainingEngagement/PTrainingPartNb 60 | label var EIG "Share of training participants who were able to engage in income generating activities post-training" 61 | cap drop `PTrainingPartNb' `PostTrainingEngagement' 62 | // example of summary statistic for full sample, more analysis code is provided in the dedicated repository 63 | su EIG 64 | 65 | 66 | /* END OF DO-FILE */ -------------------------------------------------------------------------------- /Indicators/Engagement-in-income-generating-activities/README.md: -------------------------------------------------------------------------------- 1 | A markdown for EIG indicator 2 | -------------------------------------------------------------------------------- /Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | * define variable and value labels 3 | 4 | Variable labels EBIFFAPart 'Have you or any of your household member participated in the asset creation activities and received a food assistance transfer?'. 5 | Variable labels EBISoilFertility 'Do you think that the assets that were built or rehabilitated in your community have allowed to increase agricultural potential due to greater water availability and/or soil fertility (e.g. increased or diversified production not requiring expanded irrigation)'. 6 | Variable labels EBIStabilization 'Do you think that the assets that were built or rehabilitated in your community have improved natural environment due to land stabilization and restoration (e.g. more natural vegetal cover, increase in indigenous flora/fauna, less erosion or siltation, etc.)?'. 7 | Variable labels EBISanitation 'Do you think that the assets that were built or rehabilitated in your community have improved environmental surroundings due to enhanced water and sanitation measures (i.e., greater availability/longer duration of water for domestic non-human consumption, improved hygiene practices – less open defecation)?'. 8 | 9 | Value labels EBIFFAPart 1 'Yes' 0 'No'. 10 | Value labels EBISoilFertility EBIStabilization EBISanitation 1 'Yes' 0 'No' 9999 'Not applicable'. 11 | 12 | *take a look at of responses by community and note how many questions were answered for each community 13 | 14 | CROSSTABS 15 | /TABLES= EBISoilFertility EBIStabilization EBISanitation BY ADMIN5Name 16 | /CELLS=COUNT 17 | /COUNT ROUND CELL. 18 | 19 | * recode 9999 to 0 20 | 21 | RECODE EBISoilFertility EBIStabilization EBISanitation (9999=0) (0=0) (1=1). 22 | EXECUTE. 23 | 24 | * create table of % of yes responses to each of the 3 questions by ADMIN5Name 25 | 26 | DATASET DECLARE table_allperc. 27 | SORT CASES BY ADMIN5Name. 28 | AGGREGATE 29 | /OUTFILE='table_allperc' 30 | /PRESORTED 31 | /BREAK=ADMIN5Name 32 | /EBISoilFertility_mean=MEAN(EBISoilFertility) 33 | /EBIStabilization_mean=MEAN(EBIStabilization) 34 | /EBISanitation_mean=MEAN(EBISanitation) . 35 | 36 | DATASET ACTIVATE table_allperc. 37 | COMPUTE EBISoilFertility_perc=EBISoilFertility_mean * 100. 38 | COMPUTE EBIStabilization_perc=EBIStabilization_mean * 100. 39 | COMPUTE EBISanitation_perc=EBISanitation_mean * 100. 40 | EXECUTE. 41 | 42 | *create values with the denominator of questions asked for each community - should scan through the data and values from tables above to generate these values 43 | 44 | DATASET ACTIVATE table_allperc. 45 | do if ADMIN5Name = "Community A". 46 | 47 | compute EBIdenom =2. 48 | else. 49 | compute EBIdenom = 3. 50 | end if. 51 | EXECUTE. 52 | 53 | *calculate EBI by community 54 | 55 | DATASET ACTIVATE table_allperc. 56 | compute EBI_ADMIN5Name = (EBISoilFertility_perc + EBIStabilization_perc + EBISanitation_perc) / EBIdenom. 57 | EXECUTE. 58 | 59 | *finally calculate total EBI average EBI across all communities 60 | 61 | DATASET ACTIVATE table_allperc. 62 | DESCRIPTIVES VARIABLES=EBI_ADMIN5Name 63 | /STATISTICS=MEAN. 64 | -------------------------------------------------------------------------------- /Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #import dataset 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/EBI_Sample_Survey.csv") 7 | 8 | #assign variable and value labels 9 | var_label(data$EBIFFAPart) <- "Have you or any of your household member participated in the asset creation activities and received a food assistance transfer?" 10 | var_label(data$EBISoilFertility) <- "Do you think that the assets that were built or rehabilitated in your community have allowed to increase agricultural potential due to greater water availability and/or soil fertility (e.g. increased or diversified production not requiring expanded irrigation)?" 11 | var_label(data$EBIStabilization) <- "Do you think that the assets that were built or rehabilitated in your community have improved natural environment due to land stabilization and restoration (e.g. more natural vegetal cover, increase in indigenous flora/fauna, less erosion or siltation, etc.)?" 12 | var_label(data$EBISanitation) <- "Do you think that the assets that were built or rehabilitated in your community have improved environmental surroundings due to enhanced water and sanitation measures (i.e., greater availability/longer duration of water for domestic non-human consumption, improved hygiene practices – less open defecation)?" 13 | 14 | val_lab(data$EBIFFAPart) = num_lab(" 15 | 0 No 16 | 1 Yes 17 | ") 18 | 19 | data <- data %>% 20 | mutate(across(c(EBISoilFertility,EBIStabilization,EBISanitation), ~labelled(., labels = c( 21 | "No" = 0, 22 | "Yes" = 1, 23 | "Not applicable" = 999 24 | )))) 25 | 26 | #recode 9999 to 0 27 | data <- data %>% 28 | mutate(across(EBISoilFertility:EBISanitation, ~ dplyr::recode(.x, "0" = 0, "1" = 1, "9999" = 0))) 29 | 30 | 31 | #create 3 tables with the % of yes responses to each of the 3 questions by ADMIN5Name 32 | 33 | table_perc_soilfert <- data %>% group_by(ADMIN5Name) %>% 34 | summarize(n = n(), EBISoilFertility_tot = sum(EBISoilFertility)) %>% mutate(EBISoilFertility_perc = round(((EBISoilFertility_tot / n) * 100),1)) %>% select(ADMIN5Name,EBISoilFertility_perc) 35 | 36 | table_perc_stab <- data %>% group_by(ADMIN5Name) %>% 37 | summarize(n = n(), EBIStabilization_tot = sum(EBIStabilization)) %>% mutate(EBIStabilization_perc = round(((EBIStabilization_tot / n) * 100),1)) %>% select(ADMIN5Name,EBIStabilization_perc) 38 | 39 | table_perc_san <- data %>% group_by(ADMIN5Name) %>% 40 | summarize(n = n(), EBISanitation_tot = sum(EBISanitation)) %>% mutate(EBISanitation_perc = round(((EBISanitation_tot / n) * 100),1)) %>% select(ADMIN5Name,EBISanitation_perc) 41 | 42 | #join together the perc values of each of the three tables 43 | table_allperc <- table_perc_soilfert %>% left_join(table_perc_stab, by='ADMIN5Name') %>% left_join(table_perc_san, by='ADMIN5Name') 44 | 45 | 46 | 47 | #create table with the denominator of questions asked for each community - should scan through the data and values from tables above to generate these values 48 | num_quest_table <- data %>% count(ADMIN5Name) %>% mutate(EBIdenom = case_when( 49 | ADMIN5Name == "Community A" ~ 2, 50 | ADMIN5Name == "Community B" ~ 3 51 | )) %>% select(-n) 52 | 53 | #join table with percentages of each question with the table with count of number of questions (EBIdenom) 54 | perc_denom_table <- table_allperc %>% left_join(num_quest_table, by='ADMIN5Name') 55 | #then calculate EBI by community 56 | EBI_ADMIN5Name <- perc_denom_table %>% mutate(EBI_ADMIN5Name = ((EBISoilFertility_perc + EBIStabilization_perc + EBISanitation_perc) / EBIdenom)) 57 | 58 | #finally calculate total EBI combining all communities 59 | EBI_overall <- EBI_ADMIN5Name %>% summarize(EBI_overall = round(mean(EBI_ADMIN5Name),1)) 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Indicators/Food-consumption-score-nutrition/FCSN-indicator-calculation.do: -------------------------------------------------------------------------------- 1 | *------------------------------------------------------------------------------* 2 | 3 | * WFP RAM Standardized Scripts 4 | * Calculating Food Consumption Score - Nutrition (FCSN) 5 | 6 | * -----------------------------------------------------------------------------* 7 | * 8 | * Load data 9 | * --------- 10 | import delim using "../GitHub/RAMResourcesScripts/Static/FCSN_Sample_Survey.csv", /// 11 | clear case(preserve) 12 | 13 | ** check and recode missing values as 0 14 | sum FCS* 15 | sum FCSN* 16 | recode FCS* (. = 0) 17 | 18 | ** assign variable labels 19 | label var FCSNPrMeatF "Consumption in past 7 days: Flesh meat" 20 | label var FCSNPrMeatO "Consumption in past 7 days: Organ meat" 21 | label var FCSNPrFish "Consumption in past 7 days: Fish/shellfish" 22 | label var FCSNPrEggs "Consumption in past 7 days: Eggs" 23 | label var FCSNVegOrg "Consumption in past 7 days: Orange vegetables (vegetables rich in Vitamin A)" 24 | label var FCSNVegGre "Consumption in past 7 days: Green leafy vegetables" 25 | label var FCSNFruiOrg "Consumption in past 7 days: Orange fruits (Fruits rich in Vitamin A)" 26 | 27 | ** create aggregates of key micronutrient consumption of vitamin, iron and protein 28 | gen FGVitA = FCSDairy + FCSNPrMeatO + FCSNPrEggs + FCSNVegOrg + FCSNVegGre + FCSNFruiOrg 29 | gen FGProtein = FCSPulse + FCSDairy + FCSNPrMeatF + FCSNPrMeatO + FCSNPrFish + FCSNPrEggs 30 | gen FGHIron = FCSNPrMeatF + FCSNPrMeatO + FCSNPrFish 31 | 32 | label var FGVitA "Consumption of vitamin A-rich foods" 33 | label var FGProtein "Consumption of protein-rich foods" 34 | label var FGHIron "Consumption of hem iron-rich foods" 35 | 36 | ** recode into nutritious groups 37 | gen FGVitACat = cond(FGVitA < 1,1,cond(FGVitA <= 6,2,3)) 38 | gen FGProteinCat = cond(FGProtein < 1,1,cond(FGProtein <= 6,2,3)) 39 | gen FGHIronCat = cond(FGHIron < 1,1,cond(FGHIron <= 6,2,3)) 40 | 41 | ** define variables labels and properties for FGVitACat FGProteinCat FGHIronCat 42 | label def FGN_l 1 "Never consumed" /// 43 | 2 "Consumed sometimes" /// 44 | 3 "Consumed at least 7 times" 45 | label val FGVitACat FGProteinCat FGHIron_Cat FGHIronCat 46 | 47 | label var FGVitACat "Consumption group of vitamin A-rich foods" 48 | label var FGProteinCat "Consumption group of protein-rich foods" 49 | label var FGHIronCat "Consumption group of heme iron-rich foods" 50 | 51 | * End of scripts 52 | -------------------------------------------------------------------------------- /Indicators/Food-consumption-score-nutrition/FCSN-indicator-calculation.sps: -------------------------------------------------------------------------------- 1 | *** -------------------------------------------------------------------------- 2 | 3 | *** WFP RAM Standardized Scripts 4 | *** Calculating Food Consumption Score Nutrition (FCSN) 5 | 6 | *** -------------------------------------------------------------------------- 7 | 8 | * Encoding: UTF-8. 9 | 10 | *** Define labels 11 | 12 | Variable labels 13 | FCSNPrMeatF "Consumption in past 7 days: Flesh meat" 14 | FCSNPrMeatO "Consumption in past 7 days: Organ meat" 15 | FCSNPrFish "Consumption in past 7 days: Fish/shellfish" 16 | FCSNPrEggs "Consumption in past 7 days: Eggs" 17 | FCSNVegOrg "Consumption in past 7 days: Orange vegetables (vegetables rich in Vitamin A)" 18 | FCSNVegGre "Consumption in past 7 days: Green leafy vegetables" 19 | FCSNFruiOrg "Consumption in past 7 days: Orange fruits (Fruits rich in Vitamin A)". 20 | 21 | *** Recode "n/a" values to 0 and change variable type to numeric 22 | 23 | ALTER TYPE FCSNPrMeatF FCSNPrMeatO FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg (a5). 24 | 25 | RECODE FCSNPrMeatF FCSNPrMeatO FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg 26 | ('n/a'='0'). 27 | EXECUTE. 28 | 29 | ALTER TYPE FCSNPrMeatF FCSNPrMeatO FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg (F1). 30 | 31 | *** Compute aggregates of key micronutrient consumption – vitamin, iron and protein 32 | 33 | Compute FGVitA = sum(FCSDairy, FCSNPrMeatO, FCSNPrEggs, FCSNVegOrg, FCSNVegGre, FCSNFruiOrg). 34 | Variable labels FGVitA 'Consumption of vitamin A-rich foods'. 35 | EXECUTE. 36 | 37 | Compute FGProtein = sum(FCSPulse, FCSDairy, FCSNPrMeatF, FCSNPrMeatO, FCSNPrFish, FCSNPrEggs). 38 | Variable labels FGProtein 'Consumption of protein-rich foods'. 39 | EXECUTE. 40 | 41 | Compute FGHIron = sum(FCSNPrMeatF, FCSNPrMeatO, FCSNPrFish). 42 | Variable labels FGHIron 'Consumption of hem iron-rich foods'. 43 | EXECUTE. 44 | 45 | *** Recode into nutritious groups 46 | 47 | Recode FGVitA (0=1) (1 thru 6=2) (7 thru 42=3) into FGVitACat. 48 | Variable labels FGVitACat 'Consumption group of vitamin A-rich foods'. 49 | EXECUTE. 50 | 51 | Recode FGProtein (0=1) (1 thru 6=2) (7 thru 42=3) into FGProteinCat. 52 | Variable labels FGProteinCat 'Consumption group of protein-rich foods'. 53 | EXECUTE. 54 | 55 | Recode FGHIron (0=1) (1 thru 6=2) (7 thru 42=3) into FGHIronCat. 56 | Variable labels FGHIronCat 'Consumption group of hem iron-rich foods'. 57 | EXECUTE. 58 | 59 | *** Define variables labels and properties for "FGVitACat FGProteinCat FGHIronCat". 60 | 61 | Value labels FGVitACat FGProteinCat FGHIronCat 62 | 1.00 'Never consumed' 2.00 'Consumed sometimes' 3.00 'Consumed at least 7 times'. 63 | 64 | EXECUTE. 65 | 66 | *** End of Scripts -------------------------------------------------------------------------------- /Indicators/Food-consumption-score-nutrition/FCSN_indicator_tidyverse.R: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------# 2 | 3 | # WFP RAM Standardized Scripts 4 | # Calculating Food Consumption Score - Nutrition (FCSN) 5 | 6 | #------------------------------------------------------------------------------# 7 | 8 | rm(list = ls()) 9 | 10 | ## Load Packages --------------------------------------------------------------# 11 | 12 | library(tidyverse) 13 | library(labelled) 14 | library(expss) 15 | 16 | # Load Sample Data ------------------------------------------------------------# 17 | 18 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/FCSN_Sample_Survey.csv") 19 | 20 | # Label FCSN relevant variables -----------------------------------------------# 21 | 22 | var_label(data$FCSNPrMeatF) <- "Consumption in past 7 days: Flesh meat" 23 | var_label(data$FCSNPrMeatO) <- "Consumption in past 7 days: Organ meat" 24 | var_label(data$FCSNPrFish) <- "Consumption in past 7 days: Fish/shellfish" 25 | var_label(data$FCSNPrEggs) <- "Consumption in past 7 days: Eggs" 26 | var_label(data$FCSNVegOrg) <- "Consumption in past 7 days: Orange vegetables (vegetables rich in Vitamin A)" 27 | var_label(data$FCSNVegGre) <- "Consumption in past 7 days: Green leafy vegetables" 28 | var_label(data$FCSNFruiOrg) <- "Consumption in past 7 days: Orange fruits (Fruits rich in Vitamin A)" 29 | 30 | #recode "n/a" values to 0 and change to numeric 31 | vars2recode <- c("FCSNPrMeatF","FCSNPrMeatO","FCSNPrFish","FCSNPrEggs", 32 | "FCSNVegOrg","FCSNVegGre","FCSNFruiOrg") 33 | 34 | data <- data %>% mutate_at(vars2recode, ~replace(., . == "n/a", "0")) 35 | data <- data %>% mutate_at(vars2recode, as.numeric) 36 | 37 | # Compute aggregates of key micronutrient consumption -------------------------# 38 | 39 | ## Vitamin A-Rich Foods -------------------------------------------------------# 40 | 41 | data <- data %>% mutate(FGVitA = FCSDairy +FCSNPrMeatO +FCSNPrEggs + 42 | FCSNVegOrg +FCSNVegGre +FCSNFruiOrg) 43 | var_label(data$FGVitA) <- "Consumption of vitamin A-rich foods" 44 | 45 | ## Protein-Rich Foods ---------------------------------------------------------# 46 | 47 | data <- data %>% mutate(FGProtein = FCSPulse +FCSDairy +FCSNPrMeatF + 48 | FCSNPrMeatO +FCSNPrFish +FCSNPrEggs) 49 | var_label(data$FGProtein) <- "Consumption of protein-rich foods" 50 | 51 | ## Iron-Rich Foods ------------------------------------------------------------# 52 | 53 | data <- data %>% mutate(FGHIron = FCSNPrMeatF +FCSNPrMeatO +FCSNPrFish) 54 | var_label(data$FGHIron) <- "Consumption of heme iron-rich foods" 55 | 56 | ## recode into nutritious groups ---------------------------------------------# 57 | 58 | data <- data %>% mutate(FGVitACat = case_when(FGVitA == 0 ~ 1, 59 | between(FGVitA,1,6) ~ 2, 60 | FGVitA >= 7 ~ 3), 61 | FGProteinCat = case_when(FGProtein == 0 ~ 1, 62 | between(FGProtein,1,6) ~ 2, 63 | FGProtein >= 7 ~ 3), 64 | FGHIronCat = case_when(FGHIron == 0 ~ 1, 65 | between(FGHIron,1,6) ~ 2, 66 | FGHIron >= 7 ~ 3)) 67 | 68 | # define variables labels and properties for FGVitACat FGProteinCat FGHIronCat 69 | data <- data %>% 70 | mutate(across(c(FGVitACat, FGProteinCat, FGHIronCat), 71 | ~labelled(., labels = c( 72 | "Never consumed" = 1, 73 | "Consumed sometimes" = 2, 74 | "Consumed at least 7 times" = 3 75 | )))) 76 | 77 | data <- data %>% 78 | mutate(across(c(FGVitACat, FGProteinCat, FGHIronCat), 79 | ~factor(., levels = c(1, 2, 3), 80 | labels = c("Never consumed", "Consumed sometimes", 81 | "Consumed at least 7 times")))) 82 | 83 | var_label(data$FGVitACat) <- "Consumption group of vitamin A-rich foods" 84 | var_label(data$FGProteinCat) <- "Consumption group of protein-rich foods" 85 | var_label(data$FGHIronCat) <- "Consumption group of heme iron-rich foods" 86 | 87 | # End of Scripts -------------------------------------------------------------------------------- /Indicators/Food-consumption-score-nutrition/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Scripts 2 | This folder contains all standardized scripts for indicators, analysis and visualization. 3 | 4 | ## Food Consumption Score Nutritional Quality Analysis (FCS-N) 5 | - [Indicator Description on VAM Resource Center](https://resources.vam.wfp.org/data-analysis/quantitative/food-security/food-consumption-score) 6 | -------------------------------------------------------------------------------- /Indicators/Food-consumption-score/FCS-indicator-calculation.R: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------# 2 | 3 | # WFP RAM Standardized Scripts 4 | # Calculating FCS 5 | 6 | #------------------------------------------------------------------------------# 7 | 8 | ## Load Packages --------------------------------------------------------------# 9 | 10 | ipak <- function(pkg){ 11 | new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] 12 | if (length(new.pkg)) 13 | install.packages(new.pkg, dependencies = TRUE) 14 | sapply(pkg, require, character.only = TRUE) 15 | } 16 | 17 | packages<-c('psych','diveRsity','expss') 18 | ipak(packages) 19 | 20 | library('psych') 21 | library("diveRsity") 22 | 23 | # Set working directory -------------------------------------------------------# 24 | 25 | ## Get working directory 26 | getwd()# Display current working directory 27 | dir()# Display working directory content 28 | 29 | setwd("C:\\Users\\name.lastname\\Documents\\Rfolder") 30 | # This is just an example. Copy and paste your own working directory. Remember to use "\\" instead of "/" 31 | # The data base to be used should be part of the content 32 | 33 | # Load Sample Data ------------------------------------------------------------# 34 | 35 | data <- read.csv("../../Static/FCS_Sample_Survey.csv",na.strings = "n/a") 36 | 37 | names(data)# Display var names for the entire data base 38 | attach(data)# Attach the data base for easy access to var names. 39 | 40 | # Prepare FCS related variables -----------------------------------------------# 41 | 42 | # 1. Re-coding missing values to zero 43 | data$FCSStap[is.na(data$FCSStap)] <-0 44 | data$FCSVeg[is.na(data$FCSVeg)] <-0 45 | data$FCSFruit[is.na(data$FCSFruit)] <-0 46 | data$FCSPr[is.na(data$FCSPr)] <-0 47 | data$FCSPulse[is.na(data$FCSPulse)] <-0 48 | data$FCSDairy[is.na(data$FCSDairy)] <-0 49 | data$FCSSugar[is.na(data$FCSSugar)] <-0 50 | data$FCSFat[is.na(data$FCSFat)] <-0 51 | data$FCSCond[is.na(data$FCSCond)] <-0 52 | 53 | # Test results 54 | print(data$FCSStap) # How data looks like? 55 | 56 | ## 2. Variables creation and statistics testing 57 | # Var FCSStapCer FCSStapTub 58 | # although deprecated, in case two staples are collected separately, then: 59 | if ("FCSStap" %in% colnames(data)) {"x"} else 60 | { 61 | data$FCSStap <- mapply(max, data$FCSStapCer, data$FCSStapTub, na.rm=T) 62 | } 63 | count(data$FCSStap) 64 | basicStats(data$FCSStap, ci=0.95) 65 | plot(density(data$FCSStap)) 66 | 67 | # Legumes/nuts (FCSPulse) 68 | data$FCSPulse 69 | count(data$FCSPulse) 70 | basicStats(data$FCSPulse, ci=0.95) 71 | plot(density(data$FCSPulse)) 72 | 73 | # Milk and other dairy products (FCSDairy) 74 | data$FCSDairy 75 | count(data$FCSDairy) 76 | basicStats(data$FCSDairy, ci=0.95) 77 | plot(density(data$FCSDairy)) 78 | 79 | # Meat, fish and eggs (FCSPr) 80 | data$FCSPr 81 | count(data$FCSPr) 82 | basicStats(data$FCSPr, ci=0.95) 83 | plot(density(data$FCSPr)) 84 | 85 | # Vegetables and leaves (FCSVeg) 86 | data$FCSVeg 87 | count(data$FCSVeg) 88 | basicStats(data$FCSVeg, ci=0.95) 89 | plot(density(data$FCSVeg)) 90 | 91 | # Fruits (FCSFruit) 92 | data$FCSFruit 93 | count(data$FCSFruit) 94 | basicStats(data$FCSFruit, ci=0.95) 95 | plot(density(data$FCSFruit)) 96 | 97 | # Oil, fat and butter (FCSFat) 98 | data$FCSFat 99 | count(data$FCSFat) 100 | basicStats(data$FCSFat, ci=0.95) 101 | plot(density(data$FCSFat)) 102 | 103 | # Sugar and sweet (FCSSugar) 104 | data$FCSSugar 105 | count(data$FCSSugar) 106 | basicStats(data$FCSSugar, ci=0.95) 107 | plot(density(data$FCSSugar)) 108 | 109 | # Condiments / Spices 110 | data$FCSCond 111 | count(data$FCSCond) 112 | basicStats(data$FCSCond, ci=0.95) 113 | plot(density(data$FCSCond)) 114 | 115 | # 2.1 Recode above 7 to 7 (only if necessary) 116 | data$Ncertub[data$FCSStap>7] <- 7 117 | data$FCSPulse[data$FCSPulse>7] <- 7 118 | data$FCSDairy[data$FCSDairy>7] <- 7 119 | data$FCSPr[data$FCSPr>7] <- 7 120 | data$FCSVeg[data$FCSVeg>7] <- 7 121 | data$FCSFruit[data$FCSFruit>7] <- 7 122 | data$FCSFat[data$FCSFat>7] <- 7 123 | data$FCSSugar[data$FCSSugar>7] <- 7 124 | data$FCSCond[data$FCSCond>7] <- 7 125 | 126 | # Calculate FCS ---------------------------------------------------------------# 127 | data$FCS <- mapply(sum,(data$FCSStap*2),(data$FCSPulse*3),(data$FCSDairy*4), 128 | (data$FCSPr*4),(data$FCSVeg),(data$FCSFruit),(data$FCSFat*0.5), 129 | (data$FCSSugar*0.5)) 130 | ###### Test ##### 131 | head(data$FCS, n=10) 132 | psych::describe(data$FCS) 133 | summary(data$FCS) 134 | stat.desc(data$FCS, basic = F) 135 | plot(density(data$FCS)) 136 | 137 | # Create FCG groups based on 21/55 or 28/42 thresholds ------------------------# 138 | ###Use this when analyzing a country with low consumption of sugar and oil - thresholds 21-35 139 | data$FCSCat21 <-cut(data$FCS, 140 | breaks=c(0,21,35,Inf), 141 | include.lowest=TRUE, 142 | #labels=c("Poor","Borderline","Acceptable")) 143 | labels=FALSE) 144 | 145 | ### define value labels and properties for "FCS Categories". 146 | val_lab(data$FCSCat21) = num_lab(" 147 | 1 Poor 148 | 2 Borderline 149 | 3 Acceptable 150 | ") 151 | 152 | ### Important note: pay attention to the threshold used by your CO when selecting the syntax (21 cat. vs 28 cat.) 153 | ### Use this when analyzing a country with high consumption of sugar and oil - thresholds 28-42 154 | data$FCSCat28 <-cut(data$FCS, 155 | breaks=c(0,28,42,Inf), 156 | include.lowest=TRUE, 157 | #labels=c("Poor","Borderline","Acceptable")) 158 | labels=FALSE) 159 | ### define value labels and properties for "FCS Categories". 160 | val_lab(data$FCSCat28) = num_lab(" 161 | 1 Poor 162 | 2 Borderline 163 | 3 Acceptable 164 | ") 165 | 166 | # End of Scripts -------------------------------------------------------------------------------- /Indicators/Food-consumption-score/FCS-indicator-calculation.do: -------------------------------------------------------------------------------- 1 | *------------------------------------------------------------------------------* 2 | 3 | * WFP RAM Standardized Scripts 4 | * Calculating Food Consumption Score (FCS) 5 | 6 | *----------------------------------------------------------------------------- 7 | 8 | ** Load data 9 | * --------- 10 | import delim using "../../Static/FCS_Sample_Survey.csv", clear /// 11 | case(preserve) bindquotes(strict) varn(1) 12 | 13 | ** Label FCS relevant variables 14 | label var FCSStap "Consumption over the past 7 days: cereals, grains and tubers" 15 | label var FCSPulse "Consumption over the past 7 days: pulses" 16 | label var FCSDairy "Consumption over the past 7 days: dairy products" 17 | label var FCSPr "Consumption over the past 7 days: meat, fish and eggs" 18 | label var FCSVeg "Consumption over the past 7 days: vegetables" 19 | label var FCSFruit "Consumption over the past 7 days: fruit" 20 | label var FCSFat "Consumption over the past 7 days: fat and oil" 21 | label var FCSSugar "Consumption over the past 7 days: sugaror sweets" 22 | label var FCSCond "Consumption over the past 7 days: condiments or spices" 23 | 24 | ** Clean and recode missing values 25 | recode FCSStap FCSVeg FCSFruit FCSPr FCSPulse FCSDairy FCSFat FCSSugar (. = 0) 26 | 27 | ** Create FCS 28 | gen FCS = (FCSStap * 2) + (FCSPulse * 3) + (FCSDairy * 4) + (FCSPr * 4) + /// 29 | (FCSVeg * 1) + (FCSFruit * 1) + (FCSFat * 0.5) + (FCSSugar * 0.5) 30 | 31 | label var FCS "Food Consumption Score" 32 | 33 | ** Create FCG groups based on 21/35 or 28/42 thresholds 34 | *** Use this when analyzing a country with low consumption of sugar and oil 35 | 36 | *** thresholds 21-35 37 | gen FCSCat21 = cond(FCS <= 21, 1, cond(FCS <= 35, 2, 3)) 38 | label var FCSCat21 "FCS Categories, thresholds 21-35" 39 | 40 | *** thresholds 28-42 41 | gen FCSCat28 = cond(FCS <= 28, 1, cond(FCS <= 42, 2, 3)) 42 | label var FCSCat28 "FCS Categories, thresholds 28-42" 43 | 44 | 45 | *** define variables labels and properties for "FCS Categories" 46 | label def FCSCat 1 "Poor" 2 "Borderline" 3 "Acceptable" 47 | label val FCSCat21 FCSCat28 FCSCat 48 | 49 | * --------- 50 | ** End of Scripts 51 | -------------------------------------------------------------------------------- /Indicators/Food-consumption-score/FCS-indicator-calculation.sps: -------------------------------------------------------------------------------- 1 | *** -------------------------------------------------------------------------- 2 | 3 | *** WFP RAM Standardized Scripts 4 | *** Calculating Food Consumption Score (FCS) 5 | 6 | *** -------------------------------------------------------------------------- 7 | 8 | * Encoding: UTF-8. 9 | 10 | *** Define labels 11 | 12 | Variable labels 13 | FCSStap 'Consumption over the past 7 days: cereals, grains and tubers' 14 | FCSPulse 'Consumption over the past 7 days: pulses' 15 | FCSDairy 'Consumption over the past 7 days: dairy products' 16 | FCSPr 'Consumption over the past 7 days: meat, fish and eggs' 17 | FCSVeg 'Consumption over the past 7 days: vegetables and leaves' 18 | FCSFruit 'Consumption over the past 7 days: fruit' 19 | FCSFat 'Consumption over the past 7 days: fat and oil' 20 | FCSSugar 'Consumption over the past 7 days: sugar or sweets' 21 | FCSCond 'Consumption over the past 7 days: condiments or spices'. 22 | 23 | *** Calculate FCS 24 | Compute FCS = sum(FCSStap*2, FCSPulse*3, FCSDairy*4, FCSPr*4, FCSVeg*1, FCSFruit*1, FCSFat*0.5, FCSSugar*0.5). 25 | Variable labels FCS "Food Consumption Score". 26 | EXECUTE. 27 | 28 | *** Use this when analyzing a country with low consumption of sugar and oil - thresholds 21-35 29 | 30 | Recode FCS (lowest thru 21 = 1) (21.5 thru 35 = 2) (35.5 thru highest = 3) into FCSCat21. 31 | Variable labels FCSCat21 "FCS Categories: 21/35 thresholds". 32 | EXECUTE. 33 | 34 | *** Define value labels and properties for "FCS Categories". 35 | 36 | Value labels FCSCat21 1.00 "Poor" 2.00 "Borderline" 3.00 "Acceptable". 37 | EXECUTE. 38 | 39 | *** Important note: pay attention to the threshold used by your CO when selecting the syntax (21 cat. vs 28 cat.) 40 | *** Use this when analyzing a country with high consumption of sugar and oil – thresholds 28-42 41 | 42 | Recode FCS (lowest thru 28 = 1) (28.5 thru 42 = 2) (42.5 thru highest = 3) into FCSCat28. 43 | Variable labels FCSCat28 "FCS Categories: 28/42 thresholds". 44 | EXECUTE. 45 | 46 | *** Define value labels and properties for "FCS Categories" 47 | 48 | Value labels FCSCat28 1.00 "Poor" 2.00 "Borderline" 3.00 "Acceptable". 49 | EXECUTE. 50 | 51 | *** End of scripts -------------------------------------------------------------------------------- /Indicators/Food-consumption-score/FCS_indicator_tidyverse.R: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------# 2 | 3 | # WFP RAM Standardized Scripts 4 | # Calculating FCS 5 | 6 | #------------------------------------------------------------------------------# 7 | 8 | ## Load Packages --------------------------------------------------------------# 9 | 10 | library(tidyverse) 11 | library(dplyr) 12 | library(labelled) 13 | library(expss) 14 | library(haven) 15 | 16 | # Load Sample Data ------------------------------------------------------------# 17 | 18 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/FCS_Sample_Survey.csv") 19 | 20 | # Label relevant FCS variables ------------------------------------------------# 21 | 22 | var_label(data$FCSStap) <- "Consumption over the past 7 days: cereals, grains and tubers" 23 | var_label(data$FCSPulse) <- "Consumption over the past 7 days: pulses" 24 | var_label(data$FCSDairy) <- "Consumption over the past 7 days: dairy products" 25 | var_label(data$FCSPr) <- "Consumption over the past 7 days: meat, fish and eggs" 26 | var_label(data$FCSVeg) <- "Consumption over the past 7 days: vegetables" 27 | var_label(data$FCSFruit) <- "Consumption over the past 7 days: fruit" 28 | var_label(data$FCSFat) <- "Consumption over the past 7 days: fat and oil" 29 | var_label(data$FCSSugar) <- "Consumption over the past 7 days: sugar or sweets:" 30 | var_label(data$FCSCond) <- "Consumption over the past 7 days: condiments or spices" 31 | 32 | # Calculate FCS ---------------------------------------------------------------# 33 | data <- data %>% mutate(FCS = (FCSStap * 2) + 34 | (FCSPulse * 3) + 35 | (FCSPr * 4) + 36 | (FCSDairy * 4) + 37 | FCSVeg + 38 | FCSFruit + 39 | (FCSFat * 0.5) + 40 | (FCSSugar * 0.5)) 41 | var_label(data$FCS) <- "Food Consumption Score" 42 | 43 | # Create FCG groups based on 21/35 or 28/42 thresholds ------------------------# 44 | 45 | # Use this when analyzing a country with low consumption of sugar and oil - thresholds 21-35 46 | data <- data %>% mutate(FCSCat21 = case_when( 47 | FCS <= 21 ~ 1, 48 | between(FCS, 21.5, 35) ~ 2, 49 | FCS > 35 ~ 3), 50 | FCSCat28 = case_when( 51 | FCS <= 28 ~ 1, 52 | between(FCS, 28.5, 42) ~ 2, 53 | FCS > 42 ~ 3)) 54 | 55 | val_lab(data$FCSCat21) = num_lab(" 56 | 1 Poor 57 | 2 Borderline 58 | 3 Acceptable 59 | ") 60 | var_label(data$FCSCat21) <- "FCS Categories: 21/35 thresholds" 61 | 62 | val_lab(data$FCSCat28) = num_lab(" 63 | 1 Poor 64 | 2 Borderline 65 | 3 Acceptable 66 | ") 67 | var_label(data$FCSCat28) <- "FCS Categories: 28/42 thresholds" 68 | 69 | # End of Scripts 70 | -------------------------------------------------------------------------------- /Indicators/Food-consumption-score/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Scripts 2 | This folder contains all standardized scripts for indicators, analysis and visualization. 3 | 4 | 5 | ## Food Consumption Score (FCS) 6 | - [Indicator Description on VAM Resource Center](https://resources.vam.wfp.org/data-analysis/quantitative/food-security/food-consumption-score-nutritional-quality-analysis) 7 | 8 | ## Main folder 9 | 10 | [Link to Sample Dataset](https://github.com/WFP-VAM/RAMResourcesScripts/blob/main/Static/FCS_Sample_Survey.csv) 11 | [Indicator Description on VAM Resource Center](https://resources.vam.wfp.org/data-analysis/quantitative/food-security/food-consumption-score) 12 | 13 | -------------------------------------------------------------------------------- /Indicators/Gender-CRF-C31/genC31.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | * define variable and value labels 3 | 4 | Variable labels HHAsstWFPRecCashYN1Y 'Did your household receive cash-based WFP assistance in the last 12 months?'. 5 | Variable labels HHAsstWFPRecCashYN1Y 'Did your household receive in-kind WFP assistance in the last 12 months?'. 6 | Variable labels HHAsstCashDescWho 'Who in your household decides what to do with the cash/voucher given by WFP, such as when, where and what to buy, is it women, men or both?'. 7 | Variable labels HHAsstInKindDescWho 'Who in your household decides what to do with the food given by WFP, such as when, where and what to buy, is it women, men or both?'. 8 | 9 | Value labels HHAsstWFPRecCashYN1Y HHAsstWFPRecCashYN1Y 1 'Yes' 0 'No'. 10 | Value labels HHAsstCashDescWho HHAsstInKindDescWho 10 'Men' 20 'Women' 30 'Both together'. 11 | 12 | 13 | 14 | * set n/a value to missing 15 | 16 | missing values HHAsstCashDescWho HHAsstInKindDescWho("n/a"). 17 | 18 | 19 | *Frequency of 2 questions to determine who makes decisions per type of assistance 20 | 21 | Freq HHAsstCashDescWho. 22 | 23 | Freq HHAsstInKindDescWho. 24 | -------------------------------------------------------------------------------- /Indicators/Gender-CRF-C31/genC31_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #import dataset 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/Gender_CRF_C31_Sample_Survey.csv") 7 | 8 | 9 | #assign variable and value labels 10 | var_label(data$HHAsstWFPRecCashYN1Y) <- "Did your household receive cash-based WFP assistance in the last 12 months?" 11 | var_label(data$HHAsstWFPRecInKindYN1Y) <- "Did your household receive in-kind WFP assistance in the last 12 months?" 12 | var_label(data$HHAsstCashDescWho) <- "Who in your household decides what to do with the cash/voucher given by WFP, such as when, where and what to buy, is it women, men or both?" 13 | var_label(data$HHAsstInKindDescWho) <- "Who in your household decides what to do with the food given by WFP, such as when, where and what to buy, is it women, men or both?" 14 | 15 | 16 | data <- data %>% 17 | mutate(across(c(HHAsstWFPRecCashYN1Y, HHAsstWFPRecInKindYN1Y), ~labelled(., labels = c( 18 | "No" = 0, 19 | "Yes" = 1 20 | )))) 21 | 22 | data <- data %>% 23 | mutate(across(c(HHAsstCashDescWho, HHAsstInKindDescWho), ~labelled(., labels = c( 24 | "Men" = "10", 25 | "Women" = "20", 26 | "Both together" = "30", 27 | "Not Applicable" = "n/a" 28 | )))) 29 | 30 | #decision making - cash 31 | HHAsstCashDescWho_table_wide <- data %>% 32 | filter(HHAsstCashDescWho != "n/a") %>% 33 | count(HHAsstCashDescWho_lab = as_factor(HHAsstCashDescWho)) %>% # if weights are needed use instead the row below 34 | #count(HHAsstCashDescWho_lab = as.character(HHAsstCashDescWho), wt = nameofweightvariable) 35 | mutate(Percentage = 100 * n / sum(n)) %>% 36 | ungroup() %>% select(-n) %>% 37 | pivot_wider(names_from = HHAsstCashDescWho_lab, 38 | values_from = Percentage, 39 | values_fill = 0) 40 | 41 | #decision making - inkind 42 | HHAsstInKindDescWho_table_wide <- data %>% 43 | filter(HHAsstInKindDescWho != "n/a") %>% 44 | count(HHAsstInKindDescWho_lab = as_factor(HHAsstInKindDescWho)) %>% # if weights are needed use instead the row below 45 | #count(HHAsstInKindDescWho_lab = as.character(HHAsstInKindDescWho), wt = nameofweightvariable) 46 | mutate(Percentage = 100 * n / sum(n)) %>% 47 | ungroup() %>% select(-n) %>% 48 | pivot_wider(names_from = HHAsstInKindDescWho_lab, 49 | values_from = Percentage, 50 | values_fill = 0) 51 | -------------------------------------------------------------------------------- /Indicators/Household-Dietary-Diversity-Score/Household-Dietary-Diversity-Score.sps: -------------------------------------------------------------------------------- 1 | *** -------------------------------------------------------------------------- 2 | 3 | ***    WFP RAM Standardized Scripts 4 | *** Calculating Household Dietary Diversity Score (HDDS) 5 | 6 | *** -------------------------------------------------------------------------- 7 | 8 | * Encoding: UTF-8. 9 | 10 | ***Create Household Dietary Diversity Score – 24hr recall from HDDS module *** 11 | **remember that you need 12 food groups to compute the HDDS, recall period is past 24 hours before the survey 12 | 13 | Variable labels 14 | HDDSStapCer Cereals consumption in the previous 24 hours 15 | HDDSStapRoot Roots and tubers consumption in the previous 24 hours 16 | HDDSVeg Vegetable consumption in the previous 24 hours 17 | HDDSFruit Fruit consumption in the previous 24 hours 18 | HDDSPrMeat Meat/poultry consumption in the previous 24 hours 19 | HDDSPrEggs Eggs consumption in the previous 24 hours 20 | HDDSPrFish Fish consumption in the previous 24 hours 21 | HDDSPulse Pulses/legumes consumption in the previous 24 hours 22 | HDDSDairy Milk and dairy product consumption in the previous 24 hours 23 | HDDSFat Oil/fats consumption in the previous 24 hours 24 | HDDSSugar Sugar/honey consumption in the previous 24 hours 25 | HDDSCond Miscellaneous/condiments consumption in the previous 24 hours. 26 | 27 | **Note that it is advised to use + instead of SUM() as cases with missing values should not be included in the calcuation. 28 | 29 | Compute HDDS = HDDSStapCer + HDDSStapRoot + HDDSVeg + HDDSFruit + HDDSPrMeat + HDDSPrEggs + HDDSPrFish + HDDSPulse + HDDSDairy + HDDSFat + HDDSSugar + HDDSCond. 30 | Variable labels HDDS 'Household Dietary Diversity Score'. 31 | EXECUTE. 32 | 33 | Recode HDDS (lowest thru 2=1) (3 thru 4=2) (5 thru highest = 3) into HDDSCat_IPC. 34 | Value labels HDDSCat_IPC 1 '0-2 food groups (phase 4 to 5)' 2 '3-4 food groups (phase 3)' 3 '5-12 food groups (phase 1 to 2)'. 35 | Variable labels HDDSCat_IPC 'HDDS categories using IPC severity scale'. 36 | EXECUTE. 37 | -------------------------------------------------------------------------------- /Indicators/Household-hunger-scale/Household-Hunger-Scale.sps: -------------------------------------------------------------------------------- 1 | Syntax for Calculating the Household Hunger Scale 2 | 3 | ***Create Household Hunger Scale*** 4 | 5 | **define variables 6 | 7 | Variable labels 8 | HHSNoFood ‘In the past [4 weeks/30 days], was there ever no food to eat of any kind in your house because of lack of resources to get food?’ 9 | HHSNoFood_FR ‘How often did this happen in the past [4 weeks/30 days]?’ 10 | HHSBedHung ‘In the past [4 weeks/30 days], did you or any household member go to sleep at night hungry because there was not enough food?’ 11 | HHSBedHung_FR ‘How often did this happen in the past [4 weeks/30 days]?’ 12 | HHSNotEat ‘In the past 4 weeks (30 days), did you or any household member go a whole day and night without eating anything because there was not enough food?’ 13 | HHSNotEat_FR ‘How often did this happen in the past [4 weeks/30 days]?’. 14 | 15 | 16 | ***define labels 17 | 18 | Value labels HHSNoFood HHSBedHung HHSNotEat 19 | 0 ‘No’ 20 | 1 ‘Yes’. 21 | 22 | Value labels HHSNoFood_FR HHSBedHung_FR HHSNotEat_FR 23 | 1 ‘Rarely (1–2 times)’ 24 | 2 ‘Sometimes (3–10 times)’ 25 | 3 ‘Often (more than 10 times)’. 26 | 27 | **Cleaning of HHS variables: make sure that is consistency between the filter and the frequency questions** 28 | 29 | * HHSNoFood and HHSNoFood_FR* 30 | 31 | Do if (HHSNoFood_FR >0). 32 | Compute HHSNoFood =1. 33 | ELSE. 34 | End if. 35 | EXECUTE. 36 | 37 | * HHSBedHung and HHSBedHung_FR* 38 | 39 | Do if (HHSBedHung_FR >0). 40 | Compute HHSBedHung =1. 41 | ELSE. 42 | End if. 43 | EXECUTE. 44 | 45 | * HHSNotEat and HHSNotEat_FR* 46 | 47 | Do if (HHSNotEat_FR>0). 48 | Compute HHSNotEat =1. 49 | ELSE. 50 | End if. 51 | EXECUTE. 52 | 53 | **Create a new variable for each frequency-of-occurrence question: the objective is to recode each frequency-of-occurrence question from three frequency categories (“rarely,” “sometimes,” “often”) into two frequency categories (“rarely or sometimes” and “often”)** 54 | 55 | RECODE HHSNoFood_FR HHSBedHung_FR HHSNotEat_FR (1=1) (2=1) (3=2) (ELSE=0) INTO HHSQ1 HHSQ2 HHSQ3. 56 | 57 | ***define variables 58 | 59 | 60 | 61 | Variable labels 62 | HHSQ1 'Was there ever no food to eat in HH?' 63 | HHSQ2 'Did any HH member go sleep hungry?' 64 | HHSQ3 'Did any HH member go whole day without food?'. 65 | EXECUTE. 66 | 67 | 68 | **The values of HHSQ1, HHSQ2, and HHSQ3 are summed for each household to calculate the HHS score** 69 | 70 | COMPUTE HHS=HHSQ1 + HHSQ2 + HHSQ3. 71 | 72 | Variable labels HHS 'Household Hunger Score'. 73 | EXECUTE. 74 | 75 | **Each household should have an HHS score between 0 and 6. These values are then used to generate the HHS indicators** 76 | 77 | FREQUENCIES VARIABLES=HHS 78 | /STATISTICS=MEAN MEDIAN MINIMUM MAXIMUM 79 | /ORDER=ANALYSIS. 80 | 81 | **To tabulate the categorical HHS indicator, two different cutoff values (> 1 and > 3) are applied to the HHS scores that were generated in Step 3 above** 82 | 83 | RECODE HHS (0 thru 1=1) (2 thru 3=2) (4 thru Highest=3) INTO HHSCat. 84 | variable labels HHSCat 'Household Hunger Score Categories'. 85 | EXECUTE. 86 | 87 | 88 | 89 | ***define labels 90 | 91 | Value labels HHSCat 92 | 93 | 1 `No or little hunger in the household` 94 | 2 `Moderate hunger in the household` 95 | 3 `Severe hunger in the household`. 96 | 97 | 98 | **Note: to tabulate the categorical HHS indicator for the IPC, using the four IPC cutoff values (0, 1, 2-3, 4 and 5+) are applied to the HHS scores that were generated in Step 3 above** 99 | 100 | RECODE HHSr (0=0) (1=1) (2 thru 3=2) (4=3) (5 thru Highest=4) INTO HHSCatr. 101 | variable labels HHSCatr 'Household Hunger Score Categories'. 102 | EXECUTE. 103 | 104 | 105 | ***define labels 106 | 107 | Value labels HHSCat_IPC 108 | 0 No hunger in the household 109 | 1 little hunger in the household stress 110 | 2 Moderate hunger in the household crisis 111 | 3 Severe hunger in the household emergency 112 | 4 Very severe hunger in the household catastrophe. 113 | 114 | FREQUENCIES HHSCat_IPC. 115 | 116 | *****END***** 117 | -------------------------------------------------------------------------------- /Indicators/Household-hunger-scale/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WFP-VAM/RAMResourcesScripts/353e1b7ef4637c4a4db8079019ad8228bab4c9d1/Indicators/Household-hunger-scale/README.md -------------------------------------------------------------------------------- /Indicators/Livelihood-Coping-Strategies-FS/LCS-FS-indicator.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #add sample data 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/LCS_Sample_Survey/LHCS_FS_Sample_Survey.csv") 7 | 8 | #assign variable and value labels 9 | #variable labels 10 | var_label(data$Lcs_stress_DomAsset) <- "Sold household assets/goods (radio, furniture, refrigerator, television, jewellery etc.) due to lack of food" 11 | var_label(data$Lcs_stress_Saving) <- "Spent savings due to lack of food" 12 | var_label(data$Lcs_stress_EatOut) <- "Sent household members to eat elsewhere/live with family or friends due to lack of food" 13 | var_label(data$Lcs_stress_CrdtFood) <- "Purchased food/non-food on credit (incur debts) due to lack of food" 14 | var_label(data$Lcs_crisis_ProdAssets) <- "Sold productive assets or means of transport (sewing machine, wheelbarrow, bicycle, car, etc.) due to lack of food" 15 | var_label(data$Lcs_crisis_Health) <- "Reduced expenses on health (including drugs)" 16 | var_label(data$Lcs_crisis_OutSchool) <- "Withdrew children from school due to lack of food" 17 | var_label(data$Lcs_em_ResAsset) <- "Mortgaged/Sold house or land due to lack of food" 18 | var_label(data$Lcs_em_Begged) <- "Begged and/or scavenged (asked strangers for money/food) due to lack of food" 19 | var_label(data$Lcs_em_IllegalAct) <- "Engaged in illegal income activities (theft, prostitution) due to lack of food" 20 | #value labels 21 | data <- data %>% 22 | mutate(across(c(Lcs_stress_DomAsset,Lcs_stress_Saving,Lcs_stress_EatOut,Lcs_stress_CrdtFood,Lcs_crisis_ProdAssets,Lcs_crisis_Health,Lcs_crisis_OutSchool,Lcs_em_ResAsset,Lcs_em_Begged,Lcs_em_IllegalAct), ~labelled(., labels = c( 23 | "No, because I did not need to" = 10, 24 | "No, because I already sold those assets or have engaged in this activity within the last 12 months and cannot continue to do it" = 20, 25 | "Yes" = 30, 26 | "Not applicable (don’t have access to this strategy)" = 9999 27 | )))) 28 | 29 | #create a variable to specify if the household used any of the strategies by severity 30 | #stress 31 | data <- data %>% mutate(stress_coping_FS = case_when( 32 | Lcs_stress_DomAsset == 20 | Lcs_stress_DomAsset == 30 ~ 1, 33 | Lcs_stress_Saving == 20 | Lcs_stress_Saving == 30 ~ 1, 34 | Lcs_stress_EatOut == 20 | Lcs_stress_EatOut == 30 ~ 1, 35 | Lcs_stress_CrdtFood == 20 | Lcs_stress_CrdtFood == 30 ~1, 36 | TRUE ~ 0)) 37 | var_label(data$stress_coping_FS) <- "Did the HH engage in stress coping strategies" 38 | #Crisis 39 | data <- data %>% mutate(crisis_coping_FS = case_when( 40 | Lcs_crisis_ProdAssets == 20 | Lcs_crisis_ProdAssets == 30 ~ 1, 41 | Lcs_crisis_Health == 20 | Lcs_crisis_Health == 30 ~ 1, 42 | Lcs_crisis_OutSchool == 20 | Lcs_crisis_OutSchool == 30 ~ 1, 43 | TRUE ~ 0)) 44 | var_label(data$crisis_coping_FS) <- "Did the HH engage in crisis coping strategies" 45 | #Emergency 46 | data <- data %>% mutate(emergency_coping_FS = case_when( 47 | Lcs_em_ResAsset == 20 | Lcs_em_ResAsset == 30 ~ 1, 48 | Lcs_em_Begged == 20 | Lcs_em_Begged == 30 ~ 1, 49 | Lcs_em_IllegalAct == 20 | Lcs_em_IllegalAct == 30 ~ 1, 50 | TRUE ~ 0)) 51 | var_label(data$emergency_coping_FS) <- "Did the HH engage in emergency coping strategies" 52 | 53 | #calculate Max_coping_behaviour 54 | data <- data %>% mutate(Max_coping_behaviourFS = case_when( 55 | emergency_coping_FS == 1 ~ 4, 56 | crisis_coping_FS == 1 ~ 3, 57 | stress_coping_FS == 1 ~ 2, 58 | TRUE ~ 1)) 59 | var_label(data$Max_coping_behaviourFS) <- "Summary of asset depletion" 60 | val_lab(data$Max_coping_behaviourFS) = num_lab(" 61 | 1 HH not adopting coping strategies 62 | 2 Stress coping strategies 63 | 3 Crisis coping strategies 64 | 4 Emergencies coping strategies 65 | ") 66 | 67 | 68 | #creates a table of the weighted percentage of Max_coping_behaviourFS by 69 | #creating a temporary variable to display value labels 70 | #and providing the option to use weights if needed 71 | 72 | 73 | Max_coping_behaviourFS_table_wide <- data %>% 74 | drop_na(Max_coping_behaviourFS) %>% 75 | count(Max_coping_behaviourFS_lab = as.character(Max_coping_behaviourFS)) %>% # if weights are needed use instead the row below 76 | #count(Max_coping_behaviourFS_lab = as.character(Max_coping_behaviourFS), wt = nameofweightvariable) 77 | mutate(Percentage = 100 * n / sum(n)) %>% 78 | ungroup() %>% select(-n) %>% 79 | pivot_wider(names_from = Max_coping_behaviourFS_lab, 80 | values_from = Percentage, 81 | values_fill = 0) 82 | -------------------------------------------------------------------------------- /Indicators/Multidimensional-deprivation-index/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Scripts 2 | This folder contains all standardized scripts for indicators, analysis and visualization. 3 | ## Main folder -------------------------------------------------------------------------------- /Indicators/Nutrition-CRF-7-coverage/nut7_coverage.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | *can only download repeat csv data as zip file from moda with group names - will update this code to remove group names 4 | *rename to remove group names - because of the variable length SPSS changes name slightly 5 | 6 | RENAME VARIABLES (Nutrition_moduleNutProg_submoduleRepeatNutProgPNutProgPartic = PNutProgPartic_yn). 7 | 8 | * define variable and value labels 9 | 10 | Variable labels PNutProgPartic_yn ‘Is participant enrolled in the ((insert name/description of program, to be adapted locally)) programme?’. 11 | 12 | Value labels PNutProgPartic_ynNutProgPartic_yn 1 'Yes' 0 'No '. 13 | 14 | freq PNutProgPartic_yn. 15 | 16 | -------------------------------------------------------------------------------- /Indicators/Nutrition-CRF-7-coverage/nut7_coverage_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #add sample data 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/Nut_CRF_7_coverage_Sample_Survey/Nutrition_module_NutProg_submodule_RepeatNutProg.csv") 7 | 8 | #can only download repeat csv data as zip file from moda with group names - will update this code to remove group names 9 | #rename to remove group names 10 | data <- data %>% rename(PNutProgPartic_yn = 'Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgPartic_yn') 11 | 12 | 13 | #assign variable and value labels 14 | var_label(data$PNutProgPartic_yn) <- "Is participant enrolled in the ((insert name/description of program, to be adapted locally)) programme?" 15 | val_lab(data$PNutProgPartic_yn) = num_lab(" 16 | 0 No 17 | 1 Yes 18 | ") 19 | 20 | 21 | #creates a table of the weighted percentage of NutProgPartic_yn by 22 | #creating a temporary variable to display value labels 23 | #and providing the option to use weights if needed 24 | 25 | 26 | NutProgPartic_yn_table_wide <- data %>% 27 | drop_na(PNutProgPartic_yn) %>% 28 | count(PNutProgPartic_yn_lab = as.character(PNutProgPartic_yn)) %>% # if weights are needed use instead the row below 29 | #count(PNutProgPartic_yn_lab = as.character(PNutProgPartic_yn), wt = nameofweightvariable) 30 | mutate(Percentage = 100 * n / sum(n)) %>% 31 | ungroup() %>% select(-n) %>% 32 | pivot_wider(names_from = PNutProgPartic_yn_lab, 33 | values_from = Percentage, 34 | values_fill = 0) -------------------------------------------------------------------------------- /Indicators/Nutrition-CRF-8-adherence/nut8_adherence.do: -------------------------------------------------------------------------------- 1 | *add sample data 2 | import delimited using "../../Static/Nut_CRF_8_adherence_Sample_Survey/Nutrition_module_NutProg_submodule_RepeatNutProg.csv" 3 | 4 | 5 | rename (v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13) (PNutProgParticName PNutProgCard PNutProgShouldNbrCard PNutProgDidNbrCard PNutwhendate PNutProgShouldNbrNoCard PNutProgDidNbrNoCard PNutProgEntitlements PNoNutProgReason PNoNutProgReason_other PNoNutProgCardReason PNoNutProgCardReason_other) 6 | *#assign variable labels 7 | 8 | label var PNutProgCard "May I see participant's program participation card?" 9 | label var PNutProgShouldNbrCard "number of distributions entitled to - measured with participation card" 10 | label var PNutProgDidNbrCard "number of distributions received - measured with participation card" 11 | label var PNutProgShouldNbrNoCard "number of distributions entitled to - measured without participation card" 12 | label var PNutProgDidNbrNoCard "number of distributions received - measured without participation card" 13 | label define Yesno 1 "Yes" 0 "No" 14 | 15 | *#create variable which classifies if participant received 66% or more of planned distributions 16 | gen NutProgRecAdequate=cond((PNutProgCard == 1 & ((PNutProgDidNbrCard / PNutProgShouldNbrCard) >= .66) == 1) | /// 17 | (PNutProgCard == 0 & ((PNutProgDidNbrNoCard / PNutProgShouldNbrNoCard) >= .66) == 1),1,0) 18 | label var NutProgRecAdequate "Participant recieved adequate number of distributions?" 19 | 20 | 21 | label values PNutProgCard NutProgRecAdequate Yesno 22 | 23 | /* 24 | #creates a table of the weighted percentage of NutProgRecAdequate by 25 | #creating a temporary variable to display value labels 26 | #and providing the option to use weights if needed 27 | */ 28 | cap gen WeightHH=1 29 | tabulate NutProgRecAdequate [aw=WeightHH] 30 | -------------------------------------------------------------------------------- /Indicators/Nutrition-CRF-8-adherence/nut8_adherence.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | *can only download repeat csv data as zip file from moda with group names - will update this code to remove group names 4 | *rename to remove group names - because of the variable length SPSS truncates name 5 | 6 | RENAME VARIABLES (Nutrition_moduleNutProg_submoduleRepeatNutProgPNutProgCard = PNutProgCard). 7 | RENAME VARIABLES (Nutrition_moduleNutProg_submoduleRepeatNutProgPNutProgShouldN_A = PNutProgShouldNbrCard). 8 | RENAME VARIABLES (Nutrition_moduleNutProg_submoduleRepeatNutProgPNutProgDidNbrC = PNutProgDidNbrCard). 9 | RENAME VARIABLES (Nutrition_moduleNutProg_submoduleRepeatNutProgPNutProgShouldN = PNutProgShouldNbrNoCard). 10 | RENAME VARIABLES (Nutrition_moduleNutProg_submoduleRepeatNutProgPNutProgDidNbrN = PNutProgDidNbrNoCard). 11 | 12 | * define variable and value labels 13 | 14 | Variable labels PNutProgCard "May I see participant's program participation card?". 15 | Variable labels PNutProgShouldNbrCard 'number of distributions entitled to - measured with participation card'. 16 | Variable labels PNutProgDidNbrCard 'number of distributions received - measured with participation card'. 17 | Variable labels PNutProgShouldNbrNoCard 'number of distributions entitled to - measured without participation card'. 18 | Variable labels PNutProgDidNbrNoCard 'number of distributions received - measured without participation card'. 19 | 20 | Value labels PNutProgCard 1 'Yes' 0 'No '. 21 | 22 | *create variable which classifies if participant received 66% or more of planned distributions 23 | 24 | do if ((PNutProgCard = 1) & ((PNutProgDidNbrCard / PNutProgShouldNbrCard) >= .66)) OR ((PNutProgCard = 0) & ((PNutProgDidNbrNoCard / PNutProgShouldNbrNoCard) >= .66)) . 25 | compute NutProgRecAdequate = 1. 26 | Else. 27 | Compute NutProgRecAdequate = 0. 28 | End if. 29 | 30 | Variable labels PNutProgDidNbrNoCard "Participant recieved adequate number of distributions?". 31 | Value labels NutProgRecAdequate 1 'Yes' 0 'No '. 32 | 33 | freq NutProgRecAdequate. 34 | 35 | -------------------------------------------------------------------------------- /Indicators/Nutrition-CRF-8-adherence/nut8_adherence_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #add sample data 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/Nut_CRF_8_adherence_Sample_Survey/Nutrition_module_NutProg_submodule_RepeatNutProg.csv") 7 | 8 | #can only download repeat csv data as zip file from moda with group names - will update this code to remove group names 9 | #rename to remove group names 10 | data <- data %>% rename(PNutProgCard = 'Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgCard', 11 | PNutProgShouldNbrCard = 'Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgShouldNbrCard', 12 | PNutProgDidNbrCard = 'Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgDidNbrCard', 13 | PNutProgShouldNbrNoCard = 'Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgShouldNbrNoCard', 14 | PNutProgDidNbrNoCard = 'Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgDidNbrNoCard' 15 | ) 16 | 17 | #assign variable labels 18 | var_label(data$PNutProgCard) <- "May I see participant's program participation card?" 19 | var_label(data$PNutProgShouldNbrCard) <- "number of distributions entitled to - measured with participation card" 20 | var_label(data$PNutProgDidNbrCard) <- "number of distributions received - measured with participation card" 21 | var_label(data$PNutProgShouldNbrNoCard) <- "number of distributions entitled to - measured without participation card" 22 | var_label(data$PNutProgDidNbrNoCard) <- "number of distributions received - measured without participation card" 23 | 24 | val_lab(data$PNutProgCard) = num_lab(" 25 | 0 No 26 | 1 Yes 27 | ") 28 | 29 | #create variable which classifies if participant received 66% or more of planned distributions 30 | data <- data %>% mutate(NutProgRecAdequate = case_when( 31 | PNutProgCard == 1 & ((PNutProgDidNbrCard / PNutProgShouldNbrCard) >= .66) ~ 1, 32 | PNutProgCard == 0 & ((PNutProgDidNbrNoCard / PNutProgShouldNbrNoCard) >= .66) ~ 1, 33 | TRUE ~ 0 34 | )) 35 | var_label(data$NutProgRecAdequate) <- "Participant recieved adequate number of distributions?" 36 | val_lab(data$NutProgRecAdequate) = num_lab(" 37 | 0 No 38 | 1 Yes 39 | ") 40 | 41 | #creates a table of the weighted percentage of NutProgRecAdequate by 42 | #creating a temporary variable to display value labels 43 | #and providing the option to use weights if needed 44 | 45 | NutProgRecAdequate_table_wide <- data %>% 46 | drop_na(NutProgRecAdequate) %>% 47 | count(NutProgRecAdequate_lab = as.character(NutProgRecAdequate)) %>% # if weights are needed use instead the row below 48 | #count(NutProgRecAdequate_lab = as.character(NutProgRecAdequate), wt = nameofweightvariable) 49 | mutate(Percentage = 100 * n / sum(n)) %>% 50 | ungroup() %>% select(-n) %>% 51 | pivot_wider(names_from = NutProgRecAdequate_lab, 52 | values_from = Percentage, 53 | values_fill = 0) -------------------------------------------------------------------------------- /Indicators/Nutrition-MDDW/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Scripts 2 | This folder contains all standardized scripts for indicators, analysis and visualization. 3 | 4 | 5 | ## Minimum diet diversity for women and girls of reproductive age (MDDW) 6 | 7 | [Sample Data](https://github.com/WFP-VAM/RAMResourcesScripts/tree/main/Static/Nut_MDDW_Sample_Survey) 8 | [Indicator Description on VAM Resource Center](https://resources.vam.wfp.org/data-analysis/quantitative/nutrition/minimum-dietary-diversity-for-women-mdd-w) 9 | 10 | -------------------------------------------------------------------------------- /Indicators/Nutrition-MDDW/nutMDDW.do: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | * Minimum Dietary Diversity for Women (MDDW) 3 | *******************************************************************************/ 4 | 5 | ** Load data 6 | * --------- 7 | import delim using "../Nutrition_module_MDD_W_submodule_RepeatMDDW.csv", /// 8 | clear case(preserve) 9 | 10 | ** rename varuavke to remove group names 11 | ren Nutrition_moduleMDD_W_submoduleRepeatMDDW* * 12 | 13 | ** check and recode missing values as 0 14 | sum PWMDDW* 15 | recode PWMDDW* (. = 0) 16 | 17 | ** assign variable and value labels 18 | label def yesno 1 "Yes" 0 "No" 19 | label val PWMDDW* yesno 20 | 21 | label var PWMDDWStapCer "Foods made from grains" 22 | label var PWMDDWStapRoo "White roots and tubers or plantains" 23 | label var PWMDDWPulse "Pulses (beans, peas and lentils)" 24 | label var PWMDDWNuts "Nuts and seeds" 25 | label var PWMDDWMilk "Milk" 26 | label var PWMDDWDairy "Milk products" 27 | label var PWMDDWPrMeatO "Organ meats" 28 | label var PWMDDWPrMeatF "Red flesh meat from mammals" 29 | label var PWMDDWPrMeatPro "Processed meat" 30 | label var PWMDDWPrMeatWhite "Poultry and other white meats" 31 | label var PWMDDWPrFish "Fish and Seafood" 32 | label var PWMDDWPrEgg "Eggs from poultry or any other bird" 33 | label var PWMDDWVegGre "Dark green leafy vegetable" 34 | label var PWMDDWVegOrg "Vitamin A-rich vegetables, roots and tubers" 35 | label var PWMDDWFruitOrg "Vitamin A-rich fruits" 36 | label var PWMDDWVegOth "Other vegetables" 37 | label var PWMDDWFruitOth "Other fruits" 38 | label var PWMDDWSnf "Specialized Nutritious Foods (SNF) for women" 39 | label var PWMDDWFortFoodoil "Fortified oil" 40 | label var PWMDDWFortFoodwflour "Fortified wheat flour" 41 | label var PWMDDWFortFoodmflour "Fortified maize flour" 42 | label var PWMDDWFortFoodrice "Fortified Rice" 43 | label var PWMDDWFortFooddrink "Fortified drink" 44 | label var PWMDDWFortFoodother "Other:" 45 | label var PWMDDWFortFoodother_oth "Other specify: ______" 46 | 47 | 48 | /* Calculate 2 MDDW indicators based on WFP guidelines 49 | https://docs.wfp.org/api/documents/WFP-0000140197/download/ Page.8 50 | 51 | 1. Standard MDDW Indicator for population based surveys counts SNF in home 52 | group (refer to https://docs.wfp.org/api/documents/WFP-0000139484/download/ 53 | for "home group") 54 | 2. WFP Modified MDDW WFP programme monitoring counts SNF in "Meat, poultry 55 | and fish" Category 56 | */ 57 | 58 | **************************** Standard MDDW method ****************************** 59 | 60 | /* In this example SNF home group will be grains; fortified foods 61 | (PWMDDWFortFoodwflour, PWMDDWFortFoodmflour, PWMDDWFortFoodrice, 62 | PWMDDWFortFooddrink) will also count in grains. Classifying 63 | PWMDDWFortFoodother_oth will likely involve classifying line by line. */ 64 | 65 | gen MDDW_Staples = (PWMDDWStapCer == 1 | PWMDDWStapRoo == 1 | PWMDDWSnf == 1 | /// 66 | PWMDDWFortFoodwflour == 1 | PWMDDWFortFoodmflour == 1 | /// 67 | PWMDDWFortFoodrice == 1 | PWMDDWFortFooddrink == 1) 68 | gen MDDW_Pulses = (PWMDDWPulse == 1) 69 | gen MDDW_NutsSeeds = (PWMDDWNutsR == 1) 70 | gen MDDW_Dairy = (PWMDDWDairy == 1 | PWMDDWMilk == 1) 71 | gen MDDW_MeatFish = (PWMDDWPrMeatO == 1 | PWMDDWPrMeatF == 1 | PWMDDWPrMeatPro == 1 | /// 72 | PWMDDWPrMeatWhite == 1 | PWMDDWPrFish == 1) 73 | gen MDDW_Eggs = (PWMDDWPrEgg == 1) 74 | gen MDDW_LeafGVeg = (PWMDDWVegGre == 1) 75 | gen MDDW_VitA = (PWMDDWVegOrg == 1 | PWMDDWFruitOrg == 1) 76 | gen MDDW_OtherVeg = (PWMDDWVegOth == 1) 77 | gen MDDW_OtherFruits = (PWMDDWFruitOth == 1) 78 | 79 | * calculate MDDW variable for both methods by adding together food groups and 80 | * classifying whether the woman consumed 5 or more food groups 81 | gen MDDW = MDDW_Staples + MDDW_Pulses + MDDW_NutsSeeds + MDDW_Dairies + MDDW_MeatFish + /// 82 | MDDW_Eggs + MDDW_LeafGVeg + MDDW_VitA + MDDW_OtherVeg + MDDW_OtherFruits 83 | gen MDDW_5 = (MDDW >= 5) 84 | 85 | tab MDDW_5, d 86 | 87 | *********************** WFP MDDW method for program monitoring ***************** 88 | 89 | /* In this example SNF will count in the meats group; fortified foods 90 | (PWMDDWFortFoodwflour, PWMDDWFortFoodmflour, PWMDDWFortFoodrice, 91 | PWMDDWFortFooddrink) will count in grains. Classifying 92 | PWMDDWFortFoodother_oth will likely involve classifying line by line. */ 93 | 94 | gen MDDW_Staples_wfp = (PWMDDWStapCer == 1 | PWMDDWStapRoo == 1 | /// 95 | PWMDDWFortFoodwflour == 1 | PWMDDWFortFoodmflour == 1 | /// 96 | PWMDDWFortFoodrice == 1 | PWMDDWFortFooddrink == 1) 97 | gen MDDW_Pulses_wfp = (PWMDDWPulse == 1) 98 | gen MDDW_NutsSeeds_wfp = (PWMDDWNutsR == 1) 99 | gen MDDW_Dairy_wfp = (PWMDDWDairy == 1 | PWMDDWMilk == 1) 100 | gen MDDW_MeatFish_wfp = (PWMDDWPrMeatO == 1 | PWMDDWPrMeatF == 1 | PWMDDWPrMeatPro == 1 | /// 101 | PWMDDWPrMeatWhite == 1 | PWMDDWPrFish == 1 | PWMDDWSnf == 1) 102 | gen MDDW_Eggs_wfp = (PWMDDWPrEgg == 1) 103 | gen MDDW_LeafGVeg_wfp = (PWMDDWVegGre == 1) 104 | gen MDDW_VitA_wfp = (PWMDDWVegOrg == 1 | PWMDDWFruitOrg == 1) 105 | gen MDDW_OtherVeg_wfp = (PWMDDWVegOth == 1) 106 | gen MDDW_OtherFruits_wfp = (PWMDDWFruitOth == 1) 107 | 108 | gen MDDW_wfp = MDDW_Staples_wfp + MDDW_Pulses_wfp + MDDW_NutsSeeds_wfp + MDDW_Dairies_wfp + /// 109 | MDDW_MeatFish_wfp + MDDW_Eggs_wfp + MDDW_LeafGVeg_wfp + MDDW_VitA_wfp + /// 110 | MDDW_OtherVeg_wfp + MDDW_OtherFruits_wfp 111 | gen MDDW_5_wfp = (MDDW_wfp >= 5) 112 | 113 | tab MDDW_5_wfp, d 114 | 115 | * End of dofile 116 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC1-1/pro-CC-1-1.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | * define variable and value labels 4 | 5 | Variable labels HHAsstSecurity ‘Have you or any of your household members experienced any security challenge related to WFP assistance?’. 6 | 7 | Value labels HHAsstSecurity 1 'Yes' 0 'No '. 8 | 9 | freq HHAsstSecurity. 10 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC1-1/pro-CC-1-1_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(expss) 3 | library(labelled) 4 | 5 | #add sample data 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/PROP_AAP_CRF_Sample_Survey.csv") 7 | 8 | #assign variable and value labels 9 | var_label(data$HHAsstSecurity) <- "Have you or any of your household members experienced any security challenge related to WFP assistance?" 10 | val_lab(data$HHAsstSecurity) = num_lab(" 11 | 0 No 12 | 1 Yes 13 | 888 Don't know 14 | ") 15 | 16 | 17 | #creates a table of the weighted percentage of HHAsstSecurity by 18 | #creating a temporary variable to display value labels 19 | #and providing the option to use weights if needed 20 | 21 | 22 | HHAsstSecurity_table_wide <- data %>% 23 | drop_na(HHAsstSecurity) %>% 24 | count(HHAsstSecurity_lab = as.character(HHAsstSecurity)) %>% # if weights are needed use instead the row below 25 | #count(HHAsstSecurity_lab = as.character(HHAsstSecurity), wt = nameofweightvariable) 26 | mutate(Percentage = 100 * n / sum(n)) %>% 27 | ungroup() %>% select(-n) %>% 28 | pivot_wider(names_from = HHAsstSecurity_lab, 29 | values_from = Percentage, 30 | values_fill = 0) 31 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC1-2/pro-CC-1-2.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | Variable labels HHAsstAccess ‘Have you or any member of your household been unable to access WFP assistance one or more times?’. 4 | 5 | Value labels HHAsstAccess 1 'Yes' 0 'No ' 888 "Don't know". 6 | 7 | freq HHAsstAccess. 8 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC1-2/pro-CC-1-2_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(expss) 3 | library(labelled) 4 | 5 | #add sample data 6 | data <- read_csv("Static/PROP_AAP_CRF_Sample_Survey.csv") 7 | 8 | #assign variable and value labels 9 | var_label(data$HHAsstAccess) <- "Have you or any member of your household been unable to access WFP assistance one or more times?" 10 | val_lab(data$HHAsstAccess) = num_lab(" 11 | 0 No 12 | 1 Yes 13 | 888 Don't know 14 | ") 15 | 16 | 17 | #creates a table of the weighted percentage of HHAsstAccess by 18 | #creating a temporary variable to display value labels 19 | #and providing the option to use weights if needed 20 | 21 | 22 | HHAsstAccess_table_wide <- data %>% 23 | drop_na(HHAsstAccess) %>% 24 | count(HHAsstAccess_lab = as.character(HHAsstAccess)) %>% # if weights are needed use instead the row below 25 | #count(HHAsstAccess_lab = as.character(HHAsstAccess), wt = nameofweightvariable) 26 | mutate(Percentage = 100 * n / sum(n)) %>% 27 | ungroup() %>% select(-n) %>% 28 | pivot_wider(names_from = HHAsstAccess_lab, 29 | values_from = Percentage, 30 | values_fill = 0) 31 | 32 | 33 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC1-3/pro-CC-1-3.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | Variable labels HHAsstRespect ‘Do you think WFPandor partner staff have treated you and members of your household respectfully? ’. 4 | 5 | Variable labels HHDTPDign ‘Do you think the conditions of WFP programme sites are dignified?’. 6 | 7 | Value labels HHAsstRespect HHDTPDign 1 'Yes' 0 'No'. 8 | 9 | * cross tab first to see how many are "Yes" in both questions 10 | 11 | CROSSTABS 12 | /TABLES=HHAsstRespect BY HHDTPDign 13 | /FORMAT=AVALUE TABLES 14 | /CELLS=COUNT 15 | /COUNT ROUND CELL. 16 | 17 | 18 | do if (HHAsstRespect = 1) & (HHDTPDign = 1). 19 | compute HHAsstRespectDign = 1. 20 | Else. 21 | Compute HHAsstRespectDign = 0. 22 | End if. 23 | 24 | variable labels HHAsstRespectDign "Treated with respect while engaging in WFP programs". 25 | value labels HHAsstRespectDign 26 | 0 "No" 27 | 1 "Yes". 28 | 29 | freq HHAsstRespectDign. 30 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC1-3/pro-CC1-3_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #add sample data 6 | data <- read_csv("Static/PROP_AAP_CRF_Sample_Survey.csv") 7 | 8 | #assign variable and value labels 9 | var_label(data$HHAsstRespect) <- "Do you think WFPandor partner staff have treated you and members of your household respectfully?" 10 | var_label(data$HHDTPDign) <- "Do you think the conditions of WFP programme sites are dignified?" 11 | 12 | data <- data %>% 13 | mutate(across(c(HHAsstRespect, HHDTPDign), ~labelled(., labels = c( 14 | "No" = 0, 15 | "Yes" = 1 16 | )))) 17 | 18 | #calculate indicator and assign variable label & name 19 | data <- data %>% mutate(HHAsstRespectDign = case_when( 20 | HHAsstRespect == 1 & HHDTPDign == 1 ~ 1, 21 | TRUE ~ 0 22 | )) 23 | var_label(data$HHAsstRespectDign) <- "Treated with respect while engaging in WFP programs" 24 | val_lab(data$HHAsstRespectDign) = num_lab(" 25 | 0 No 26 | 1 Yes 27 | ") 28 | 29 | 30 | #creates a table of the weighted percentage of HHAsstRespectDign by 31 | #creating a temporary variable to display value labels 32 | #and providing the option to use weights if needed 33 | 34 | 35 | HHAsstRespectDign_table_wide <- data %>% 36 | drop_na(HHAsstRespectDign) %>% 37 | count(HHAsstRespectDign_lab = as.character(HHAsstRespectDign)) %>% # if weights are needed use instead the row below 38 | #count(HHAsstRespectDign_lab = as.character(HHAsstRespectDign), wt = nameofweightvariable) 39 | mutate(Percentage = 100 * n / sum(n)) %>% 40 | ungroup() %>% select(-n) %>% 41 | pivot_wider(names_from = HHAsstRespectDign_lab, 42 | values_from = Percentage, 43 | values_fill = 0) 44 | 45 | 46 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC1-4/pro-CC-1-4_hoh.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | *assign variable and value labels 4 | 5 | Variable Labels HHAsstWFPRecCashYN1Y "Did your household receive cash-based WFP assistance in the last 12 months?". 6 | Variable Labels HHAsstWFPRecInKindYN1Y "Did your household receive in-kind WFP assistance in the last 12 months?". 7 | Variable Labels HHAsstWFPRecCapBuildYN1Y "Did you household receive WFP capacity building assistance in the last 12 months?". 8 | 9 | Variable Labels HHHSex "What is the sex of the head of the household?". 10 | Variable Labels HHHAge "Age of the head of the household". 11 | 12 | Variable Labels HHHDisabSee "Does the head of household have difficulty seeing, even if wearing glasses? Would you say…". 13 | Variable Labels HHHDisabHear "Does the head of household have difficulty hearing, even if using a hearing aid(s)? Would you say…". 14 | Variable Labels HHHDisabWalk "Does the head of household have difficulty remembering or concentrating? Would you say…". 15 | Variable Labels HHHDisabRemember "Does the head of household have difficulty remembering or concentrating? Would you say…". 16 | Variable Labels HHHDisabUnderstand "Using his or her usual language, does the head of household have difficulty communicating, for example understanding or being understood? Would you say…". 17 | Variable Labels HHHDisabWash "Does the head of household have difficulty with self-care, such as washing all over or dressing? Would you say…". 18 | 19 | 20 | Value labels HHAsstWFPRecCashYN1Y HHAsstWFPRecInKindYN1Y HHAsstWFPRecCapBuildYN1Y 0 'No' 1 'Yes'. 21 | Value labels HHHSex 0 'Female' 1 'Male'. 22 | Value labels HHHDisabSee HHHDisabHear HHHDisabWalk HHHDisabRemember HHHDisabUnderstand HHHDisabWash 1 'No difficulty' 2 'Some difficulty' 3 'A lot of difficulty' 4 'Cannot do at all' 888 "Don't know" 999 'Refuse'. 23 | 24 | 25 | *calculate whether the respondent had "A lot of difficulty" or "Cannot do at all" for any of the 6 questions. 26 | 27 | Compute HHHDisabCat3 = 0. 28 | if HHHDisabSee = 3 | HHHDisabSee = 4 | HHHDisabHear = 3 | HHHDisabHear = 4 | HHHDisabWalk = 3 | HHHDisabWalk = 4 | HHHDisabRemember = 3 | HHHDisabRemember = 4 | HHHDisabUnderstand = 3 | HHHDisabUnderstand = 4 | 29 | HHHDisabWash = 3 | HHHDisabWash = 4 HHHDisabCat3 = 1. 30 | 31 | Value labels HHHDisabCat3 0 "without disability (category 3 criteria)" 1 "with disability (category 3 criteria)". 32 | 33 | 34 | *creates a table of the percentage of type of assistance recieve by PDisabCat3 35 | 36 | 37 | *cash 38 | 39 | CROSSTABS 40 | /TABLES=HHAsstWFPRecCashYN1Y BY HHHDisabCat3 41 | /FORMAT=AVALUE TABLES 42 | /CELLS=COLUMN 43 | /COUNT ROUND CELL. 44 | 45 | *inkind 46 | 47 | CROSSTABS 48 | /TABLES=HHAsstWFPRecInKindYN1Y BY HHHDisabCat3 49 | /FORMAT=AVALUE TABLES 50 | /CELLS=COLUMN 51 | /COUNT ROUND CELL. 52 | 53 | *capacity building 54 | 55 | CROSSTABS 56 | /TABLES=HHAsstWFPRecCapBuildYN1Y BY HHHDisabCat3 57 | /FORMAT=AVALUE TABLES 58 | /CELLS=COLUMN 59 | /COUNT ROUND CELL. 60 | 61 | 62 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC1-4/pro-CC-1-4_roster.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | * import dataset 1 4 | 5 | PRESERVE. 6 | SET DECIMAL DOT. 7 | 8 | GET DATA /TYPE=TXT 9 | /FILE="C:\Users\b\Desktop\demo\RosterMethod\data.csv" 10 | /ENCODING='UTF8' 11 | /DELCASE=LINE 12 | /DELIMITERS="," 13 | /ARRANGEMENT=DELIMITED 14 | /FIRSTCASE=2 15 | /DATATYPEMIN PERCENTAGE=95.0 16 | /VARIABLES= 17 | TechnicalAdd_submoduleHHAsstWFPRecCashYN1Y AUTO 18 | TechnicalAdd_submoduleHHAsstWFPRecInKindYN1Y AUTO 19 | TechnicalAdd_submoduleHHAsstWFPRecCapBuildYN1Y AUTO 20 | @_index AUTO 21 | /MAP. 22 | RESTORE. 23 | 24 | CACHE. 25 | EXECUTE. 26 | DATASET NAME DataSet1. 27 | 28 | * import dataset 2 29 | 30 | PRESERVE. 31 | SET DECIMAL DOT. 32 | 33 | GET DATA /TYPE=TXT 34 | /FILE= 35 | "C:\Users\b\Desktop\demo\RosterMethod\Demographic_module_DisabilityHHMemb_submodule_RepeatDisabHH"+ 36 | "Members.csv" 37 | /ENCODING='UTF8' 38 | /DELCASE=LINE 39 | /DELIMITERS="," 40 | /ARRANGEMENT=DELIMITED 41 | /FIRSTCASE=2 42 | /DATATYPEMIN PERCENTAGE=95.0 43 | /VARIABLES= 44 | Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_H AUTO 45 | Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_G AUTO 46 | Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_F AUTO 47 | Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_E AUTO 48 | Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_D AUTO 49 | Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_C AUTO 50 | Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_B AUTO 51 | Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_A AUTO 52 | Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe AUTO 53 | @_parent_index AUTO 54 | /MAP. 55 | RESTORE. 56 | 57 | CACHE. 58 | EXECUTE. 59 | DATASET NAME DataSet2. 60 | 61 | *join two datasets 62 | 63 | DATASET ACTIVATE DataSet2. 64 | RENAME VARIABLES (@_parent_index = index). 65 | 66 | DATASET ACTIVATE DataSet1. 67 | RENAME VARIABLES (@_index = index). 68 | 69 | SORT CASES BY index. 70 | DATASET ACTIVATE DataSet2. 71 | SORT CASES BY index. 72 | DATASET ACTIVATE DataSet1. 73 | MATCH FILES /TABLE=* 74 | /FILE='DataSet2' 75 | /BY index. 76 | EXECUTE. 77 | 78 | 79 | *can only download repeat csv data as zip file from moda with group names - will update this code to remove group names 80 | *rename to remove group names - because of the variable length SPSS changes name slightly 81 | 82 | DATASET ACTIVATE DataSet1. 83 | 84 | RENAME VARIABLES (TechnicalAdd_submoduleHHAsstWFPRecCashYN1Y = HHAsstWFPRecCashYN1Y ). 85 | RENAME VARIABLES (TechnicalAdd_submoduleHHAsstWFPRecInKindYN1Y =HHAsstWFPRecInKindYN1Y). 86 | RENAME VARIABLES (TechnicalAdd_submoduleHHAsstWFPRecCapBuildYN1Y = HHAsstWFPRecCapBuildYN1Y). 87 | 88 | RENAME VARIABLES (Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_G = PDisabAge). 89 | RENAME VARIABLES (Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_F = PDisabSex). 90 | RENAME VARIABLES (Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_E= PDisabSee). 91 | RENAME VARIABLES (Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_D = PDisabHear). 92 | RENAME VARIABLES (Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_C = PDisabWalk). 93 | RENAME VARIABLES (Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_B = PDisabRemember). 94 | RENAME VARIABLES (Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe_A = PDisabUnderstand). 95 | RENAME VARIABLES (Demographic_moduleDisabilityHHMemb_submoduleRepeatDisabHHMembe = PDisabWash). 96 | 97 | 98 | *assign variable and value labels 99 | 100 | Variable Labels HHAsstWFPRecCashYN1Y "Did your household receive cash-based WFP assistance in the last 12 months?". 101 | Variable Labels HHAsstWFPRecInKindYN1Y "Did your household receive in-kind WFP assistance in the last 12 months?". 102 | Variable Labels HHAsstWFPRecCapBuildYN1Y "Did you household receive WFP capacity building assistance in the last 12 months?". 103 | 104 | Variable Labels PDisabAge "What is the age of ${PDisabName}?". 105 | Variable Labels PDisabSex "What is the sex of ${PDisabName}?". 106 | Variable Labels PDisabSee "Does ${PDisabName} have difficulty seeing, even if wearing glasses? Would you say…". 107 | Variable Labels PDisabHear "Does ${PDisabName} have difficulty hearing, even if using a hearing aid(s)? Would you say…". 108 | Variable Labels PDisabWalk "Does ${PDisabName} have difficulty walking or climbing steps? Would you say…". 109 | Variable Labels PDisabRemember "Does ${PDisabName} have difficulty walking or climbing steps? Would you say…". 110 | Variable Labels PDisabUnderstand "Using your usual language, does ${PDisabName} have difficulty communicating, for example understanding or being understood? Would you say…". 111 | Variable Labels PDisabWash "Does ${PDisabName} have difficulty with self-care, such as washing all over or dressing? Would you say…". 112 | 113 | 114 | Value labels HHAsstWFPRecCashYN1Y HHAsstWFPRecInKindYN1Y HHAsstWFPRecCapBuildYN1Y 0 'No' 1 'Yes'. 115 | Value labels PDisabSex 0 'Female' 1 'Male'. 116 | Value labels PDisabSee PDisabHear PDisabWalk PDisabRemember PDisabUnderstand PDisabWash 1 'No difficulty' 2 'Some difficulty' 3 'A lot of difficulty' 4 'Cannot do at all' 888 "Don't know" 999 'Refuse'. 117 | 118 | 119 | *calculate whether the respondent had "A lot of difficulty" or "Cannot do at all" for any of the 6 questions. 120 | 121 | Compute PDisabCat3 = 0. 122 | if PDisabSee = 3 | PDisabSee = 4 | PDisabHear = 3 | PDisabHear = 4 | PDisabWalk = 3 | PDisabWalk = 4 | PDisabRemember = 3 | PDisabRemember = 4 | PDisabUnderstand = 3 | PDisabUnderstand = 4 | PDisabWash = 3 | PDisabWash = 4 PDisabCat3 = 1. 123 | 124 | Value labels PDisabCat3 0 "without disability (category 3 criteria)" 1 "with disability (category 3 criteria)". 125 | 126 | 127 | *creates a table of the percentage of type of assistance recieve by PDisabCat3 128 | 129 | 130 | *cash 131 | 132 | CROSSTABS 133 | /TABLES=HHAsstWFPRecCashYN1Y BY PDisabCat3 134 | /FORMAT=AVALUE TABLES 135 | /CELLS=COLUMN 136 | /COUNT ROUND CELL. 137 | 138 | *inkind 139 | 140 | CROSSTABS 141 | /TABLES=HHAsstWFPRecInKindYN1Y BY PDisabCat3 142 | /FORMAT=AVALUE TABLES 143 | /CELLS=COLUMN 144 | /COUNT ROUND CELL. 145 | 146 | *capacity building 147 | 148 | CROSSTABS 149 | /TABLES=HHAsstWFPRecCapBuildYN1Y BY PDisabCat3 150 | /FORMAT=AVALUE TABLES 151 | /CELLS=COLUMN 152 | /COUNT ROUND CELL. 153 | 154 | 155 | 156 | 157 | 158 | 159 | DATASET ACTIVATE DataSet1. 160 | 161 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC1-4/pro-CC1-4_hoh_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #add sample data 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/PRO_WG_Sample_Survey/HoHMethod/PRO_WG_HoH_Sample_Survey.csv") 7 | 8 | 9 | #assign variable and value labels 10 | var_label(data$HHAsstWFPRecCashYN1Y) <- "Did your household receive cash-based WFP assistance in the last 12 months?" 11 | var_label(data$HHAsstWFPRecInKindYN1Y) <- "Did your household receive in-kind WFP assistance in the last 12 months?" 12 | var_label(data$HHAsstWFPRecCapBuildYN1Y) <- "Did you household receive WFP capacity building assistance in the last 12 months?" 13 | 14 | var_label(data$HHHSex) <- "What is the sex of the head of the household?" 15 | var_label(data$HHHAge) <- "Age of the head of the household" 16 | 17 | var_label(data$HHHDisabSee) <- "Does the head of household have difficulty seeing, even if wearing glasses? Would you say…" 18 | var_label(data$HHHDisabHear) <- "Does the head of household have difficulty hearing, even if using a hearing aid(s)? Would you say…" 19 | var_label(data$HHHDisabWalk) <- "Does the head of household have difficulty walking or climbing steps? Would you say…" 20 | var_label(data$HHHDisabRemember) <- "Does the head of household have difficulty remembering or concentrating? Would you say…" 21 | var_label(data$HHHDisabUnderstand) <- "Using his or her usual language, does the head of household hav e difficulty communicating, for example understanding or being understood? Would you say…" 22 | var_label(data$HHHDisabWash) <- "Does the head of household have difficulty with self-care, such as washing all over or dressing? Would you say…" 23 | 24 | 25 | data <- data %>% 26 | mutate(across(c(HHAsstWFPRecCashYN1Y, HHAsstWFPRecInKindYN1Y, HHAsstWFPRecCapBuildYN1Y), ~labelled(., labels = c( 27 | "No" = 0, 28 | "Yes" = 1 29 | )))) 30 | 31 | val_lab(data$HHHSex) = num_lab(" 32 | 0 Female 33 | 1 Male 34 | ") 35 | 36 | data <- data %>% 37 | mutate(across(c(HHHDisabSee,HHHDisabHear,HHHDisabWalk,HHHDisabRemember,HHHDisabUnderstand,HHHDisabWash), ~labelled(., labels = c( 38 | "No difficulty" = 1, 39 | "Some difficulty" = 2, 40 | "A lot of difficulty" = 3, 41 | "Cannot do at all" = 4, 42 | "Don't know" = 888, 43 | "Refuse" = 999 44 | )))) 45 | 46 | #calculate whether the respondent had "A lot of difficulty" or "Cannot do at all" for any of the 6 questions. 47 | data <- data %>% mutate(HHHDisabCat3 = case_when( 48 | between(HHHDisabSee,3,4) | between(HHHDisabHear,3,4) | between(HHHDisabWalk,3,4) | between(HHHDisabRemember,3,4) | between(HHHDisabUnderstand,3,4)| between(HHHDisabWash,3,4) ~ 1, 49 | TRUE ~ 0 50 | )) 51 | 52 | val_lab(data$HHHDisabCat3) = num_lab(" 53 | 0 without disability (category 3 criteria) 54 | 1 with disability (category 3 criteria) 55 | ") 56 | 57 | 58 | #creates a table of the weighted percentage of type of assistance recieve by HHHDisabCat3 59 | #creating a temporary variable to display value labels 60 | #and providing the option to use weights if needed 61 | 62 | #cash 63 | HHAsstWFPRecCashYN1Y_table_wide <- data %>% group_by(HHHDisabCat3_lab = as_factor(HHHDisabCat3)) %>% 64 | drop_na(HHAsstWFPRecCashYN1Y) %>% 65 | count(HHAsstWFPRecCashYN1Y_lab = as_factor(HHAsstWFPRecCashYN1Y)) %>% # if weights are needed use instead the row below 66 | #count(HHAsstWFPRecCashYN1Y_lab = as.character(HHAsstWFPRecCashYN1Y), wt = nameofweightvariable) 67 | mutate(Percentage = 100 * n / sum(n)) %>% 68 | ungroup() %>% select(-n) %>% 69 | pivot_wider(names_from = HHAsstWFPRecCashYN1Y_lab, 70 | values_from = Percentage, 71 | values_fill = 0) 72 | 73 | #inkind 74 | HHAsstWFPRecInKindYN1Y_table_wide <- data %>% group_by(HHHDisabCat3_lab = as_factor(HHHDisabCat3)) %>% 75 | drop_na(HHAsstWFPRecInKindYN1Y) %>% 76 | count(HHAsstWFPRecInKindYN1Y_lab = as_factor(HHAsstWFPRecInKindYN1Y)) %>% # if weights are needed use instead the row below 77 | #count(HHAsstWFPRecInKindYN1Y_lab = as.character(HHAsstWFPRecInKindYN1Y), wt = nameofweightvariable) 78 | mutate(Percentage = 100 * n / sum(n)) %>% 79 | ungroup() %>% select(-n) %>% 80 | pivot_wider(names_from = HHAsstWFPRecInKindYN1Y_lab, 81 | values_from = Percentage, 82 | values_fill = 0) 83 | 84 | #capacity building 85 | HHAsstWFPRecCapBuildYN1Y_table_wide <- data %>% group_by(HHHDisabCat3_lab = as_factor(HHHDisabCat3)) %>% 86 | drop_na(HHAsstWFPRecCapBuildYN1Y) %>% 87 | count(HHAsstWFPRecCapBuildYN1Y_lab = as_factor(HHAsstWFPRecCapBuildYN1Y)) %>% # if weights are needed use instead the row below 88 | #count(HHAsstWFPRecCapBuildYN1Y_lab = as.character(HHAsstWFPRecCapBuildYN1Y), wt = nameofweightvariable) 89 | mutate(Percentage = 100 * n / sum(n)) %>% 90 | ungroup() %>% select(-n) %>% 91 | pivot_wider(names_from =HHAsstWFPRecCapBuildYN1Y_lab, 92 | values_from = Percentage, 93 | values_fill = 0) 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC2-1/pro-CC2-1.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | * Encoding: UTF-8. 4 | 5 | Variable labels HHAsstKnowEnt 'Have you been told exactly what you are entitled to receive in terms of commodities/quantities or cash? Please describe your entitlements'. 6 | Variable labels HHAsstKnowPeople 'Do you know how people were chosen to receive assistance? Please describe how they were chosen'. 7 | Variable labels HHAsstRecInfo 'Did you receive the information in a way that you could easily understand?'. 8 | Variable labels HHAsstReportMisc 'Do you know how to report misconduct from WFP or partners, including asking for (sexual) favours or money in exchange of assistance?'. 9 | 10 | 11 | Value labels HHAsstKnowEnt HHAsstKnowPeople HHAsstReportMisc 1 'Yes' 0 'No'. 12 | Value labels HHAsstRecInfo 1 'Yes' 0 'No' 2 'I never received information'. 13 | 14 | 15 | freq HHAsstKnowEnt HHAsstKnowPeople HHAsstRecInfo HHAsstReportMisc. 16 | 17 | do if (HHAsstKnowEnt = 1) & (HHAsstKnowPeople = 1) & (HHAsstRecInfo = 1) & (HHAsstReportMisc = 1). 18 | compute HHAcessInfo = 1. 19 | Else. 20 | Compute HHAcessInfo = 0. 21 | End if. 22 | 23 | variable labels HHAcessInfo "Provided with accessible information about the programme ". 24 | value labels HHAcessInfo 25 | 0 "No" 26 | 1 "Yes". 27 | 28 | freq HHAcessInfo. 29 | 30 | -------------------------------------------------------------------------------- /Indicators/Protection-CRF-CC2-1/pro-CC2-1_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #add sample data 6 | data <- read_csv("Static/PROP_AAP_CRF_Sample_Survey.csv") 7 | 8 | #assign variable and value labels 9 | var_label(data$HHAsstKnowEnt) <- "Have you been told exactly what you are entitled to receive in terms of commodities/quantities or cash? Please describe your entitlements" 10 | var_label(data$HHAsstKnowPeople) <- "Do you know how people were chosen to receive assistance? Please describe how they were chosen" 11 | var_label(data$HHAsstRecInfo) <- "Did you receive the information in a way that you could easily understand?" 12 | var_label(data$HHAsstReportMisc) <- "Do you know how to report misconduct from WFP or partners, including asking for (sexual) favours or money in exchange of assistance?" 13 | 14 | data <- data %>% 15 | mutate(across(c(HHAsstKnowEnt, HHAsstKnowPeople, HHAsstReportMisc), ~labelled(., labels = c( 16 | "No" = 0, 17 | "Yes" = 1 18 | )))) 19 | data <- data %>% 20 | mutate(across(c(HHAsstRecInfo), ~labelled(., labels = c( 21 | "No" = 0, 22 | "Yes" = 1, 23 | "I never received information" = 2 24 | )))) 25 | 26 | 27 | #calculate indicator and assign variable label & name 28 | data <- data %>% mutate(HHAcessInfo = case_when( 29 | HHAsstKnowEnt == 1 & HHAsstKnowPeople == 1 & HHAsstRecInfo == 1 & HHAsstReportMisc == 1 ~ 1, 30 | TRUE ~ 0 31 | )) 32 | var_label(data$HHAcessInfo) <- "Provided with accessible information about the programme" 33 | val_lab(data$HHAcessInfo) = num_lab(" 34 | 0 No 35 | 1 Yes 36 | ") 37 | 38 | 39 | #creates a table of the weighted percentage of HHAcessInfo by 40 | #creating a temporary variable to display value labels 41 | #and providing the option to use weights if needed 42 | 43 | 44 | HHAcessInfo_table_wide <- data %>% 45 | drop_na(HHAcessInfo) %>% 46 | count(HHAcessInfo_lab = as.character(HHAcessInfo)) %>% # if weights are needed use instead the row below 47 | #count(HHAcessInfo_lab = as.character(HHAcessInfo), wt = nameofweightvariable) 48 | mutate(Percentage = 100 * n / sum(n)) %>% 49 | ungroup() %>% select(-n) %>% 50 | pivot_wider(names_from = HHAcessInfo_lab, 51 | values_from = Percentage, 52 | values_fill = 0) 53 | 54 | 55 | -------------------------------------------------------------------------------- /Indicators/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Scripts 2 | This folder contains all standardized scripts for indicators, analysis and visualization. 3 | ## Main folder 4 | The scripts have been written based on the standard Codebook, visible in Survey Designer. 5 | -------------------------------------------------------------------------------- /Indicators/Reduced-coping-strategy-index/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Scripts 2 | This folder contains all standardized scripts for indicators, analysis and visualization. 3 | 4 | ## reduced Coping Strategies Index (rCSI) 5 | - [Indicator Description on VAM Resource Center](https://resources.vam.wfp.org/data-analysis/quantitative/food-security/reduced-coping-strategies-index) -------------------------------------------------------------------------------- /Indicators/Reduced-coping-strategy-index/rCSI-indicator.do: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | * reduced Coping Strategy Index (rCSI) 3 | *******************************************************************************/ 4 | 5 | ** Load data 6 | * --------- 7 | import delim using "../GitHub/RAMResourcesScripts/Static/rCSI_Sample_Survey.csv", /// 8 | clear case(preserve) 9 | 10 | ** Check and recode missing values as 0 11 | sum rCSI* 12 | 13 | ** Label rCSI relevant variables 14 | lab var rCSILessQlty "Relied on less preferred, less expensive food" 15 | lab var rCSIBorrow "Borrowed food or relied on help from friends or relatives" 16 | lab var rCSIMealNb "Reduced the number of meals eaten per day" 17 | lab var rCSIMealSize "Reduced portion size of meals at meals time" 18 | lab var rCSIMealAdult "Restricted consumption by adults in order for young children to eat" 19 | 20 | ** Calculate rCSI 21 | gen rCSI = (rCSILessQlty * 1) + (rCSIBorrow * 2) + (rCSIMealNb * 1) + /// 22 | (rCSIMealSize * 1) + (rCSIMealAdult * 3) 23 | lab var rCSI "Reduced Consumption Strategies Index" 24 | 25 | ** End of Scripts 26 | -------------------------------------------------------------------------------- /Indicators/Reduced-coping-strategy-index/rCSI-indicator.sps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WFP-VAM/RAMResourcesScripts/353e1b7ef4637c4a4db8079019ad8228bab4c9d1/Indicators/Reduced-coping-strategy-index/rCSI-indicator.sps -------------------------------------------------------------------------------- /Indicators/Reduced-coping-strategy-index/rCSI_tidyverse.R: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------# 2 | 3 | # WFP RAM Standardized Scripts 4 | # Calculating and Summarising rCSI 5 | 6 | #------------------------------------------------------------------------------# 7 | 8 | rm(list = ls()) 9 | 10 | ## Load Packages --------------------------------------------------------------# 11 | 12 | library(tidyverse) 13 | library(dplyr) 14 | library(labelled) 15 | 16 | # Load Sample Data ------------------------------------------------------------# 17 | 18 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/rCSI_Sample_Survey.csv") 19 | 20 | # Label rCSI relevant variables -----------------------------------------------# 21 | 22 | var_label(data$rCSILessQlty) <- "Relied on less preferred and less expensive food" 23 | var_label(data$rCSIBorrow) <- "Borrowed food or relied on help from a relative or friend" 24 | var_label(data$rCSIMealNb) <- "Reduce number of meals eaten in a day" 25 | var_label(data$rCSIMealSize) <- "Limit portion size of meals at meal times" 26 | var_label(data$rCSIMealAdult) <- "Restricted consumption by adults for small children to eat" 27 | 28 | # Calculate rCSI --------------------------------------------------------------# 29 | 30 | data <- data %>% mutate(rCSI = rCSILessQlty + 31 | (rCSIBorrow * 2) + 32 | rCSIMealNb + 33 | rCSIMealSize + 34 | (rCSIMealAdult * 3)) 35 | 36 | var_label(data$rCSI) <- "Reduced coping strategies index (rCSI)" 37 | 38 | # Creating weighted and unweighted summary of rCSI ----------------------------# 39 | 40 | #unweighted 41 | rCSI_table_mean <- data %>% 42 | drop_na(rCSI) %>% 43 | summarise(meanrCSI = mean(rCSI)) 44 | 45 | #with weights 46 | rCSI_table_mean <- data %>% 47 | drop_na(rCSI) %>% 48 | summarise(meanrCSI = weighted.mean(rCSI,nameofweightvariable)) 49 | #insert name of weight variable 50 | 51 | -------------------------------------------------------------------------------- /Indicators/SAMS-CRF-30-PHL/SAMS30_PHL.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | *can only download repeat csv data as zip file from moda with group names - will update this code to remove group names 4 | *rename to remove group names - because of the variable length SPSS changes name slightly 5 | 6 | RENAME VARIABLES (SAMS_moduleIndicator30_submoduleRepeatSAMSPHLPSAMSPHLCommName_A = PSAMSPHLCommName). 7 | RENAME VARIABLES (SAMS_moduleIndicator30_submoduleRepeatSAMSPHLPSAMSPHLCommName = PSAMSPHLCommName_oth). 8 | RENAME VARIABLES (SAMS_moduleIndicator30_submoduleRepeatSAMSPHLPSAMSPHLCommClas = PSAMSPHLCommClass). 9 | RENAME VARIABLES (SAMS_moduleIndicator30_submoduleRepeatSAMSPHLPSAMSPHLCommQntH_B = PSAMSPHLCommQntHand). 10 | RENAME VARIABLES (SAMS_moduleIndicator30_submoduleRepeatSAMSPHLPSAMSPHLCommQntH_A = PSAMSPHLCommQntHandUnit). 11 | RENAME VARIABLES (SAMS_moduleIndicator30_submoduleRepeatSAMSPHLPSAMSPHLCommQntH = PSAMSPHLCommQntHandUnit_oth). 12 | RENAME VARIABLES (SAMS_moduleIndicator30_submoduleRepeatSAMSPHLPSAMSPHLCommQntL= PSAMSPHLCommQntLost ). 13 | 14 | *also rename the _parent_index variable to farmer number 15 | 16 | RENAME VARIABLES (@_parent_index = PSAMSPHLFarmerNum). 17 | 18 | * define variable and value labels 19 | 20 | Variable labels PNutProgPartic_yn ‘Is participant enrolled in the ((insert name/description of program, to be adapted locally)) programme?’. 21 | 22 | 23 | Variable labels PSAMSPHLCommName "What is the name of commodity?". 24 | Variable labels PSAMSPHLCommClass "Which of the following groups does this commodity belong to?". 25 | Variable labels PSAMSPHLCommQntHand "What is the amount of this commodity initially stored?". 26 | Variable labels PSAMSPHLCommQntHandUnit "Enter unit of measure.". 27 | Variable labels PSAMSPHLCommQntLost "Of the total quantity you stored how much was lost?". 28 | 29 | 30 | *Calculate % loss per row 31 | 32 | COMPUTE perc_loss=(PSAMSPHLCommQntLost / PSAMSPHLCommQntHand) * 100. 33 | EXECUTE. 34 | 35 | 36 | *Average loss per farmer 37 | 38 | DATASET DECLARE avglossperfarmer_table. 39 | AGGREGATE 40 | /OUTFILE='avglossperfarmer_table' 41 | /BREAK=PSAMSPHLFarmerNum 42 | /perc_loss_mean=MEAN(perc_loss). 43 | 44 | 45 | *Average across farmers 46 | 47 | DATASET ACTIVATE avglossperfarmer_table. 48 | DESCRIPTIVES VARIABLES=perc_loss_mean 49 | /STATISTICS=MEAN. 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Indicators/SAMS-CRF-30-PHL/SAMS30_PHL_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #add sample data 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/SAMS_CRF_30_PHL_Sample_Survey/SAMS_module_Indicator30_submodule_RepeatSAMSPHL.csv") 7 | 8 | #can only download repeat csv data as zip file from moda with group names - will update this code to remove group names 9 | #rename to remove group names 10 | data <- data %>% rename(PSAMSPHLCommName = 'SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommName') 11 | data <- data %>% rename(PSAMSPHLCommName_oth = 'SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommName_oth') 12 | data <- data %>% rename(PSAMSPHLCommClass = 'SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommClass') 13 | data <- data %>% rename(PSAMSPHLCommQntHand = 'SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommQntHand') 14 | data <- data %>% rename(PSAMSPHLCommQntHandUnit = 'SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommQntHandUnit') 15 | data <- data %>% rename(PSAMSPHLCommQntHandUnit_oth = 'SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommQntHandUnit_oth') 16 | data <- data %>% rename(PSAMSPHLCommQntLost = 'SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommQntLost') 17 | #also rename the _parent_index variable to farmer number 18 | data <- data %>% rename(PSAMSPHLFarmerNum = '_parent_index') 19 | 20 | #assign variable and value labels 21 | var_label(data$PSAMSPHLCommName) <- "What is the name of commodity?" 22 | var_label(data$PSAMSPHLCommClass) <- "Which of the following groups does this commodity belong to?" 23 | var_label(data$PSAMSPHLCommQntHand) <- "What is the amount of this commodity initially stored?" 24 | var_label(data$PSAMSPHLCommQntHandUnit) <- "Enter unit of measure." 25 | var_label(data$PSAMSPHLCommQntLost) <- "Of the total quantity you stored how much was lost?" 26 | 27 | #Calculate % loss per row 28 | data <- data %>% mutate(perc_loss = round((PSAMSPHLCommQntLost /(PSAMSPHLCommQntHand) * 100),1)) 29 | #Average loss per farmer 30 | avglossperfarmer_table <- data %>% group_by(PSAMSPHLFarmerNum) %>% summarise(avglossperfarmer = mean(perc_loss)) 31 | #Average across farmers 32 | average_phl_loss_table <- avglossperfarmer_table %>% summarise(average_phl_loss = mean(avglossperfarmer)) 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | #creates a table of the weighted percentage of NutProgPartic_yn by 43 | #creating a temporary variable to display value labels 44 | #and providing the option to use weights if needed 45 | 46 | 47 | NutProgPartic_yn_table_wide <- data %>% 48 | drop_na(PNutProgPartic_yn) %>% 49 | count(PNutProgPartic_yn_lab = as.character(PNutProgPartic_yn)) %>% # if weights are needed use instead the row below 50 | #count(PNutProgPartic_yn_lab = as.character(PNutProgPartic_yn), wt = nameofweightvariable) 51 | mutate(Percentage = 100 * n / sum(n)) %>% 52 | ungroup() %>% select(-n) %>% 53 | pivot_wider(names_from = PNutProgPartic_yn_lab, 54 | values_from = Percentage, 55 | values_fill = 0) -------------------------------------------------------------------------------- /Indicators/SAMS-CRF-31-NUT/SAMS31_NUT.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | * import dataset 1 4 | 5 | PRESERVE. 6 | SET DECIMAL DOT. 7 | 8 | GET DATA /TYPE=TXT 9 | /FILE="C:\Users\b\Desktop\demo\SAMS31\data.csv" 10 | /ENCODING='UTF8' 11 | /DELCASE=LINE 12 | /DELIMITERS="," 13 | /ARRANGEMENT=DELIMITED 14 | /FIRSTCASE=2 15 | /DATATYPEMIN PERCENTAGE=95.0 16 | /VARIABLES= 17 | Demographic_moduleDemographicBasic_submoduleRespSex AUTO 18 | SAMS_moduleIndicator31_submoduleSAMSNutCropNb AUTO 19 | @_index AUTO 20 | /MAP. 21 | RESTORE. 22 | 23 | CACHE. 24 | EXECUTE. 25 | DATASET NAME DataSet1 WINDOW=FRONT. 26 | 27 | * import dataset 2 28 | 29 | GET DATA /TYPE=TXT 30 | /FILE="C:\Users\b\Desktop\demo\SAMS31\SAMS_module_Indicator31_submodule_RepeatNutCrop.csv" 31 | /ENCODING='UTF8' 32 | /DELCASE=LINE 33 | /DELIMITERS="," 34 | /ARRANGEMENT=DELIMITED 35 | /FIRSTCASE=2 36 | /DATATYPEMIN PERCENTAGE=95.0 37 | /VARIABLES= 38 | SAMS_moduleIndicator31_submoduleRepeatNutCropPSAMSNutCropName_A AUTO 39 | SAMS_moduleIndicator31_submoduleRepeatNutCropPSAMSNutCropName AUTO 40 | SAMS_moduleIndicator31_submoduleRepeatNutCropPSAMSNutCropQuan_B AUTO 41 | SAMS_moduleIndicator31_submoduleRepeatNutCropPSAMSNutCropQuan_A AUTO 42 | SAMS_moduleIndicator31_submoduleRepeatNutCropPSAMSNutCropQuan AUTO 43 | SAMS_moduleIndicator31_submoduleRepeatNutCropPSAMSNutCropIncr AUTO 44 | @_parent_index AUTO 45 | /MAP. 46 | RESTORE. 47 | 48 | CACHE. 49 | EXECUTE. 50 | DATASET NAME DataSet2 WINDOW=FRONT. 51 | 52 | *join two datasets 53 | 54 | DATASET ACTIVATE DataSet2. 55 | RENAME VARIABLES (@_parent_index = index). 56 | 57 | DATASET ACTIVATE DataSet1. 58 | RENAME VARIABLES (@_index = index). 59 | 60 | SORT CASES BY index. 61 | DATASET ACTIVATE DataSet2. 62 | SORT CASES BY index. 63 | DATASET ACTIVATE DataSet1. 64 | MATCH FILES /TABLE=* 65 | /FILE='DataSet2' 66 | /BY index. 67 | EXECUTE. 68 | 69 | 70 | *can only download repeat csv data as zip file from moda with group names - will update this code to remove group names 71 | *rename to remove group names - because of the variable length SPSS changes name slightly 72 | 73 | DATASET ACTIVATE DataSet1. 74 | 75 | RENAME VARIABLES (SAMS_moduleIndicator31_submoduleRepeatNutCropPSAMSNutCropName_A = PSAMSNutCropName). 76 | RENAME VARIABLES (SAMS_moduleIndicator31_submoduleRepeatNutCropPSAMSNutCropIncr = PSAMSNutCropIncr). 77 | RENAME VARIABLES (Demographic_moduleDemographicBasic_submoduleRespSex = RespSex). 78 | 79 | Value labels PSAMSNutCropName 1 'Crop 1' 2 'Crop 2' 3 'Crop 3' 4 'Crop 4' 5 'Crop 5' 999 'Other'. 80 | Value labels PSAMSNutCropIncr 1 'More' 2 'Less ' 3 'The same ' 9999 'Not applicable'. 81 | Value labels RespSex 0 'Female' 1 'Male'. 82 | 83 | *#selecting farmers that grew "Crop 1" show proportion reporting an increase, decrease or the same amount of production as the year before 84 | 85 | select if(PSAMSNutCropIncr ~= 9999 & PSAMSNutCropName = 1). 86 | 87 | CROSSTABS 88 | /TABLES=RespSex BY PSAMSNutCropIncr 89 | /FORMAT=AVALUE TABLES 90 | /CELLS=ROW 91 | /COUNT ROUND CELL. 92 | 93 | -------------------------------------------------------------------------------- /Indicators/SAMS-CRF-31-NUT/SAMS31_NUT_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | library(janitor) 5 | 6 | #add sample data 7 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/SAMS_CRF_31_NUT_Sample_Survey/SAMS_module_Indicator31_submodule_RepeatNutCrop.csv") 8 | data2 <- read_csv("~/GitHub/RAMResourcesScripts/Static/SAMS_CRF_31_NUT_Sample_Survey/data.csv") 9 | 10 | #can only download repeat csv data as zip file from moda with group names - will update this code to remove group names 11 | #rename to remove group names 12 | data <- data %>% rename(PSAMSNutCropName = 'SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropName') 13 | data <- data %>% rename(PSAMSNutCropName_oth = 'SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropName_oth') 14 | data <- data %>% rename(PSAMSNutCropQuant = 'SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropQuant') 15 | data <- data %>% rename(PSAMSNutCropQuantUnit = 'SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropQuantUnit') 16 | data <- data %>% rename(PSAMSNutCropIncr = 'SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropIncr') 17 | data <- data %>% rename(index = '_parent_index') 18 | 19 | data2 <- data2 %>% rename(RespSex = 'Demographic_module/DemographicBasic_submodule/RespSex') 20 | data2 <- data2 %>% rename(index = '_index') 21 | 22 | #assign variable and value labels 23 | var_label(data2$RespSex) <- "Sex of the Respondent" 24 | var_label(data$PSAMSNutCropName) <- "What is the name of crop?" 25 | var_label(data$PSAMSNutCropQuant) <- "How much of this commodity did you produce in the last 12 months?" 26 | var_label(data$PSAMSNutCropQuantUnit) <- "Enter unit of quantity produced" 27 | var_label(data$PSAMSNutCropIncr) <- "Did you produce more, less or the same amount of this nutritious crop in the last 12 months compared to the 12 months before that?" 28 | 29 | 30 | val_lab(data2$RespSex) = num_lab(" 31 | 0 Female 32 | 1 Male 33 | ") 34 | val_lab(data$PSAMSNutCropName) = num_lab(" 35 | 1 Crop 1 36 | 2 Crop 2 37 | 3 Crop 3 38 | 4 Crop 4 39 | 5 Crop 5 40 | 999 Other 41 | ") 42 | val_lab(data$PSAMSNutCropIncr) = num_lab(" 43 | 1 More 44 | 2 Less 45 | 3 The same 46 | 9999 Not applicable 47 | ") 48 | 49 | #join dataset "data" & "data2" 50 | data <- data %>% left_join(data2, by = "index") 51 | 52 | #selecting farmers that grew "Crop 1" show proportion reporting an increase, decrease or the same amount of production as the year before 53 | SAMS31_table_total_wide <- data %>% filter(PSAMSNutCropName == 1) %>% filter(PSAMSNutCropIncr != 9999) %>% 54 | drop_na(PSAMSNutCropIncr) %>% 55 | count(PSAMSNutCropIncr_lab = as.character(PSAMSNutCropIncr)) %>% # if weights are needed use instead the row below 56 | mutate(Percentage = 100 * n / sum(n)) %>% 57 | ungroup() %>% select(-n) %>% 58 | pivot_wider(names_from = PSAMSNutCropIncr_lab, 59 | values_from = Percentage, 60 | values_fill = 0) 61 | 62 | #selecting farmers that grew "Crop 1" show proportion reporting an increase, decrease or the same amount of production as the year before 63 | SAMS31_table_bysex_wide <- data %>% filter(PSAMSNutCropName == 1) %>% filter(PSAMSNutCropIncr != 9999) %>% group_by(RespSex_lab = as.character(RespSex)) %>% 64 | drop_na(PSAMSNutCropIncr) %>% 65 | count(PSAMSNutCropIncr_lab = as.character(PSAMSNutCropIncr)) %>% # if weights are needed use instead the row below 66 | mutate(Percentage = 100 * n / sum(n)) %>% 67 | ungroup() %>% select(-n) %>% 68 | pivot_wider(names_from = PSAMSNutCropIncr_lab, 69 | values_from = Percentage, 70 | values_fill = 0) 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Indicators/SchoolBasedProgrammes-CRF63-MinimumDietaryDiversity/SBP_CRF63_MDD.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | *this syntax is based on SPSS download version from MoDA 4 | 5 | #Calculate School Age Dietary Diversity Score based on WFP MDDW guidelines https://docs.wfp.org/api/documents/WFP-0000140197/download/ pg.8 6 | #Following the WFP MDDW method for program monitoring - SNF will count in the meats group 7 | #in this example fortified foods PSchoolAgeDDSFortFoodwflour,PSchoolAgeDDSFortFoodmflour,PSchoolAgeDDSFortFoodrice,PSchoolAgeDDSFortFooddrink will also count in grains 8 | #classifying PSchoolAgeDDSFortFoodother_oth will likely involve classifying line by line 9 | 10 | COMPUTE PSchoolAgeDDS_Staples_wfp = 0. 11 | IF ((PSchoolAgeDDSStapCer = 1) | (PSchoolAgeDDSStapRoo = 1) | (PSchoolAgeDDSFortFoodwflour = 1) | (PSchoolAgeDDSFortFoodmflour = 1) | (PSchoolAgeDDSFortFoodrice = 1) | (PSchoolAgeDDSFortFooddrink = 1)) PSchoolAgeDDS_Staples_wfp = 1. 12 | EXECUTE. 13 | 14 | COMPUTE PSchoolAgeDDS_Pulses_wfp = 0. 15 | IF (PSchoolAgeDDSPulse = 1) PSchoolAgeDDS_Pulses_wfp = 1. 16 | EXECUTE. 17 | 18 | COMPUTE PSchoolAgeDDS_NutsSeeds_wfp = 0. 19 | IF (PSchoolAgeDDSNuts = 1) PSchoolAgeDDS_NutsSeeds_wfp = 1. 20 | EXECUTE. 21 | 22 | COMPUTE PSchoolAgeDDS_Dairy_wfp = 0. 23 | IF ((PSchoolAgeDDSDairy = 1) | (PSchoolAgeDDSMilk = 1)) PSchoolAgeDDS_Dairy_wfp = 1. 24 | EXECUTE. 25 | 26 | COMPUTE PSchoolAgeDDS_MeatFish_wfp = 0. 27 | IF ((PSchoolAgeDDSPrMeatO = 1) | (PSchoolAgeDDSPrMeatF = 1) | (PSchoolAgeDDSPrMeatPro = 1) | (PSchoolAgeDDSPrMeatWhite = 1) | (PSchoolAgeDDSPrFish = 1) | (PSchoolAgeDDSSnf = 1)) PSchoolAgeDDS_MeatFish_wfp = 1. 28 | EXECUTE. 29 | 30 | COMPUTE PSchoolAgeDDS_Eggs_wfp = 0. 31 | IF (PSchoolAgeDDSPrEgg = 1) PSchoolAgeDDS_Eggs_wfp = 1. 32 | EXECUTE. 33 | 34 | COMPUTE PSchoolAgeDDS_LeafGreenVeg_wfp = 0. 35 | IF (PSchoolAgeDDSVegGre = 1) PSchoolAgeDDS_LeafGreenVeg_wfp = 1. 36 | EXECUTE. 37 | 38 | COMPUTE PSchoolAgeDDS_VitA_wfp = 0. 39 | IF ((PSchoolAgeDDSVegOrg = 1) | (PSchoolAgeDDSFruitOrg = 1)) PSchoolAgeDDS_VitA_wfp = 1. 40 | EXECUTE. 41 | 42 | COMPUTE PSchoolAgeDDS_OtherVeg_wfp = 0. 43 | IF (PSchoolAgeDDSVegOth = 1) PSchoolAgeDDS_OtherVeg_wfp = 1. 44 | EXECUTE. 45 | 46 | COMPUTE PSchoolAgeDDS_OtherFruits_wfp = 0. 47 | IF (PSchoolAgeDDSFruitOth = 1) PSchoolAgeDDS_OtherFruits_wfp = 1. 48 | EXECUTE. 49 | 50 | 51 | 52 | 53 | #calculate SchoolAge Dietary Diversity Score variable by adding together food groups and classifying whether the child consumed 5 or more food groups 54 | 55 | #WFP method for program monitoring - SNF will count in the meats group 56 | 57 | COMPUTE SchoolAgeDDS_wfp = sum(PSchoolAgeDDS_Staples_wfp, PSchoolAgeDDS_Pulses_wfp, PSchoolAgeDDS_NutsSeeds_wfp, PSchoolAgeDDS_Dairy_wfp, PSchoolAgeDDS_MeatFish_wfp, PSchoolAgeDDS_Eggs_wfp, PSchoolAgeDDS_LeafGreenVeg_wfp, PSchoolAgeDDS_VitA_wfp, PSchoolAgeDDS_OtherVeg_wfp, PSchoolAgeDDS_OtherFruits_wfp). 58 | EXECUTE. 59 | 60 | *count how many women consumed 5 or more groups 61 | 62 | 63 | Compute SchoolAgeDDS_5_wfp = 0. 64 | if (SchoolAgeDDS_wfp >= 5) SchoolAgeDDS_5_wfp = 1. 65 | Value labels SchoolAgeDDS_5_wfp 1 '>=5' 0 '<5 '. 66 | 67 | Value labels SchoolAgeDDS_5_wfp 1 '>=5' 0 '<5 '. 68 | 69 | 70 | *Frequency of WFP DDS method for program monitoring 71 | 72 | freq SchoolAgeDDS_5_wfp. 73 | 74 | 75 | -------------------------------------------------------------------------------- /Indicators/SchoolBasedProgrammes-CRF93-SchoolAbseentism/SBP_CRF93_Abseentism.sps: -------------------------------------------------------------------------------- 1 | * Encoding: UTF-8. 2 | 3 | *this syntax is based on SPSS download version from MoDA 4 | 5 | * Filter dataset for children registered to attend school. 6 | SELECT IF (PChildRegisterSchool = 1). 7 | 8 | * Compute a variable for absence due to ill health as a binary indicator. 9 | COMPUTE AbsentDueToIllHealth = (PChildDayAbsSchoolWhy.1 = 1). 10 | 11 | * Aggregate data to calculate total registered and total absent due to ill health. 12 | DATASET DECLARE AggregatedData. 13 | AGGREGATE OUTFILE='AggregatedData' 14 | /BREAK= 15 | /TotalRegistered = N 16 | /TotalAbsentDueToIllHealth = SUM(AbsentDueToIllHealth). 17 | 18 | * Compute the percentage of absences due to ill health. 19 | DATASET ACTIVATE AggregatedData. 20 | COMPUTE PercentAbsentDueToIllHealth = (TotalAbsentDueToIllHealth / TotalRegistered) * 100. 21 | 22 | * Assign a label to the new percentage variable. 23 | VARIABLE LABELS PercentAbsentDueToIllHealth '% Children Missing School Due to Ill Health'. 24 | 25 | * Display the result. 26 | FORMATS PercentAbsentDueToIllHealth (F2.2). 27 | LIST. -------------------------------------------------------------------------------- /Indicators/SchoolBasedProgrammes-CRF93-SchoolAbseentism/SBP_CRF93_Abseentism_tidyverse.R: -------------------------------------------------------------------------------- 1 | library(tidyverse) 2 | library(labelled) 3 | library(expss) 4 | 5 | #add sample data 6 | data <- read_csv("~/GitHub/RAMResourcesScripts/Static/SBP_CRF_63and93_Sample_Survey/SBPProcessM_module_SchoolAgeChildRoster_submodule_RepeatSchoolAgeChild.csv") 7 | 8 | #unfortunately you can only download repeat csv data as zip file from moda with group names - will update this code with more elegant solution to remove group names or if you download as SPSS you can skip this step 9 | #rename to remove group names 10 | 11 | #assign variable and value labels 12 | 13 | data <- data %>% rename(PChildRegisterSchool = 'SBPProcessM_module/SchoolAgeChildRoster_submodule/RepeatSchoolAgeChild/PChildRegisterSchool', 14 | PChildDayAttendSchool = 'SBPProcessM_module/SchoolAgeChildRoster_submodule/RepeatSchoolAgeChild/PChildDayAttendSchool', 15 | PChildDayAbsSchool = 'SBPProcessM_module/SchoolAgeChildRoster_submodule/RepeatSchoolAgeChild/PChildDayAbsSchool', 16 | PChildDayAbsSchoolWhy_IllHealth = 'SBPProcessM_module/SchoolAgeChildRoster_submodule/RepeatSchoolAgeChild/PChildDayAbsSchoolWhy/1', 17 | PChildDayAbsIllHealth = 'SBPProcessM_module/SchoolAgeChildRoster_submodule/RepeatSchoolAgeChild/PChildDayAbsIllHealth', 18 | PChildAbsIllHealth = 'SBPProcessM_module/SchoolAgeChildRoster_submodule/RepeatSchoolAgeChild/PChildAbsIllHealth' 19 | ) 20 | 21 | var_label(data$PChildRegisterSchool) <- "Is ${PChildName} registered in school?" 22 | var_label(data$PChildDayAttendSchool) <- "In the last 30 school days, how many days did ${PChildName} go to school?" 23 | var_label(data$PChildDayAbsSchool) <- "In the last 30 school days, how many days was ${PChildName} absent from school?" 24 | var_label(data$PChildDayAbsSchoolWhy_IllHealth) <- "What was the reason they missed school: Ill-health/sick" 25 | var_label(data$PChildDayAbsIllHealth) <- "How many days was your child absent from school because of ill-health" 26 | var_label(data$PChildAbsIllHealth) <- "Please, specify the type of illness" 27 | 28 | # If PChildDayAbsSchoolWhy_IllHealth and PChildRegisterSchool are not already boolean or numeric, 29 | # you might need to convert them depending on their original format. 30 | 31 | data$PChildDayAbsSchoolWhy_IllHealth <- as.logical(data$PChildDayAbsSchoolWhy_IllHealth) 32 | data$PChildRegisterSchool <- as.numeric(data$PChildRegisterSchool) 33 | 34 | #The percentage required for the indicator is PChildDayAbsSchoolWhy_IllHealth = TRUE / PChildRegisterSchool = 1 35 | 36 | # Calculate the percentage (without weights) 37 | # Calculate the total count of registered children and 38 | # the count of those absent due to ill health 39 | percentage_absent_due_to_ill_health <- data %>% 40 | filter(PChildRegisterSchool == 1) %>% 41 | summarise( 42 | Total_Registered = n(), 43 | Absent_Due_To_Ill_Health = sum(PChildDayAbsSchoolWhy_IllHealth, na.rm = TRUE), 44 | Percentage = (Absent_Due_To_Ill_Health / Total_Registered) * 100 45 | ) 46 | # View the result 47 | print(percentage_absent_due_to_ill_health) 48 | 49 | # Calculate the percentage (with weights) 50 | # Calculate the total weighted count of registered children and 51 | # the weighted count of those absent due to ill health 52 | percentage_absent_due_to_ill_health_wt <- data %>% 53 | filter(PChildRegisterSchool == 1) %>% 54 | summarise( 55 | Total_Registered_Weighted = sum(WeightVariable, na.rm = TRUE), 56 | Absent_Due_To_Ill_Health_Weighted = sum(WeightVariable[PChildDayAbsSchoolWhy_IllHealth], na.rm = TRUE), 57 | Percentage = (Absent_Due_To_Ill_Health_Weighted / Total_Registered_Weighted) * 100 58 | ) 59 | # View the result 60 | print(percentage_absent_due_to_ill_health_wt) -------------------------------------------------------------------------------- /LogicalCleaning/Logical_Data_Cleaning.R: -------------------------------------------------------------------------------- 1 | ### Logical Data Cleaning with cleanR package 2 | rm(list = ls()) 3 | today <- Sys.Date() 4 | 5 | ## Step 1: load required packages 6 | library(tidyverse) 7 | library(openxlsx) 8 | # install.packages("devtools") 9 | # remotes::install_github("axmedmaxamuud/cleanR") 10 | library(cleanR) 11 | 12 | ## Step 2: load data & create blank cleaning log book file 13 | raw_data <- cleanR::survey_data # this is dumpy data generated from SD platform 14 | my_logbook <- cleanR::logbook() # this will be blank logbook that you can use to export at the end. 15 | 16 | ## Step 3: Start running your data checking exercise 17 | # check survey duration 18 | check_form_time <- survey_time(df = raw_data, time_min = 20, time_max = 40) %>% 19 | log_sheet(question.name = "interview_duration", 20 | issue = "survey filled with less/long time, please check", 21 | action = "check") 22 | # merge check_form_time with your logbook using the rbind function 23 | my_logbook <- rbind(my_logbook, check_form_time) 24 | 25 | # check other responses 26 | # first make a list of all other columns included in your data 27 | other_columns <- c("HHAsstSecurityRisk_oth", 28 | "HHAsstAccessWhat_oth") 29 | 30 | check_others <- check_other_responses(data = raw_data, other_columns = other_columns) 31 | 32 | # include other checks dataframe into your logbook 33 | my_logbook <- rbind(my_logbook, check_others) 34 | 35 | ## You can run project specefic checks by using dplyr functions and than use the log_sheet function to reshape your data into clog format 36 | # check the age of respondents 37 | check_ki_age <- raw_data %>% 38 | filter(RESPAge < 18) %>% 39 | log_sheet(question.name = "RESPAge", 40 | issue = "the respondent is under age, please check if there was guardian", 41 | action = "check") 42 | my_logbook <- rbind(my_logbook, check_ki_age) 43 | 44 | # check if there are any duplicated uuids in your data 45 | check_dup_surveys <- check_duplicate_uuid(data = raw_data) # this function will return the list of duplicated uuids in the console 46 | 47 | # check the non-response rate of survey variables 48 | check_missing_data <- get_na_response_rates(data = raw_data) 49 | 50 | ## Step 4: Export your cleaning log book and share it with field staff for making actions and filling the new.value column 51 | 52 | 53 | -------------------------------------------------------------------------------- /LogicalCleaning/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Scripts 2 | ## Logical Cleaning 3 | 4 | This folder contains all standardized scripts for removing and replacing values that are outside logical boundaries for specific data points. Examples: 5 | - negative expenditures 6 | - Food Consumption > 7 7 | - rCSI > 7 8 | -------------------------------------------------------------------------------- /Outputs/README.md: -------------------------------------------------------------------------------- 1 | # Outputs 2 | This folder contains the folders including scripts to create tables and figures, and contains the scripts to compile them into reports. 3 | Tables and figures are populated with data generated from scripts contained in the Analysis folder. 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Scripts 2 | 3 | 4 | [![Project Status: WIP – Development is in progress, content is usable for the 5 | public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) 6 | 7 | 8 | 9 | 10 | This folder contains all standardized scripts for indicators, analysis and visualization. The folders are organized as follows: 11 | 12 | - **Analysis:** Plots, cross-tabulations, output tables...etc. 13 | - **Indicators**: Plain indicator calculations 14 | - **Logical Cleaning**: Removing and replacing values that are outside logical boundaries for the specific data points (e.g.: negative expenditures, Food Consumption > 7,…) 15 | - **Statistical Cleaning:** cleaning and replacing missing values based on analysis of the statistical distributions (e.g.: expenditures above the 99th percentile of the distribution,… ) 16 | - [**Static:**](https://github.com/WFP-VAM/RAMResourcesScripts/tree/main/Static) Sample _data_ files in CSV that can be used for testing scripts of the four types above. Data should include sufficient information for the aggregation as a simple average, weighted average. 17 | 18 | > [!CAUTION] 19 | > Continuous work is made by WFP - Research Assessment and Monitoring division to ensure the adherence of these scripts to the corporate analytical methods and standards. These standards can be found in the [Resource Centre](https://resources.vam.wfp.org/) which should be used as a main reference. This code comes with a specific license warranty, make sure to read it before using the code. 20 | 21 | 22 | _Last update_: 2023/11/22 23 | -------------------------------------------------------------------------------- /Static/ABI_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | ADMIN5Name,RespSex,HHHSex,HHFFAPart,HHAssetProtect,HHAssetProduct,HHAssetDecHardship,HHAssetAccess,HHTrainingAsset,HHAssetEnv,HHWorkAsset 2 | Community A,0,0,1,1,1,0,0,0,9999,9999 3 | Community A,0,1,1,1,1,1,1,0,9999,9999 4 | Community A,1,1,1,1,1,1,1,1,9999,9999 5 | Community A,0,1,1,0,1,0,1,0,9999,9999 6 | Community A,1,1,1,0,0,0,0,0,9999,9999 7 | Community A,0,1,1,0,0,0,1,0,9999,9999 8 | Community A,1,0,1,1,0,1,0,0,9999,9999 9 | Community A,0,0,1,1,0,1,1,1,9999,9999 10 | Community A,0,1,1,1,1,1,1,1,9999,9999 11 | Community A,0,0,1,0,0,0,0,0,9999,9999 12 | Community A,0,0,0,0,1,0,0,0,9999,9999 13 | Community A,0,0,0,1,1,1,0,0,9999,9999 14 | Community A,1,0,0,0,0,0,1,1,9999,9999 15 | Community A,0,0,0,0,0,0,1,0,9999,9999 16 | Community A,1,1,0,0,0,0,0,0,9999,9999 17 | Community B,0,1,1,1,1,1,0,0,0,9999 18 | Community B,0,1,1,0,0,1,1,1,1,9999 19 | Community B,0,1,1,0,1,1,1,1,1,9999 20 | Community B,0,0,1,1,1,1,1,1,1,9999 21 | Community B,1,0,1,0,0,0,0,0,0,9999 22 | Community B,1,1,1,0,1,0,0,0,0,9999 23 | Community B,1,1,1,1,1,0,1,0,1,9999 24 | Community B,1,1,1,1,1,1,1,1,1,9999 25 | Community B,1,1,1,0,1,1,1,0,0,9999 26 | Community B,0,1,1,0,1,0,0,1,0,9999 27 | Community B,0,0,0,0,1,1,0,0,0,9999 28 | Community B,0,1,0,0,1,1,1,1,0,9999 29 | Community B,1,1,0,0,0,0,0,1,1,9999 30 | Community B,1,0,0,0,0,0,0,0,0,9999 31 | Community B,0,1,0,0,1,0,0,0,0,9999 32 | -------------------------------------------------------------------------------- /Static/CARI_Sample_Survey/CARI_Sample_Data.csv: -------------------------------------------------------------------------------- 1 | EnuName,HHSize,FCS,FCSCat21,FCSCat28,rCSI,stress_coping_FS,crisis_coping_FS,emergency_coping_FS,Max_coping_behaviourFS,FES,Foodexp_4pt,MEB,SMEB,ECMEN_exclAsst,ECMEN_exclAsst_SMEB 2 | 1,5,49,3,3,5,0,0,0,1,.4953942,1,16000,10000,1,1 3 | 1,1,40,3,2,2,0,0,0,1,.4732546,1,16000,10000,1,1 4 | 1,6,45,3,3,6,0,0,0,1,.5091331,2,16000,10000,1,1 5 | 1,7,60.5,3,3,0,0,0,0,1,.4618442,1,16000,10000,0,0 6 | 1,1,31,2,2,1,0,0,0,1,.4991011,1,16000,10000,1,1 7 | 1,6,53.5,3,3,3,0,0,0,1,.6446792,2,16000,10000,0,1 8 | 1,8,32,2,2,2,0,0,0,1,.6769501,3,16000,10000,0,0 9 | 1,1,49,3,3,2,0,0,0,1,.572524,2,16000,10000,1,1 10 | 1,4,33.5,2,2,0,0,0,0,1,.6417425,2,16000,10000,0,1 11 | 1,7,55,3,3,4,1,1,0,3,.687196,3,16000,10000,0,1 12 | 1,8,60.5,3,3,2,1,1,0,3,.6106977,2,16000,10000,0,0 13 | 1,4,60,3,3,1,1,1,0,3,.5564316,2,16000,10000,1,1 14 | 1,7,77,3,3,2,1,0,0,2,.7148188,3,16000,10000,0,0 15 | 2,2,37.5,3,2,1,1,1,0,3,.6412954,2,16000,10000,1,1 16 | 2,1,70.5,3,3,0,1,1,1,4,.5892565,2,16000,10000,1,1 17 | 2,6,54,3,3,3,1,1,1,4,.7165903,3,16000,10000,0,1 18 | 2,2,80,3,3,0,1,1,1,4,.6824883,3,16000,10000,1,1 19 | 2,2,38.5,3,2,7,1,1,1,4,.7563765,4,16000,10000,1,1 20 | 3,9,35,2,2,1,1,1,1,4,.7706251,4,16000,10000,0,0 21 | 2,6,69.5,3,3,9,1,1,0,3,.7154579,3,16000,10000,0,0 22 | 2,3,68,3,3,10,1,1,1,4,.6943224,3,16000,10000,1,1 23 | 2,6,70.5,3,3,0,1,1,1,4,.7252741,3,16000,10000,0,1 24 | 3,9,50.5,3,3,18,1,1,1,4,.8216792,4,16000,10000,0,0 25 | 3,5,52.5,3,3,0,1,1,1,4,.8555816,4,16000,10000,0,1 26 | 3,7,0,1,1,16,1,0,1,4,.8083127,4,16000,10000,0,0 27 | 3,9,16,1,1,2,1,1,1,4,.8005462,4,16000,10000,0,0 28 | 3,4,45.5,3,3,22,1,1,1,4,.7564421,4,16000,10000,0,1 29 | 3,10,45.5,3,3,11,1,1,1,4,.7662261,4,16000,10000,0,0 30 | 3,7,47.5,3,3,26,1,1,0,3,.8184933,4,16000,10000,0,0 31 | 3,4,43.5,3,3,11,1,1,1,4,.8067598,4,16000,10000,0,1 32 | -------------------------------------------------------------------------------- /Static/EBI_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | ADMIN5Name,RespSex,HHHSex,EBIFFAPart,EBISoilFertility,EBIStabilization,EBISanitation 2 | Community A,0,0,1,1,1,9999 3 | Community A,0,0,1,1,1,9999 4 | Community A,1,1,1,1,1,9999 5 | Community A,1,0,1,1,1,9999 6 | Community A,1,1,1,1,1,9999 7 | Community A,1,0,1,1,1,9999 8 | Community A,1,1,1,1,1,9999 9 | Community A,0,1,1,1,1,9999 10 | Community A,0,0,1,1,1,9999 11 | Community A,0,1,1,1,1,9999 12 | Community A,0,0,1,0,1,9999 13 | Community A,0,1,1,0,1,9999 14 | Community A,0,0,1,0,1,9999 15 | Community A,1,1,1,0,1,9999 16 | Community A,1,1,1,0,1,9999 17 | Community A,0,1,1,0,0,9999 18 | Community A,1,0,1,0,0,9999 19 | Community A,0,0,1,0,0,9999 20 | Community A,1,0,1,0,0,9999 21 | Community A,0,1,1,0,0,9999 22 | Community B,0,1,1,1,1,1 23 | Community B,0,0,1,1,1,1 24 | Community B,1,1,1,1,1,1 25 | Community B,1,1,1,1,1,1 26 | Community B,1,1,1,1,1,1 27 | Community B,0,1,1,1,1,0 28 | Community B,1,0,1,1,1,0 29 | Community B,1,0,1,1,1,0 30 | Community B,1,1,1,1,1,0 31 | Community B,0,1,1,1,1,0 32 | Community B,0,1,1,0,1,0 33 | Community B,0,0,1,0,1,0 34 | Community B,1,0,1,0,1,0 35 | Community B,1,0,1,0,1,0 36 | Community B,1,1,1,0,1,0 37 | Community B,0,1,1,0,0,0 38 | Community B,1,0,1,0,0,0 39 | Community B,0,1,1,0,0,0 40 | Community B,1,1,1,0,0,0 41 | Community B,0,0,1,0,0,0 42 | Community B,0,1,1,0,0,0 43 | Community B,1,0,1,0,0,0 44 | Community B,1,1,1,0,0,0 45 | Community B,1,0,1,0,0,0 46 | Community B,1,1,1,0,0,0 47 | Community B,0,1,1,0,0,0 48 | Community B,1,1,1,0,0,0 49 | Community B,0,0,1,0,0,0 50 | Community B,1,0,1,0,0,0 51 | Community B,1,0,1,0,0,0 52 | -------------------------------------------------------------------------------- /Static/EIG_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | SvyDate,EnuName,EnuSupervisorName,EnuPartner,EnuSex,HHID,ADMIN0Name,ADMIN1Name,ADMIN2Name,ADMIN3Name,ADMIN4Name,ADMIN5Name,Settlement,RESPConsent,RESPAge,RESPRelationHHH,RESPRelationHHH_oth,HHHAge,HHSize01M,HHSize01F,HHSize24M,HHSize24F,HHSize511M,HHSize511F,HHSize1217M,HHSize1217F,HHSize1859M,HHSize1859F,HHSize60AboveM,HHSize60AboveF,HHCaregiver,HHCaregiver_oth,HHHSex,HHSizeCalc,HHTrainingSize,RepeatPAsstEIG_count,PTrainingTypes/0,PTrainingTypes/1,PTrainingTypes/2,PTrainingTypes/3,PTrainingEffect,PTrainingNoEffectRsn/1,PTrainingNoEffectRsn/2,PTrainingNoEffectRsn/3,PTrainingNoEffectRsn/4,PTrainingNoEffectRsn/5,PTrainingNoEffectRsn/6,PTrainingNoEffectRsn/7,PTrainingNoEffectRsn/8,PTrainingNoEffectRsn/9,PTrainingNoEffectRsn/999,PTrainingSkillUse,PNoSkillUseRsn/1,PNoSkillUseRsn/2,PNoSkillUseRsn/3,PNoSkillUseRsn/4,PNoSkillUseRsn/5,PNoSkillUseRsn/6,PNoSkillUseRsn/999,PPostTrainingEmpl,PPostTrainingIncome,PEmplTypeFirst,PEmplDurationCl,PPostTrainingNewEmpl,PTrainingNoEffectRsn_oth,PNoSkillUseRsn_oth,PEmplTypeFirst_oth,PTrainingTypes/0,PTrainingTypes/1,PTrainingTypes/2,PTrainingTypes/3,PTrainingEffect,PTrainingNoEffectRsn/1,PTrainingNoEffectRsn/2,PTrainingNoEffectRsn/3,PTrainingNoEffectRsn/4,PTrainingNoEffectRsn/5,PTrainingNoEffectRsn/6,PTrainingNoEffectRsn/7,PTrainingNoEffectRsn/8,PTrainingNoEffectRsn/9,PTrainingNoEffectRsn/999,PTrainingSkillUse,PNoSkillUseRsn/1,PNoSkillUseRsn/2,PNoSkillUseRsn/3,PNoSkillUseRsn/4,PNoSkillUseRsn/5,PNoSkillUseRsn/6,PNoSkillUseRsn/999,PPostTrainingEmpl,PPostTrainingIncome,PEmplTypeFirst,PEmplDurationCl,PPostTrainingNewEmpl,PTrainingNoEffectRsn_oth,PNoSkillUseRsn_oth,PEmplTypeFirst_oth,start,end,today,deviceid,instanceID,_id,_uuid,_submission_time,_date_modified,_tags,_notes,_version,_duration,_submitted_by,_total_media,_media_count,_media_all_received,_xform_id 2 | 2022-08-09,1,1,0,1,1,1,1,1,1,1,1,Area 1,1,25,100,n/a,n/a,1,0,0,3,4,1,3,0,2,1,0,1,100,n/a,1,16,2,2,0,1,0,0,2,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,1,n/a,n/a,n/a,n/a,n/a,n/a,n/a,1,1,1,1,n/a,n/a,n/a,n/a,0,1,0,0,2,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,1,n/a,n/a,n/a,n/a,n/a,n/a,n/a,1,0,4,2,n/a,n/a,n/a,n/a,2022-08-09T12:15:39.556+02:00,2022-08-09T12:18:27.376+02:00,2022-08-09,collect:ejNz0I9xdrOOSd08,uuid:119a3ac7-2a1b-4957-8d9d-e51708144640,24330690,119a3ac7-2a1b-4957-8d9d-e51708144640,2022-08-09T10:36:56,2022-08-09T10:36:56,,,202208091014,168.0,valerio_axsar,0,0,True,39751 3 | 2022-08-09,1,1,0,1,2,1,1,1,1,1,1,Area 1,1,29,300,n/a,59,3,1,0,0,1,0,1,0,2,3,0,1,300,n/a,1,12,1,1,0,0,1,0,2,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,1,n/a,n/a,n/a,n/a,n/a,n/a,n/a,1,1,5,3,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,2022-08-09T12:18:31.416+02:00,2022-08-09T12:20:53.634+02:00,2022-08-09,collect:ejNz0I9xdrOOSd08,uuid:8bb281ac-9c95-4cdc-af84-c10a3ee5037a,24330693,8bb281ac-9c95-4cdc-af84-c10a3ee5037a,2022-08-09T10:36:57,2022-08-09T10:36:57,,,202208091014,142.0,valerio_axsar,0,0,True,39751 4 | 2022-08-09,1,1,0,1,3,1,1,1,1,1,1,Area 2,1,35,500,n/a,39,1,2,0,0,3,1,0,2,3,1,0,0,500,n/a,1,13,2,2,0,0,1,0,2,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,n/a,1,n/a,n/a,n/a,n/a,n/a,n/a,n/a,1,0,1,4,n/a,n/a,n/a,n/a,0,0,1,0,4,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,n/a,n/a,n/a,1,n/a,n/a,n/a,n/a,2022-08-09T12:20:59.506+02:00,2022-08-09T12:23:30.244+02:00,2022-08-09,collect:ejNz0I9xdrOOSd08,uuid:b8380860-21b3-4c20-9c9e-a11b25cd6d79,24330695,b8380860-21b3-4c20-9c9e-a11b25cd6d79,2022-08-09T10:36:57,2022-08-09T10:36:57,,,202208091014,151.0,valerio_axsar,0,0,True,39751 5 | -------------------------------------------------------------------------------- /Static/ENA_vulnerability_classification/ENA_vulnerability_classification_Test.csv: -------------------------------------------------------------------------------- 1 | FCS,FCSCat21,FCSCat28,rCSI,stress_coping,crisis_coping,emergency_coping,Max_coping_behaviourEN,ECMEN_exclAsst_SMEB,ECMEN_exclAsst 2 | 56,3,3,0,1,0,0,2,0,0 3 | 41,3,2,5,1,1,0,3,0,0 4 | 33,2,2,10,1,0,0,2,0,0 5 | 30,2,2,13,0,1,1,4,0,0 6 | 37,3,2,12,0,0,0,1,0,0 7 | 44,3,3,9,1,1,0,3,0,0 8 | 58,3,3,2,1,0,0,2,0,0 9 | 93,3,3,0,0,0,0,1,0,0 10 | 60,3,3,0,1,0,0,2,0,0 11 | 36,3,2,0,1,1,0,3,0,0 12 | 46,3,3,2,0,1,0,3,0,0 13 | 56,3,3,9,1,0,0,2,0,0 14 | 39,3,2,4,1,1,1,4,0,0 15 | 48,3,3,3,0,1,1,4,0,0 16 | 37,3,2,15,1,1,0,3,0,0 17 | 52,3,3,6,1,1,0,3,0,0 18 | 67,3,3,2,1,1,0,3,0,0 19 | 45,3,3,2,1,1,0,3,0,0 20 | 39,3,2,0,0,0,0,1,0,0 21 | 37,3,2,0,1,1,0,3,0,0 22 | 56,3,3,0,1,0,0,2,0,0 23 | 43,3,3,1,1,1,0,3,0,0 24 | 43,3,3,1,1,1,0,3,0,0 25 | 50,3,3,1,1,1,0,3,0,0 26 | 41,3,2,4,1,0,0,2,0,0 27 | 49,3,3,5,1,1,1,4,0,0 28 | 34,2,2,7,1,1,0,3,0,0 29 | 58,3,3,1,1,1,0,3,0,0 30 | 22,2,1,0,1,0,0,2,0,0 31 | 76,3,3,0,1,0,0,2,1,0 32 | 41,3,2,0,1,1,0,3,1,0 33 | 34,2,2,4,0,0,0,1,1,0 34 | 39,3,2,2,1,1,0,3,1,0 35 | 98,3,3,2,1,1,0,3,1,0 36 | 56,3,3,0,1,1,0,3,1,0 37 | 43,3,3,8,1,0,0,2,1,0 38 | 37,3,2,0,0,1,0,3,1,0 39 | 20,1,1,7,1,0,0,2,1,0 40 | 57,3,3,0,0,0,0,1,1,0 41 | 25,2,1,7,1,1,0,3,1,0 42 | 52,3,3,3,1,1,0,3,1,0 43 | 43,3,3,8,0,0,0,1,1,0 44 | 40,3,2,2,1,1,0,3,1,0 45 | 64,3,3,0,1,1,0,3,1,0 46 | 35,2,2,2,1,0,0,2,1,0 47 | 54,3,3,13,1,1,0,3,1,0 48 | 62,3,3,0,0,0,0,1,1,0 49 | 49,3,3,3,1,0,0,2,1,0 50 | 69,3,3,6,1,1,0,3,1,0 51 | 40,3,2,0,0,0,0,1,1,1 52 | 46,3,3,9,1,1,0,3,1,1 53 | 71,3,3,3,1,1,1,4,1,1 54 | 53,3,3,4,1,1,0,3,1,1 55 | 49,3,3,4,1,0,1,4,1,1 56 | 35,2,2,6,1,1,0,3,1,1 57 | 41,3,2,2,0,0,0,1,1,1 58 | 60,3,3,7,1,0,0,2,1,1 59 | 69,3,3,1,0,0,0,1,1,1 60 | 59,3,3,0,1,1,0,3,1,1 61 | 27,2,1,2,0,1,0,3,1,1 62 | 70,3,3,0,1,1,0,3,1,1 63 | 36,3,2,9,1,1,0,3,1,1 64 | 36,3,2,6,1,1,0,3,1,1 65 | 38,3,2,6,0,1,0,3,1,1 66 | 64,3,3,4,1,1,0,3,1,1 67 | 28,2,1,6,0,1,0,3,1,1 68 | 68,3,3,0,0,0,0,1,1,1 69 | 53,3,3,11,1,1,0,3,1,1 70 | 30,2,2,9,1,1,1,4,1,1 71 | 37,3,2,6,1,1,0,3,1,1 72 | 52,3,3,0,1,0,0,2,1,1 73 | 70,3,3,7,1,0,0,2,1,1 74 | 47,3,3,3,0,0,1,4,1,1 75 | 47,3,3,11,1,1,1,4,1,1 76 | 52,3,3,13,0,0,1,4,1,1 77 | 49,3,3,12,1,0,0,2,1,1 78 | 41,3,2,0,0,1,0,3,1,1 79 | 48,3,3,9,1,0,0,2,1,1 80 | 45,3,3,13,1,1,1,4,1,1 81 | 67,3,3,4,1,1,0,3,1,1 82 | 71,3,3,6,0,1,0,3,1,1 83 | 49,3,3,4,1,0,0,2,1,1 84 | 43,3,3,3,1,1,1,4,1,1 85 | 69,3,3,0,0,0,0,1,1,1 86 | 43,3,3,4,1,1,0,3,1,1 87 | 55,3,3,0,1,0,0,2,1,1 88 | 49,3,3,2,0,0,0,1,1,1 89 | 55,3,3,4,1,0,0,2,1,1 90 | 47,3,3,6,1,1,0,3,1,1 91 | 29,2,2,0,1,0,0,2,1,1 92 | 67,3,3,0,1,1,0,3,1,1 93 | 78,3,3,0,0,0,0,1,1,1 94 | 39,3,2,6,1,0,0,2,1,1 95 | 60,3,3,10,1,0,0,2,1,1 96 | 87,3,3,8,1,1,0,3,1,1 97 | 54,3,3,8,1,1,1,4,1,1 98 | 48,3,3,0,0,0,0,1,1,1 99 | 54,3,3,0,0,0,0,1,1,1 100 | 42,3,2,0,0,1,0,3,1,1 101 | 39,3,2,0,0,0,0,1,1,1 102 | -------------------------------------------------------------------------------- /Static/FCSN_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | FCSStap,FCSPulse,FCSDairy,FCSPr,FCSNPrMeatF,FCSNPrMeatO,FCSNPrFish,FCSNPrEggs,FCSVeg,FCSNVegOrg,FCSNVegGre,FCSFruit,FCSNFruiOrg,FCSFat,FCSSugar,FCSCond 2 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 3 | 1,2,1,0,n/a,n/a,n/a,n/a,1,1,1,3,1,3,2,1 4 | 7,1,0,0,n/a,n/a,n/a,n/a,2,1,1,7,2,5,7,6 5 | 3,1,6,6,6,1,2,1,7,7,0,0,n/a,1,5,0 6 | 3,6,0,3,1,3,1,1,7,4,3,1,1,6,3,3 7 | 1,1,5,7,7,1,1,1,5,4,1,4,2,7,6,3 8 | 2,2,1,3,2,1,1,1,3,3,1,5,3,6,2,7 9 | 1,3,0,4,2,2,0,0,4,4,0,3,2,2,7,5 10 | 0,2,5,6,6,1,2,3,0,n/a,n/a,0,n/a,1,3,4 11 | 1,2,3,3,2,2,1,0,4,2,2,3,3,0,1,4 12 | 2,6,3,1,1,0,0,1,6,1,6,1,1,3,7,0 13 | 1,3,0,7,3,5,1,1,1,1,1,5,3,5,0,3 14 | -------------------------------------------------------------------------------- /Static/FCS_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | FCSStap,FCSStap_SRf,FCSVeg,FCSVeg_SRf,FCSFruit,FCSFruit_SRf,FCSPr,FCSPr_SRf,FCSPulse,FCSPulse_SRf,FCSDairy,FCSDairy_SRf,FCSSugar,FCSSugar_SRf,FCSFat,FCSFat_SRf,FCSCond,FCSCond_SRf 2 | 7,100,5,100,3,600,2,800,4,600,1,300,6,600,0,n/a,2,800 3 | 1,200,2,200,3,700,1,999,2,700,5,600,4,700,2,200,6,999 4 | 7,300,4,300,2,800,2,1000,4,300,1,200,2,300,0,n/a,7,1000 5 | 2,400,4,400,7,999,7,600,5,600,0,n/a,5,600,0,n/a,0,n/a 6 | 1,500,1,500,3,1000,0,n/a,1,200,4,600,7,200,5,600,0,n/a 7 | 2,600,2,800,3,300,5,200,1,300,4,300,4,300,7,300,0,n/a 8 | 3,700,4,999,6,600,2,300,0,n/a,2,600,0,n/a,0,n/a,2,600 9 | 6,800,1,1000,2,200,3,500,4,400,2,700,0,n/a,4,400,0,n/a 10 | 5,999,1,300,2,300,0,n/a,0,n/a,4,100,3,300,6,100,4,200 11 | 3,1000,1,100,2,100,1,400,6,500,5,200,4,600,4,200,0,n/a 12 | 4,300,4,200,5,200,7,600,0,n/a,3,300,6,400,1,300,5,600 13 | 0,n/a,7,300,7,300,5,700,0,n/a,5,400,7,100,5,400,1,300 14 | 1,200,4,400,6,400,7,800,3,600,6,500,1,200,7,500,1,100 15 | 0,n/a,5,500,3,500,0,n/a,3,700,4,800,4,300,5,500,4,200 16 | 4,300,5,600,7,800,5,600,5,100,3,999,7,400,0,n/a,2,300 17 | 0,n/a,4,700,6,999,1,700,5,200,6,1000,1,500,1,600,5,400 18 | 3,400,6,800,7,1000,7,800,6,300,3,400,6,600,0,n/a,1,500 19 | 0,n/a,3,999,1,300,3,999,6,400,0,n/a,3,700,6,300,2,600 20 | 0,n/a,3,1000,5,400,3,1000,3,500,0,n/a,5,800,7,1000,1,700 21 | 4,600,2,600,7,500,5,300,5,800,3,800,4,999,7,1000,7,300 22 | 3,700,6,200,3,600,5,600,6,999,3,999,6,1000,0,n/a,4,600 23 | 3,800,5,300,4,700,1,800,6,1000,7,1000,6,300,5,300,0,n/a 24 | 1,999,3,400,1,800,3,999,2,600,6,500,2,500,3,600,1,600 25 | 6,1000,3,500,1,999,5,1000,2,600,1,600,6,800,7,800,5,400 26 | 0,n/a,0,n/a,0,n/a,0,n/a,0,n/a,0,n/a,0,n/a,0,n/a,0,n/a 27 | 1,600,1,600,1,1000,1,1000,1,700,1,700,1,700,1,700,1,500 28 | -------------------------------------------------------------------------------- /Static/Gender_CRF_C31_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | HHAsstWFPRecCashYN1Y,HHAsstWFPRecInKindYN1Y,RespSex,HHHSex,HHHStatus,HHAsstCashDescWho,HHAsstCashDescBest,HHAsstInKindDescWho,HHAsstInKindDescBest,HHNotEntitDescWho 2 | 0,1,1,1,300,n/a,n/a,20,0,20 3 | 0,0,0,0,200,n/a,n/a,n/a,n/a,n/a 4 | 1,0,1,0,200,30,1,n/a,n/a,20 5 | 1,1,0,1,300,20,0,20,0,30 6 | 1,0,1,0,300,20,1,n/a,n/a,20 7 | 1,1,1,1,200,30,0,20,1,20 8 | 1,0,0,1,300,20,0,n/a,n/a,10 9 | 0,1,0,1,300,n/a,n/a,30,0,20 10 | 1,0,1,1,200,20,0,n/a,n/a,20 11 | 1,1,1,1,300,20,0,20,1,20 12 | 1,1,0,1,200,20,1,20,1,20 13 | 1,1,0,0,400,n/a,n/a,n/a,n/a,n/a 14 | 1,0,0,1,300,20,0,n/a,n/a,20 15 | 1,1,0,1,300,10,1,20,0,20 16 | 1,0,1,0,200,20,1,n/a,n/a,20 17 | 1,1,1,0,300,30,0,30,1,20 18 | 1,1,1,1,300,10,1,20,1,10 19 | 0,0,0,0,300,n/a,n/a,n/a,n/a,n/a 20 | 0,1,1,0,300,n/a,n/a,20,0,10 21 | 1,1,0,1,300,20,1,20,1,10 22 | -------------------------------------------------------------------------------- /Static/LCS_Sample_Survey/LHCS_EN_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | LcsEN_stress_DomAsset,LcsEN_stress_Saving,LcsEN_stress_BorrowCash,LcsEN_stress_Utilities,LcsEN_crisis_ProdAssets,LcsEN_crisis_Health,LcsEN_crisis_OutSchool,LcsEN_em_ResAsset,LcsEN_em_Begged,LcsEN_em_IllegalAct,LhCSIEnAccess.1,LhCSIEnAccess.2,LhCSIEnAccess.3,LhCSIEnAccess.4,LhCSIEnAccess.5,LhCSIEnAccess.6,LhCSIEnAccess.7,LhCSIEnAccess.8,LhCSIEnAccess.999,LhCSIEnAccess_oth 2 | 20,10,10,10,10,10,10,10,10,10,1,1,1,1,1,1,1,1,1,test 3 | 20,20,20,20,20,20,20,20,20,20,1,0,0,0,0,0,0,0,0,n/a 4 | 30,30,30,30,30,30,30,30,30,30,0,0,1,0,0,0,0,0,0,n/a 5 | 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999,0,0,0,1,0,0,0,0,0,n/a 6 | 10,30,9999,10,10,10,10,10,20,20,0,1,0,0,0,1,1,1,0,n/a 7 | 20,10,10,20,20,20,10,20,10,10,0,0,1,1,0,0,1,0,1,test answer 8 | 9999,10,20,10,9999,10,10,10,10,20,0,0,0,0,1,0,1,0,0,n/a 9 | 10,10,10,20,30,20,20,30,20,10,0,0,1,0,1,0,0,1,0,n/a 10 | 10,20,10,20,20,10,20,10,9999,10,0,1,1,1,1,1,0,1,0,n/a 11 | 10,30,9999,10,10,10,20,10,20,20,1,0,0,1,0,1,0,1,0,n/a 12 | 30,10,10,20,20,10,9999,20,10,20,0,0,0,0,0,0,0,0,0,n/a 13 | 20,20,20,10,9999,10,10,20,10,10,0,1,1,0,0,1,0,0,1,test answer 14 | 10,10,10,10,30,10,10,30,20,10,0,0,0,1,1,1,0,0,0,n/a 15 | 9999,9999,10,20,20,10,20,10,9999,10,0,0,1,1,0,0,1,0,1,test answer 16 | -------------------------------------------------------------------------------- /Static/LCS_Sample_Survey/LHCS_FS_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | EnuName,Lcs_stress_DomAsset,Lcs_stress_Saving,Lcs_stress_BorrowCash,Lcs_stress_Utilities,Lcs_crisis_ProdAssets,Lcs_crisis_Health,Lcs_crisis_OutSchool,Lcs_em_ResAsset,Lcs_em_Begged,Lcs_em_IllegalAct 2 | 1,20,10,9999,30,30,30,30,30,30,30 3 | 1,20,30,10,20,10,30,30,20,10,20 4 | 1,10,10,10,10,10,10,10,10,10,10 5 | 1,20,20,20,30,20,9999,20,30,20,20 6 | 1,30,30,30,30,30,30,30,30,30,30 7 | 1,9999,9999,9999,9999,9999,9999,9999,9999,9999,9999 8 | 2,20,20,30,10,30,10,30,30,20,10 9 | 2,30,20,10,30,30,10,20,10,20,20 10 | 2,20,20,20,20,20,20,20,20,20,20 11 | 2,10,10,10,20,20,30,20,20,30,30 12 | 2,20,30,20,30,30,30,10,10,30,30 13 | 2,20,30,20,20,20,20,10,10,20,20 14 | 2,20,20,10,10,10,10,10,10,10,10 15 | 2,20,20,20,30,20,9999,20,30,20,20 16 | 3,10,10,10,20,20,30,20,20,30,30 17 | 3,20,30,20,20,20,20,10,10,20,20 18 | 3,10,20,30,999,10,20,10,20,10,20 19 | 3,20,10,20,10,20,9999,20,30,10,20 20 | 3,30,20,30,20,9999,10,30,30,30,30 21 | 3,10,10,10,20,30,10,10,10,10,10 22 | -------------------------------------------------------------------------------- /Static/Nut_CRF_7_coverage_Sample_Survey/Nutrition_module_NutProg_submodule_RepeatNutProg.csv: -------------------------------------------------------------------------------- 1 | Nutrition_module/NutProg_submodule/RepeatNutProg/position_nut7,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgParticName,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgParticSex,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgParticBDproof,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgParticBDknow,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgParticBD,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgParticAge_calc_years,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgParticAge_calc_months,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgPartic_yn,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgCard,Nutrition_module/NutProg_submodule/RepeatNutProg/PNoNutProgReason,Nutrition_module/NutProg_submodule/RepeatNutProg/PNoNutProgReason_other,Nutrition_module/NutProg_submodule/RepeatNutProg/PNoNutProgCardReason,Nutrition_module/NutProg_submodule/RepeatNutProg/PNoNutProgCardReason_other,_id,_uuid,_submission_time,_index,_parent_table_name,_parent_index,_tags,_notes,_version,_duration,_submitted_by,_xform_id 2 | 1,testey1,1,1,,11/14/2020,2,24,1,1,,,,,,,,1,data,1,,,,,, 3 | 1,testey2,0,0,1,10/12/2021,1,13,0,,3,,,,,,,2,data,2,,,,,, 4 | 1,testey3,0,1,,10/10/2020,2,25,0,,5,,,,,,,3,data,3,,,,,, 5 | 2,testey4,0,0,0,9/1/2019,3,38,1,1,,,,,,,,4,data,3,,,,,, 6 | 1,testey5,0,0,1,8/4/2021,1,15,0,,3,,,,,,,5,data,4,,,,,, 7 | 2,testey6,0,1,,11/30/2009,13,155,0,,2,,,,,,,6,data,4,,,,,, 8 | 1,testey9,0,1,,11/14/2022,0,0,1,1,,,,,,,,7,data,5,,,,,, 9 | -------------------------------------------------------------------------------- /Static/Nut_CRF_7_coverage_Sample_Survey/data.csv: -------------------------------------------------------------------------------- 1 | today,Nutrition_module/NutProg_submodule/EligNutProgNb,Nutrition_module/NutProg_submodule/RepeatNutProg_count,meta/instanceID,_id,_uuid,_submission_time,_index,_parent_table_name,_parent_index,_tags,_notes,_version,_duration,_xform_id 2 | 11/13/2022,1,1,uuid:9fe9c24a-5948-4745-86c3-63b403be7eec,28420938,9fe9c24a-5948-4745-86c3-63b403be7eec,11/14/2022 23:46,1,,-1,,,2.02211E+11,,44210 3 | 11/13/2022,1,1,uuid:13adbf61-fa50-42ac-8297-31359812d380,28420940,13adbf61-fa50-42ac-8297-31359812d380,11/14/2022 23:47,2,,-1,,,2.02211E+11,,44210 4 | 11/13/2022,2,2,uuid:8659878c-30d9-43ac-9020-d99c1ee1870c,28420967,8659878c-30d9-43ac-9020-d99c1ee1870c,11/14/2022 23:48,3,,-1,,,2.02211E+11,,44210 5 | 11/13/2022,2,2,uuid:1d273b61-b146-4391-b747-de6222797c23,28420968,1d273b61-b146-4391-b747-de6222797c23,11/14/2022 23:50,4,,-1,,,2.02211E+11,,44210 6 | 11/13/2022,1,1,uuid:e97cbe17-c365-42e7-8040-e50ba6dbb1a8,28420972,e97cbe17-c365-42e7-8040-e50ba6dbb1a8,11/14/2022 23:51,5,,-1,,,2.02211E+11,,44210 7 | -------------------------------------------------------------------------------- /Static/Nut_CRF_8_adherence_Sample_Survey/Nutrition_module_NutProg_submodule_RepeatNutProg.csv: -------------------------------------------------------------------------------- 1 | Nutrition_module/NutProg_submodule/RepeatNutProg/position_nut8,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgParticName,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgCard,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgShouldNbrCard,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgDidNbrCard,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutwhendate,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgShouldNbrNoCard,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgDidNbrNoCard,Nutrition_module/NutProg_submodule/RepeatNutProg/PNutProgEntitlements,Nutrition_module/NutProg_submodule/RepeatNutProg/PNoNutProgReason,Nutrition_module/NutProg_submodule/RepeatNutProg/PNoNutProgReason_other,Nutrition_module/NutProg_submodule/RepeatNutProg/PNoNutProgCardReason,Nutrition_module/NutProg_submodule/RepeatNutProg/PNoNutProgCardReason_other,_id,_uuid,_submission_time,_index,_parent_table_name,_parent_index,_tags,_notes,_version,_duration,_submitted_by,_xform_id 2 | 1,tester1,0,,,2022-11-15,3,3,food,,,3,,,,,1,data,1,,,,,, 3 | 1,tester1,1,3,2,,,,food,2,,,,,,,2,data,2,,,,,, 4 | 2,tester2,1,3,3,,,,food,,,,,,,,3,data,2,,,,,, 5 | 1,woofie,0,,,2022-11-15,3,3,stuff,,,2,,,,,4,data,3,,,,,, 6 | 2,woofie2,1,3,3,,,,dunno,,,,,,,,5,data,3,,,,,, 7 | 1,yo,1,3,1,,,,,1,,,,,,,6,data,4,,,,,, 8 | 2,gorg,1,3,1,,,,some stuff,2,,,,,,,7,data,4,,,,,, 9 | 3,b,1,3,1,,,,plumpy,3,,,,,,,8,data,4,,,,,, 10 | -------------------------------------------------------------------------------- /Static/Nut_CRF_8_adherence_Sample_Survey/data.csv: -------------------------------------------------------------------------------- 1 | today,Nutrition_module/NutProg_submodule/EligNutProgNb,Nutrition_module/NutProg_submodule/RepeatNutProg_count,meta/instanceID,_id,_uuid,_submission_time,_index,_parent_table_name,_parent_index,_tags,_notes,_version,_duration,_submitted_by,_xform_id 2 | 2022-11-14,1,1,uuid:940f33b7-5c85-49f4-99b1-ccce2fb7e5f7,28467921,940f33b7-5c85-49f4-99b1-ccce2fb7e5f7,2022-11-15 20:11:42,1,,-1,,,202211152010,,bolander,44264 3 | 2022-11-14,2,2,uuid:a2bfe928-d428-4ead-a613-e4781418cc88,28467937,a2bfe928-d428-4ead-a613-e4781418cc88,2022-11-15 20:12:30,2,,-1,,,202211152010,,bolander,44264 4 | 2022-11-14,2,2,uuid:a99a8238-5447-4be7-bb94-0efd89afd124,28467950,a99a8238-5447-4be7-bb94-0efd89afd124,2022-11-15 20:13:56,3,,-1,,,202211152010,,bolander,44264 5 | 2022-11-14,3,3,uuid:2b7c7327-83e5-47bc-b966-fee4cb2eebb2,28467991,2b7c7327-83e5-47bc-b966-fee4cb2eebb2,2022-11-15 20:15:02,4,,-1,,,202211152010,,bolander,44264 6 | -------------------------------------------------------------------------------- /Static/Nut_MAD_Sample_Survey/MAD_submodule_RepeatMAD.csv: -------------------------------------------------------------------------------- 1 | MAD_submodule/RepeatMAD/positionMAD,MAD_submodule/RepeatMAD/PCMADChildName,MAD_submodule/RepeatMAD/PCMADChildSex,MAD_submodule/RepeatMAD/PCMADChildBD,MAD_submodule/RepeatMAD/PCMADChildAge_calc_months,MAD_submodule/RepeatMAD/PCMADChildAge_months,MAD_submodule/RepeatMAD/PCMADEverBreastfed,MAD_submodule/RepeatMAD/PCMADBreastfeed,MAD_submodule/RepeatMAD/PCMADInfFormula,MAD_submodule/RepeatMAD/PCMADInfFormulaNum,MAD_submodule/RepeatMAD/PCMADMilk,MAD_submodule/RepeatMAD/PCMADMilkNum,MAD_submodule/RepeatMAD/PCMADYogurtDrink,MAD_submodule/RepeatMAD/PCMADYogurtDrinkNum,MAD_submodule/RepeatMAD/PCMADYogurt,MAD_submodule/RepeatMAD/PCMADStapCer,MAD_submodule/RepeatMAD/PCMADVegOrg,MAD_submodule/RepeatMAD/PCMADStapRoo,MAD_submodule/RepeatMAD/PCMADVegGre,MAD_submodule/RepeatMAD/PCMADVegOth,MAD_submodule/RepeatMAD/PCMADFruitOrg,MAD_submodule/RepeatMAD/PCMADFruitOth,MAD_submodule/RepeatMAD/PCMADPrMeatO,MAD_submodule/RepeatMAD/PCMADPrMeatPro,MAD_submodule/RepeatMAD/PCMADPrMeatF,MAD_submodule/RepeatMAD/PCMADPrEgg,MAD_submodule/RepeatMAD/PCMADPrFish,MAD_submodule/RepeatMAD/PCMADPulse,MAD_submodule/RepeatMAD/PCMADCheese,MAD_submodule/RepeatMAD/PCMADSnf,MAD_submodule/RepeatMAD/PCMADCheck,MAD_submodule/RepeatMAD/PCMADMeals,_id,_uuid,_submission_time,_index,_parent_table_name,_parent_index,_tags,_notes,_version,_duration,_submitted_by,_xform_id 2 | 1,test1,0,11/16/2021,12,12,1,1,1,7,1,7,1,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,1,data,1,,,,,, 3 | 1,test2,1,11/17/2021,12,13,0,,0,,1,1,1,1,1,888,0,1,1,0,1,1,0,1,0,1,1,0,0,1,,7,,,,2,data,2,,,,,, 4 | 2,test3,0,5/19/2021,18,18,0,,0,,1,2,0,,1,1,0,1,1,1,0,1,0,1,1,1,0,0,0,1,,2,,,,3,data,2,,,,,, 5 | 1,test3,1,,NaN,15,1,1,1,1,1,2,1,2,1,1,888,1,1,0,1,1,1,0,0,1,1,1,1,1,,5,,,,4,data,3,,,,,, 6 | 1,test4,1,,NaN,23,1,0,1,3,0,,1,888,1,1,0,0,1,1,0,0,1,0,0,1,0,1,888,1,,3,,,,5,data,4,,,,,, 7 | 2,test,1,4/13/2022,7,8,1,1,1,1,1,3,0,,1,0,1,0,0,0,1,1,888,0,1,1,0,1,0,1,,1,,,,6,data,4,,,,,, 8 | 1,d,1,,NaN,16,1,1,1,1,0,,888,,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,,2,,,,7,data,5,,,,,, 9 | 1,testname,1,5/5/2020,30,21,1,1,0,,1,1,1,3,1,0,1,0,1,0,1,1,0,1,0,0,1,0,0,0,,2,,,,8,data,6,,,,,, 10 | 1,test,1,,NaN,19,1,1,0,,0,,0,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,9,data,7,,,,,, 11 | 1,b,1,,NaN,14,0,,1,1,1,888,888,,888,888,888,888,888,888,888,888,888,888,888,888,888,888,888,0,,,,,,10,data,8,,,,,, 12 | 2,y,1,,NaN,9,1,1,0,,1,2,1,1,1,1,1,888,888,0,1,0,0,1,0,1,1,0,1,0,,888,,,,11,data,8,,,,,, 13 | 3,r,1,11/16/2021,12,12,1,888,888,,0,,0,,0,1,0,0,0,1,1,1,0,1,0,0,0,1,0,1,,1,,,,12,data,8,,,,,, 14 | 1,testtest,1,,NaN,17,1,0,1,888,0,,1,1,1,1,0,0,1,1,1,1,0,1,888,1,0,1,1,1,,1,,,,13,data,9,,,,,, 15 | 1,snftest,1,11/15/2021,12,12,1,0,0,,0,,0,,0,1,1,0,0,1,0,0,0,0,0,1,0,0,0,1,,3,,,,14,data,10,,,,,, 16 | 1,snf part 2,1,,NaN,6,0,,0,,0,,0,,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,1,,888,,,,15,data,11,,,,,, 17 | -------------------------------------------------------------------------------- /Static/Nut_MAD_Sample_Survey/data.csv: -------------------------------------------------------------------------------- 1 | MAD_submodule/InfantNb,MAD_submodule/RepeatMAD_count,meta/instanceID,_id,_uuid,_submission_time,_index,_parent_table_name,_parent_index,_tags,_notes,_version,_duration,_submitted_by,_xform_id 2 | 1,1,uuid:26277d2f-8afa-4e43-8f72-07cfd0537d4a,28594889,26277d2f-8afa-4e43-8f72-07cfd0537d4a,2022-11-17 21:33:18,1,,-1,,,202211172126,,bolander,44425 3 | 2,2,uuid:502b70d8-34bc-41ed-98e2-e6666a8c9948,28595051,502b70d8-34bc-41ed-98e2-e6666a8c9948,2022-11-17 21:49:28,2,,-1,,,202211172126,,bolander,44425 4 | 1,1,uuid:a154430f-36c2-4c4a-8d36-622ceb24bca3,28595169,a154430f-36c2-4c4a-8d36-622ceb24bca3,2022-11-17 21:54:56,3,,-1,,,202211172126,,bolander,44425 5 | 2,2,uuid:b4b7bb8a-20fb-4e36-a1a2-fa142678b4d0,28595238,b4b7bb8a-20fb-4e36-a1a2-fa142678b4d0,2022-11-17 21:56:59,4,,-1,,,202211172126,,bolander,44425 6 | 1,1,uuid:d02c5043-519b-4331-826f-f502b008a7e4,28595244,d02c5043-519b-4331-826f-f502b008a7e4,2022-11-17 21:57:58,5,,-1,,,202211172126,,bolander,44425 7 | 1,1,uuid:269a87d2-1d0c-47d4-a3cf-7f8a91ada76e,28595254,269a87d2-1d0c-47d4-a3cf-7f8a91ada76e,2022-11-17 21:59:27,6,,-1,,,202211172126,,bolander,44425 8 | 1,1,uuid:83eec86f-ea15-4ad6-b810-4ada814abc7b,28595261,83eec86f-ea15-4ad6-b810-4ada814abc7b,2022-11-17 22:00:11,7,,-1,,,202211172126,,bolander,44425 9 | 3,3,uuid:f4ffb798-59dd-4ff0-a1a5-b6cafd3d6bc3,28595353,f4ffb798-59dd-4ff0-a1a5-b6cafd3d6bc3,2022-11-17 22:03:28,8,,-1,,,202211172126,,bolander,44425 10 | 1,1,uuid:153e1af0-86c1-4b2a-83aa-2feffefe378a,28595376,153e1af0-86c1-4b2a-83aa-2feffefe378a,2022-11-17 22:04:23,9,,-1,,,202211172126,,bolander,44425 11 | 1,1,uuid:0db44c95-cbfd-4830-a5cc-ba371bd8481e,28629662,0db44c95-cbfd-4830-a5cc-ba371bd8481e,2022-11-18 15:06:28,10,,-1,,,202211172132,,bolander,44425 12 | 1,1,uuid:96ee40d8-76f2-427b-be86-05bbc3757b45,28629902,96ee40d8-76f2-427b-be86-05bbc3757b45,2022-11-18 15:22:24,11,,-1,,,202211172132,,bolander,44425 13 | -------------------------------------------------------------------------------- /Static/Nut_MDDW_Sample_Survey/Nutrition_module_MDD_W_submodule_RepeatMDDW.csv: -------------------------------------------------------------------------------- 1 | Nutrition_module/MDD_W_submodule/RepeatMDDW/MDDWRespAge,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWStapCer,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWStapRoo,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWPulse,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWNuts,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWMilk,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWDairy,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWPrMeatO,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWPrMeatF,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWPrMeatPro,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWPrMeatWhite,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWPrFish,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWPrEgg,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWVegGre,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWVegOrg,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFruitOrg,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWVegOth,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFruitOth,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWSnf,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWOptSalty,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWOptFried,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWInstaNoodl,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFastFood,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWOptSugarFood,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWOptSugarBev,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWOptInsects,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWWildPlants,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWOptFatRpalm,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWOptFatOth,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWOptCond,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWOptOthFood,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFortFood,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFortFoodoil,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFortFoodwflour,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFortFoodmflour,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFortFoodrice,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFortFooddrink,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFortFoodother,Nutrition_module/MDD_W_submodule/RepeatMDDW/PWMDDWFortFoodother_oth 2 | 33,0,0,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,,,,,,, 3 | 33,0,1,0,1,1,1,1,0,0,1,1,1,0,1,1,1,0,1,0,1,0,0,1,1,1,0,1,1,1,1,0,,,,,,, 4 | 32,0,1,1,0,0,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,0,0,0, 5 | 22,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,,,,,,1,stuff 6 | 35,0,1,1,0,0,1,1,1,0,1,0,1,1,0,0,0,0,1,0,1,0,0,1,1,0,1,0,0,1,1,0,,,,,,, 7 | 41,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,0,1,0,0,0,0,0,0, 8 | 22,0,0,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,0,0,1,0,1,0,1,0,1,0,0,0,,,,,,, 9 | 42,1,0,1,1,0,1,0,1,1,0,1,0,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,,,,,,, 10 | 15,1,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,,,,,,, 11 | 36,0,0,1,0,0,1,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0, 12 | 32,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,0,1,0,1,1,1,1,0,1,1,1,1,1,0,0,0,0,0, 13 | 32,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,,,,,,, 14 | 33,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0, 15 | 42,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, , , , , , , 16 | -------------------------------------------------------------------------------- /Static/Nut_MDDW_Sample_Survey/data.csv: -------------------------------------------------------------------------------- 1 | Nutrition_module/MDD_W_submodule/HHSize1549F,Nutrition_module/MDD_W_submodule/HHSize1549FAvailable,Nutrition_module/MDD_W_submodule/RepeatMDDW_count,meta/instanceID,_id,_uuid,_submission_time,_index,_parent_table_name,_parent_index,_tags,_notes,_version,_duration,_submitted_by,_xform_id 2 | 1,1,1,uuid:196eef5b-5177-46e5-bc40-2c17ed6cdc4b,28531382,196eef5b-5177-46e5-bc40-2c17ed6cdc4b,2022-11-16 19:57:02,1,,-1,,,202211161955,,bolander,44348 3 | 2,2,2,uuid:89ba4fb1-6e0c-46ab-8fc2-9aa151b8fbd9,28531440,89ba4fb1-6e0c-46ab-8fc2-9aa151b8fbd9,2022-11-16 20:00:32,2,,-1,,,202211161957,,bolander,44348 4 | 1,0,0,uuid:2c6854ee-d64f-43cd-afa9-94bfcc3fef6a,28531444,2c6854ee-d64f-43cd-afa9-94bfcc3fef6a,2022-11-16 20:01:02,3,,-1,,,202211161957,,bolander,44348 5 | 2,1,1,uuid:98a9ba1b-44c5-4760-ae73-555b15c063ce,28531538,98a9ba1b-44c5-4760-ae73-555b15c063ce,2022-11-16 20:06:14,4,,-1,,,202211161957,,bolander,44348 6 | 1,1,1,uuid:647644f0-b217-4b29-8469-e6aacf5574c3,28531555,647644f0-b217-4b29-8469-e6aacf5574c3,2022-11-16 20:06:56,5,,-1,,,202211161957,,bolander,44348 7 | 2,2,2,uuid:d871a5fa-cef8-430c-b0f1-a6abcdbd8108,28531624,d871a5fa-cef8-430c-b0f1-a6abcdbd8108,2022-11-16 20:08:23,6,,-1,,,202211161957,,bolander,44348 8 | 1,1,1,uuid:534b5217-3104-412e-ae0c-6b58bad90715,28531660,534b5217-3104-412e-ae0c-6b58bad90715,2022-11-16 20:09:02,7,,-1,,,202211161957,,bolander,44348 9 | 3,2,2,uuid:53025bcc-c49d-44bc-8d0b-4ab048ba1d20,28531773,53025bcc-c49d-44bc-8d0b-4ab048ba1d20,2022-11-16 20:10:48,8,,-1,,,202211161957,,bolander,44348 10 | 2,2,2,uuid:bdd994d7-cba5-4b94-909c-fa1659c11585,28531864,bdd994d7-cba5-4b94-909c-fa1659c11585,2022-11-16 20:12:41,9,,-1,,,202211161957,,bolander,44348 11 | 1,1,1,uuid:d2d2490d-9dd8-4cb0-8301-d3f0f9ceeab2,28531948,d2d2490d-9dd8-4cb0-8301-d3f0f9ceeab2,2022-11-16 20:13:51,10,,-1,,,202211161957,,bolander,44348 12 | -------------------------------------------------------------------------------- /Static/PROP_AAP_CRF_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | HHAsstSecurity,HHAsstAccess,HHAsstRespect,HHDTPDign,HHAsstKnowEnt,HHAsstKnowPeople,HHAsstRecInfo,HHAsstReportMisc,start,end,today,deviceid,instanceID 2 | 0,1,1,1,0,1,2,0,2022-11-10T17:03:25.853-06:00,2022-11-10T17:03:51.701-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:bf96321b-2579-4211-9110-b15e32a7f3e3 3 | 1,1,1,1,1,1,0,0,2022-11-10T17:03:51.733-06:00,2022-11-10T17:04:03.572-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:adb51d41-0d67-40a7-9f58-5ccd5b5a71fd 4 | 1,1,1,1,1,1,1,1,2022-11-10T17:04:03.593-06:00,2022-11-10T17:04:31.586-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:88a0db20-05dc-499f-8ecf-90c835105d6a 5 | 1,888,1,1,1,1,1,1,2022-11-10T17:04:31.606-06:00,2022-11-10T17:04:45.995-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:371e73e7-ced7-41f2-9b77-9c6fcc4f394b 6 | 1,1,1,1,1,1,1,1,2022-11-10T17:04:46.017-06:00,2022-11-10T17:05:22.365-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:06da5f4e-1502-467a-95e6-a09c3226cb0b 7 | 0,888,1,0,1,1,1,0,2022-11-10T17:05:22.394-06:00,2022-11-10T17:05:44.128-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:06b09821-8c31-4852-adc0-7abf7a44600d 8 | 0,0,0,0,0,0,0,0,2022-11-10T17:05:44.151-06:00,2022-11-10T17:05:57.162-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:fc6f6b7e-7af9-4f98-8c49-ec9cbd527c15 9 | 1,1,1,1,1,1,1,1,2022-11-10T17:05:57.191-06:00,2022-11-10T17:06:10.500-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:452fded4-1f41-407a-9aa1-71c35f4947ef 10 | 0,0,1,1,0,0,2,1,2022-11-10T17:06:10.522-06:00,2022-11-10T17:06:24.464-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:9a8f87ff-a126-45a7-820b-ca403fddfbfc 11 | 0,0,0,1,1,1,0,0,2022-11-10T17:06:24.495-06:00,2022-11-10T17:06:37.140-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:372b8d70-4112-465c-9473-ef7161608779 12 | 1,0,1,0,0,1,0,0,2022-11-10T17:06:37.169-06:00,2022-11-10T17:06:51.444-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:893b66b4-1fd9-4219-8d98-e75d6c09dc20 13 | 0,1,1,1,1,0,1,1,2022-11-10T17:06:51.474-06:00,2022-11-10T17:07:03.700-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:5bfe2a6c-4de2-46b7-9924-e5347e1d70b8 14 | 1,1,0,1,0,0,0,1,2022-11-10T17:07:03.731-06:00,2022-11-10T17:07:33.150-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:af2773fb-6c9f-4565-a965-6934d18d02f9 15 | 1,1,0,1,1,0,1,1,2022-11-10T17:07:33.180-06:00,2022-11-10T17:07:43.651-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:f16e85b6-a7b9-4bbb-9159-4556a1bfe35a 16 | 0,0,0,0,0,0,1,1,2022-11-10T17:07:43.676-06:00,2022-11-10T17:07:54.309-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:3386014e-bf73-481a-b4f9-9f41d8a018ce 17 | 0,1,0,1,0,1,0,1,2022-11-10T17:07:54.332-06:00,2022-11-10T17:08:10.315-06:00,11/9/2022,enketo.moda.wfp.org:S0TTzlhYN4wxX9fJ,uuid:db271c67-d4db-440d-b98c-e46d52ce1ec1 18 | -------------------------------------------------------------------------------- /Static/PRO_WG_Sample_Survey/HoHMethod/PRO_WG_HoH_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | HHAsstWFPRecCashYN1Y,HHAsstWFPRecInKindYN1Y,HHAsstWFPRecCapBuildYN1Y,RespSex,RESPRelationHHH,HHHSex,HHHAge,HHHDisabSee,HHHDisabHear,HHHDisabWalk,HHHDisabRemember,HHHDisabUnderstand,HHHDisabWash 2 | 1,0,1,1,300,1,42,2,3,1,1,4,1 3 | 0,1,1,1,200,0,34,3,3,3,3,1,1 4 | 1,1,1,1,100,1,22,1,1,999,1,999,1 5 | 1,0,1,1,402,1,33,888,888,1,1,4,4 6 | 0,0,0,1,402,0,43,1,1,1,2,2,1 7 | 0,0,0,1,200,0,55,1,2,1,2,1,2 8 | 1,1,0,0,200,1,34,2,2,4,2,4,3 9 | 0,1,1,1,300,1,71,1,2,1,4,2,3 10 | 1,0,1,0,200,0,75,1,1,4,2,1,4 11 | 0,0,1,0,100,0,52,3,1,2,2,1,4 12 | 1,1,1,1,402,0,80,2,3,1,2,1,2 13 | 1,0,0,0,402,1,53,2,4,1,3,3,2 14 | 0,1,0,0,200,1,39,4,3,2,2,1,2 15 | 1,1,0,0,200,0,34,1,1,4,2,3,1 16 | 0,0,1,0,200,1,62,888,888,888,888,888,888 17 | 0,0,1,0,100,0,28,999,999,999,999,999,999 18 | 0,0,1,0,100,1,99,2,1,1,3,2,2 19 | 1,1,0,0,200,0,56,4,1,1,2,4,2 20 | 0,0,0,0,300,1,56,4,3,2,1,2,3 21 | -------------------------------------------------------------------------------- /Static/PRO_WG_Sample_Survey/RosterMethod/Demographic_module_DisabilityHHMemb_submodule_RepeatDisabHHMembers.csv: -------------------------------------------------------------------------------- 1 | Demographic_module/DisabilityHHMemb_submodule/RepeatDisabHHMembers/PDisabName,Demographic_module/DisabilityHHMemb_submodule/RepeatDisabHHMembers/PDisabAge,Demographic_module/DisabilityHHMemb_submodule/RepeatDisabHHMembers/PDisabSex,Demographic_module/DisabilityHHMemb_submodule/RepeatDisabHHMembers/PDisabSee,Demographic_module/DisabilityHHMemb_submodule/RepeatDisabHHMembers/PDisabHear,Demographic_module/DisabilityHHMemb_submodule/RepeatDisabHHMembers/PDisabWalk,Demographic_module/DisabilityHHMemb_submodule/RepeatDisabHHMembers/PDisabRemember,Demographic_module/DisabilityHHMemb_submodule/RepeatDisabHHMembers/PDisabUnderstand,Demographic_module/DisabilityHHMemb_submodule/RepeatDisabHHMembers/PDisabWash,_parent_index 2 | baby bear,5,0,1,1,1,1,1,1,1 3 | momma bear,30,0,3,1,999,1,3,4,1 4 | pappa bear,31,1,4,3,2,2,3,3,1 5 | person a,31,0,4,3,3,3,4,4,2 6 | person b,32,1,3,3,2,3,3,4,3 7 | person b,12,0,888,888,888,888,888,888,3 8 | person c,13,0,4,4,1,1,3,2,3 9 | person1,12,1,1,1,1,1,2,3,4 10 | person2,14,1,2,3,1,3,3,3,4 11 | person3,6,0,3,3,2,4,2,3,4 12 | person 4,44,0,4,2,2,4,3,3,4 13 | person5,12,0,4,3,2,3,1,1,4 14 | person1,6,1,1,1,1,1,1,1,5 15 | peson2,23,0,1,1,1,1,1,1,5 16 | person3,25,1,2,1,1,1,1,1,5 17 | 1,44,1,999,999,999,999,999,999,6 18 | 2,22,1,888,3,888,888,888,888,6 19 | 3,33,1,4,4,4,4,4,4,6 20 | 4,44,1,3,3,3,3,3,3,6 21 | -------------------------------------------------------------------------------- /Static/PRO_WG_Sample_Survey/RosterMethod/data.csv: -------------------------------------------------------------------------------- 1 | TechnicalAdd_submodule/HHAsstWFPRecCashYN1Y,TechnicalAdd_submodule/HHAsstWFPRecInKindYN1Y,TechnicalAdd_submodule/HHAsstWFPRecCapBuildYN1Y,_index 2 | 0,0,0,1 3 | 0,0,0,2 4 | 1,0,1,3 5 | 0,1,1,4 6 | 1,0,0,5 7 | 1,0,1,6 8 | -------------------------------------------------------------------------------- /Static/Perceived_Needs_Sample_Survey/Perceived_Needs.csv: -------------------------------------------------------------------------------- 1 | HHPercNeedWater,HHPercNeedFood,HHPercNeedHousing,HHPercNeedToilet,HHPercNeedHygiene,HHPercNeedClothTex,HHPercNeedLivelihood,HHPercNeedDisabIll,HHPercNeedHealth,HHPercNeedSafety,HHPercNeedEducation,HHPercNeedCaregive,HHPercNeedInfo,HHPercNeedAsstInfo,CMPercNeedJustice,CMPercNeedGBViolence,CMPercNeedSubstAbuse,CMPercNeedMentalCare,CMPercNeedCaregiving,CMPercNeedOther,CMPercNeedOtherText,CMPercNeedRFirst,CMPercNeedRSec,CMPercNeedRThird 2 | 0,1,0,0,0,0,1,0,8888,0,0,8888,8888,0,0,0,0,0,8888,0, ,2,7, 3 | 1,1,1,1,1,0,0,0,0,0,0,8888,0,0,0,0,1,8888,0,1,Lack of internet,2,1,3 4 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, , , , 5 | 0,1,0,0,0,0,0,1,1,0,0,1,0,1,1,0,0,0,1,0, ,2,8,9 6 | 0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,0,0, ,10,7,11 7 | 8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,8888,0, , , , 8 | 1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,Lack of land for agriculture,1,2,3 9 | 0,0,0,0,0,0,1,1,1,0,0,0,0,0,8888,8888,0,0,8888,0, ,7,8,9 10 | 0,1,0,1,0,1,0,1,1,0,0,0,8888,8888,0,0,0,1,8888,0, ,8,9,2 11 | -------------------------------------------------------------------------------- /Static/RCSI_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | EnuName,rCSILessQlty,rCSIBorrow,rCSIMealSize,rCSIMealAdult,rCSIMealNb 2 | 1,6,0,3,0,0 3 | 1,4,0,2,0,0 4 | 1,0,3,3,3,0 5 | 1,0,0,0,0,0 6 | 1,3,0,0,0,0 7 | 1,5,2,2,0,2 8 | 1,4,0,2,0,0 9 | 1,4,2,2,0,0 10 | 1,2,0,0,0,0 11 | 1,5,2,3,0,0 12 | 1,3,0,3,0,0 13 | 1,3,0,0,2,0 14 | 1,3,2,3,0,0 15 | 1,3,2,2,0,0 16 | 1,2,0,0,0,0 17 | 1,4,0,3,0,2 18 | 1,0,0,0,0,0 19 | 1,2,1,3,4,0 20 | 1,3,0,0,0,0 21 | 1,4,1,3,0,0 22 | 1,3,2,3,0,0 23 | 2,0,0,0,0,0 24 | 2,2,3,2,2,2 25 | 2,0,0,0,0,0 26 | 2,2,2,2,2,2 27 | 2,2,0,0,0,0 28 | 2,2,2,2,3,3 29 | 2,2,2,3,0,2 30 | 2,3,4,3,3,3 31 | 2,2,1,2,1,2 32 | 2,0,0,0,0,0 33 | 2,2,2,0,2,3 34 | 2,2,3,2,3,0 35 | 2,3,3,2,2,2 36 | 2,2,0,0,0,0 37 | 2,1,2,1,3,2 38 | 2,0,0,0,0,0 39 | 2,3,2,2,3,2 40 | 2,2,3,2,1,2 41 | 2,2,1,1,1,1 42 | 2,0,2,0,0,1 43 | 2,2,0,3,2,2 44 | 3,3,2,2,2,3 45 | 3,3,0,2,0,0 46 | 3,2,2,2,2,3 47 | 3,2,2,2,3,3 48 | 3,3,2,3,2,2 49 | 3,1,1,0,2,3 50 | 3,2,2,2,2,3 51 | 3,2,2,1,1,2 52 | 3,1,2,2,2,1 53 | 3,3,3,2,2,3 54 | 3,2,2,3,2,2 55 | 3,1,1,2,1,3 56 | 3,2,0,0,0,0 57 | 3,2,2,2,1,2 58 | 3,2,0,2,3,3 59 | 3,1,2,1,2,3 60 | 3,0,0,0,0,0 61 | 3,0,0,0,0,0 62 | 3,2,0,0,0,0 63 | 3,1,2,3,3,3 64 | -------------------------------------------------------------------------------- /Static/RCS_Sample_Survey.csv: -------------------------------------------------------------------------------- 1 | HHRCSBounce,HHRCSRevenue,HHRCSIncrease,HHRCSFinAccess,HHRCSSupportCommunity,HHRCSSupportPublic,HHRCSLessonsLearnt,HHRCSFutureChallange,HHRCSWarningAccess,start,end,today,deviceid,instanceID,_id,_uuid,_submission_time,_date_modified,_tags,_notes,_version,_duration,_submitted_by,_total_media,_media_count,_media_all_received,_xform_id 2 | 1,1,1,1,1,1,1,1,1,2022-06-06T15:58:41.474+02:00,2022-06-06T15:58:57.030+02:00,2022-06-06,enketo.moda.wfp.org:NRkuvB7XepTy8Ims,uuid:80f60acb-b428-451d-b462-642b87c2baef,22056288,80f60acb-b428-451d-b462-642b87c2baef,2022-06-06T13:59:07,2022-06-06T13:59:07,,,202206061357,16.0,valerio_axsar,0,0,True,36443 3 | 1,3,1,3,1,3,1,3,1,2022-06-06T15:58:57.056+02:00,2022-06-06T15:59:20.608+02:00,2022-06-06,enketo.moda.wfp.org:NRkuvB7XepTy8Ims,uuid:b0e3f39f-68c7-4492-bee8-7a6e3ba95eec,22056308,b0e3f39f-68c7-4492-bee8-7a6e3ba95eec,2022-06-06T13:59:30,2022-06-06T13:59:30,,,202206061357,23.0,valerio_axsar,0,0,True,36443 4 | 3,5,3,5,3,5,3,5,3,2022-06-06T15:59:20.631+02:00,2022-06-06T15:59:37.376+02:00,2022-06-06,enketo.moda.wfp.org:NRkuvB7XepTy8Ims,uuid:8f83588f-26b6-4bf5-afbe-ee2cd9a576d4,22056331,8f83588f-26b6-4bf5-afbe-ee2cd9a576d4,2022-06-06T13:59:47,2022-06-06T13:59:47,,,202206061357,17.0,valerio_axsar,0,0,True,36443 5 | 5,5,5,5,5,5,5,5,5,2022-06-06T15:59:37.402+02:00,2022-06-06T15:59:51.677+02:00,2022-06-06,enketo.moda.wfp.org:NRkuvB7XepTy8Ims,uuid:6b5b883c-58ca-4b51-8aab-721859239290,22056339,6b5b883c-58ca-4b51-8aab-721859239290,2022-06-06T14:00:01,2022-06-06T14:00:01,,,202206061357,14.0,valerio_axsar,0,0,True,36443 6 | -------------------------------------------------------------------------------- /Static/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Static 2 | ## Static 3 | This folder contains _templates_ and _sample data_ to test the different scripts. 4 | Sample data should be downloaded from MoDa/ODK using following settings: 5 | Export as CSV, including the full range; select only _remove prefixed group name_ and _Use 1 or 0 in split select multiples (default is True or False)_ 6 | All other export advanced options should be deselected. 7 | See image below : 8 | 9 | ![image](https://user-images.githubusercontent.com/20227261/143473383-687a2008-2e2e-4e88-b80c-6f17f55464ae.png) 10 | -------------------------------------------------------------------------------- /Static/SAMS_CRF_30_PHL_Sample_Survey/SAMS_module_Indicator30_submodule_RepeatSAMSPHL.csv: -------------------------------------------------------------------------------- 1 | SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommName,SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommName_oth,SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommClass,SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommQntHand,SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommQntHandUnit,SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommQntHandUnit_oth,SAMS_module/Indicator30_submodule/RepeatSAMSPHL/PSAMSPHLCommQntLost,_parent_index 2 | 5,,2,1,2,,0.5,2 3 | 2,,1,10,2,,1,3 4 | 6,,2,5,2,,2,3 5 | 5,,2,10,2,,1,4 6 | 6,,2,6,3,,4,4 7 | 7,,3,1,2,,1,4 8 | 4,,3,32,2,,13,4 9 | 5,,2,300,3,,50,5 10 | 4,,3,12,2,,0,6 11 | 9,,3,30,2,,12,6 12 | 10,,2,2,2,,1,7 13 | 5,,3,3,2,,2,8 14 | 3,,2,1,3,,0,9 15 | 4,,3,2,2,,0.5,10 16 | 4,,3,3,1,,1.11,10 17 | -------------------------------------------------------------------------------- /Static/SAMS_CRF_30_PHL_Sample_Survey/data.csv: -------------------------------------------------------------------------------- 1 | SAMS_module/Indicator30_submodule/SAMSPHLComProdNb,SAMS_module/Indicator30_submodule/SAMSPHLComStoreNb,SAMS_module/Indicator30_submodule/RepeatSAMSPHL_count,meta/instanceID,_id,_uuid,_submission_time,_index,_parent_table_name,_parent_index,_tags,_notes,_version,_duration,_submitted_by,_xform_id 2 | 1,0,0,uuid:d5a88e00-b343-4ff5-98cf-95a0ba121d07,31607319,d5a88e00-b343-4ff5-98cf-95a0ba121d07,2023-02-12 00:02:17,1,,-1,,,202302120001,,bolander,48158 3 | 1,1,1,uuid:177132bb-3ca8-4929-ba2e-3925057c4919,31607321,177132bb-3ca8-4929-ba2e-3925057c4919,2023-02-12 00:02:50,2,,-1,,,202302120001,,bolander,48158 4 | 3,2,2,uuid:efcd6932-b534-4dcd-a36c-e80c6d3df473,31607323,efcd6932-b534-4dcd-a36c-e80c6d3df473,2023-02-12 00:03:28,3,,-1,,,202302120001,,bolander,48158 5 | 4,4,4,uuid:7d63304b-5471-4ebe-b67f-7659d45b9e6a,31607327,7d63304b-5471-4ebe-b67f-7659d45b9e6a,2023-02-12 00:04:41,4,,-1,,,202302120001,,bolander,48158 6 | 4,1,1,uuid:9cfca72c-5285-4c5c-845a-2ff232a1d3fb,31607328,9cfca72c-5285-4c5c-845a-2ff232a1d3fb,2023-02-12 00:05:05,5,,-1,,,202302120001,,bolander,48158 7 | 2,2,2,uuid:c1b915fa-d932-4792-8f08-733484032374,31607329,c1b915fa-d932-4792-8f08-733484032374,2023-02-12 00:05:35,6,,-1,,,202302120001,,bolander,48158 8 | 1,1,1,uuid:cd8cc55d-b6a0-4f17-b85c-67f3ef48af72,31607333,cd8cc55d-b6a0-4f17-b85c-67f3ef48af72,2023-02-12 00:05:51,7,,-1,,,202302120001,,bolander,48158 9 | 1,1,1,uuid:db3471a5-d11e-42a3-9096-c1f7142772ee,31607343,db3471a5-d11e-42a3-9096-c1f7142772ee,2023-02-12 00:06:13,8,,-1,,,202302120001,,bolander,48158 10 | 1,1,1,uuid:6646b9e5-0650-4a85-bef4-ad9b7f834d6d,31607346,6646b9e5-0650-4a85-bef4-ad9b7f834d6d,2023-02-12 00:06:46,9,,-1,,,202302120001,,bolander,48158 11 | 2,2,2,uuid:80cedeea-0199-487e-8cbe-baae4f60069a,31607347,80cedeea-0199-487e-8cbe-baae4f60069a,2023-02-12 00:07:18,10,,-1,,,202302120001,,bolander,48158 12 | -------------------------------------------------------------------------------- /Static/SAMS_CRF_31_NUT_Sample_Survey/SAMS_module_Indicator31_submodule_RepeatNutCrop.csv: -------------------------------------------------------------------------------- 1 | SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropName,SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropName_oth,SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropQuant,SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropQuantUnit,SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropQuantUnit_oth,SAMS_module/Indicator31_submodule/RepeatNutCrop/PSAMSNutCropIncr,_parent_index 2 | 4,,2,2,,2,1 3 | 2,,2,2,,1,1 4 | 1,,1,1,,1,2 5 | 1,,4,1,,2,3 6 | 1,,2,1,,3,4 7 | 2,,1,1,,1,4 8 | 1,,4,2,,2,5 9 | 2,,3,2,,2,5 10 | 2,,1,2,,2,6 11 | 1,,4,2,,1,6 12 | 3,,3,1,,1,7 13 | 2,,3,2,,1,7 14 | 3,,2,3,,1,7 15 | 1,,3,1,,1,8 16 | 5,,2,2,,9999,9 17 | 4,,6,1,,2,10 18 | 2,,7,2,,9999,10 19 | 4,,2,2,,1,11 20 | 4,,3,2,,3,12 21 | 1,,1,2,,1,13 22 | -------------------------------------------------------------------------------- /Static/SAMS_CRF_31_NUT_Sample_Survey/data.csv: -------------------------------------------------------------------------------- 1 | Demographic_module/DemographicBasic_submodule/RespSex,SAMS_module/Indicator31_submodule/SAMSNutCropNb,_index 2 | 0,2,1 3 | 1,1,2 4 | 1,1,3 5 | 0,2,4 6 | 1,2,5 7 | 0,2,6 8 | 0,3,7 9 | 1,1,8 10 | 1,1,9 11 | 1,2,10 12 | 0,1,11 13 | 0,1,12 14 | 1,1,13 15 | -------------------------------------------------------------------------------- /Static/SBP_CRF_63and93_Sample_Survey/data.csv: -------------------------------------------------------------------------------- 1 | SBPProcessM_module/SchoolAgeChildRoster_submodule/HHSchoolAgeChild,SBPProcessM_module/SchoolAgeChildRoster_submodule/RepeatSchoolAgeChild_count,start,end,today,deviceid,meta/instanceID,_id,_uuid,_submission_time,_index,_parent_table_name,_parent_index,_tags,_notes,_version,_duration,_submitted_by,_xform_id 2 | 3,3,2024-04-09T17:37:51.837-06:00,2024-04-09T17:43:34.982-06:00,2024-04-08,enketo.moda.wfp.org:ajJH8h2weLl1mN2L,uuid:12d82326-cff0-4a92-b601-38cabd695e80,51551780,12d82326-cff0-4a92-b601-38cabd695e80,2024-04-09 23:43:35,1,,-1,,,202404092336,343.0,bolander,129867 3 | 4,4,2024-04-09T17:43:35.036-06:00,2024-04-09T17:48:50.386-06:00,2024-04-08,enketo.moda.wfp.org:ajJH8h2weLl1mN2L,uuid:f4960656-dedd-497f-9d58-879e57a38daa,51551790,f4960656-dedd-497f-9d58-879e57a38daa,2024-04-09 23:48:51,2,,-1,,,202404092336,315.0,bolander,129867 4 | 1,1,2024-04-09T17:48:50.445-06:00,2024-04-09T17:50:04.242-06:00,2024-04-08,enketo.moda.wfp.org:ajJH8h2weLl1mN2L,uuid:a83c6da7-edbe-4622-a707-591e1b50b672,51551794,a83c6da7-edbe-4622-a707-591e1b50b672,2024-04-09 23:50:05,3,,-1,,,202404092336,74.0,bolander,129867 5 | 3,3,2024-04-09T17:50:04.272-06:00,2024-04-09T17:54:18.901-06:00,2024-04-08,enketo.moda.wfp.org:ajJH8h2weLl1mN2L,uuid:2dc715f4-0af2-4d27-a1d6-9887500e6d5e,51551799,2dc715f4-0af2-4d27-a1d6-9887500e6d5e,2024-04-09 23:54:19,4,,-1,,,202404092336,254.0,bolander,129867 6 | 2,2,2024-04-09T17:54:18.967-06:00,2024-04-09T17:56:49.238-06:00,2024-04-08,enketo.moda.wfp.org:ajJH8h2weLl1mN2L,uuid:b3846923-0716-44de-967b-1fe4ec2c8e0b,51551916,b3846923-0716-44de-967b-1fe4ec2c8e0b,2024-04-09 23:56:51,5,,-1,,,202404092336,151.0,bolander,129867 7 | 0,0,2024-04-09T17:56:49.294-06:00,2024-04-09T17:56:56.543-06:00,2024-04-08,enketo.moda.wfp.org:ajJH8h2weLl1mN2L,uuid:941a741e-d3cd-4a4c-8389-97180a551289,51551917,941a741e-d3cd-4a4c-8389-97180a551289,2024-04-09 23:56:57,6,,-1,,,202404092336,7.0,bolander,129867 8 | -------------------------------------------------------------------------------- /Static/SBP_CRF_63and93_Sample_Survey/spss_examplefiles.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WFP-VAM/RAMResourcesScripts/353e1b7ef4637c4a4db8079019ad8228bab4c9d1/Static/SBP_CRF_63and93_Sample_Survey/spss_examplefiles.zip -------------------------------------------------------------------------------- /StatisticalCleaning/README.md: -------------------------------------------------------------------------------- 1 | # RAM Resources - Scripts 2 | ## Statistical Cleaning 3 | 4 | This folder contains all standardized scripts for cleaning and replacing missing values based on analysis of the statistical distributions (_e.g.: expenditures above the 99th percentile of the distribution,…_) 5 | -------------------------------------------------------------------------------- /bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- / contribs.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WFP-VAM/RAMResourcesScripts/353e1b7ef4637c4a4db8079019ad8228bab4c9d1/ contribs.md --------------------------------------------------------------------------------