From b41b92b17b4527139d1725623d82df3a21516660 Mon Sep 17 00:00:00 2001 From: lara-moreschi Date: Thu, 10 Sep 2026 11:38:54 +0200 Subject: [PATCH 1/7] Upload ABI calculation script Create a sub-folder for the updated indicator 101. Percentage of population in targeted communities reporting benefits from an enhanced livelihoods asset base (ABI) under the new CRF 2026-2029. Upload R script for calculating the indicator in the sub-folder. The script follows the corporate methodology as explained in the indicator compendium. --- .../ABI-calculation.R | 215 ++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 Indicators/Asset Benefit Indicator (ABI)/ABI-calculation.R diff --git a/Indicators/Asset Benefit Indicator (ABI)/ABI-calculation.R b/Indicators/Asset Benefit Indicator (ABI)/ABI-calculation.R new file mode 100644 index 0000000..84c058f --- /dev/null +++ b/Indicators/Asset Benefit Indicator (ABI)/ABI-calculation.R @@ -0,0 +1,215 @@ +# 1. Load the packages you need for this analysis. +# If any of these are missing, install them first. +pkgs <- c("tidyverse", "labelled", "readr") +to_install <- pkgs[!pkgs %in% installed.packages()[, "Package"]] +if (length(to_install) > 0) install.packages(to_install) + +library(tidyverse) +library(labelled) +library(readr) + +# 2. Load your dataset. +# IMPORTANT: +# Replace the example below with the full path to your csv file. +# Use forward slashes "/" in the path. + +# Example (do NOT copy as-is): +# data <- read_csv("C:/Users/name.lastname/Documents/YourFolder/ABI_Survey_Data.csv") + +# Write your own path and file name here: +data <- read_csv("C:/.../.../ABI_Survey_Data.csv") + +# 3. Clean missing values. +data[] <- lapply(data, function(x) { + if (is.character(x)) { + x <- trimws(x) + x[tolower(x) %in% c("na", "nan", "n/a")] <- NA + } + x +}) + +# 4. Assign variable and value labels. +# Variable labels. +var_label(data$HHFFAPart) <- "Have you or any of your household member participated in the asset creation activities and received a food assistance transfer?" +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 sudden onset natural shocks (floods, mudslides, landslides, etc.)?" +var_label(data$HHAssetWaterAccess) <- "Do you think that the assets that were built or rehabilitated in your community have improved your household water access/availability due to rehabilitated irrigation systems, restored water points, and water conservation practices?" +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 due to greater water availability and/or soil fertility (e.g., increased or diversified production in agriculture, livestock or other)?" +var_label(data$HHAssetAccess) <- "Do you think that the assets that were built or rehabilitated in your community have improved or restored the ability of your household to access markets and/or basic services due to roads and community infrastructure built or restored (schools, grain stores, medical centers, sanitation, waste management facilities, etc.)?" +var_label(data$HHAssetEnv) <- "Do you think that the assets that were built or rehabilitated in your community have improved your natural environment due to land stabilization/rehabilitation, afforestation (for example more vegetal cover, water availability, water table increased, increase in indigenous flora/fauna, less erosion or siltation of field, etc.)?" +var_label(data$HHTrainingAsset) <- "Do you think that the trainings and other support provided in your community have improved your household’s and community's ability to manage and maintain livelihood assets due to better knowledge, more time availability, or financial resources?" +var_label(data$HHAssetDecHardship) <- "Do you think that the assets that were built or rehabilitated in your community have reduced hardship and/or increased time availability for any of your family members (including women and children)?" + +# Value labels. +data <- data %>% + dplyr::mutate(across( + c(HHAssetProtect, HHAssetWaterAccess, HHAssetProduct, + HHAssetAccess, HHAssetEnv, HHTrainingAsset, HHAssetDecHardship), + ~ labelled(., + labels = c("No" = 0, + "Yes" = 1, + "Not applicable" = 9999)) + )) + +data$HHFFAPart <- labelled( + data$HHFFAPart, + labels = c("No" = 0, "Yes" = 1) +) + +data$HHFFAPart <- as.numeric(data$HHFFAPart) + +# 5. ABI sample size. +# Households with enough information to calculate ABI (at least one of the ABI components non-missing). +ABI_sample_size <- data %>% + dplyr::summarise( + N_ABI = sum( + !is.na(ABIaCalcProtect) | + !is.na(ABIbCalcWaterAccess) | + !is.na(ABIcCalcProduct) | + !is.na(ABIdCalcAccess) | + !is.na(ABIeCalcEnvBenefit) | + !is.na(ABIfCalcTraining) | + !is.na(ABIgCalcDHardship) + ) + ) + +ABI_sample_size + +# 5b. ABI sample size by participants vs non-participants. +# Households with enough information to calculate ABI (at least one of the ABI components non-missing), by participation status. +ABI_sample_size_by_group <- data %>% + dplyr::filter( + !is.na(ABIaCalcProtect) | + !is.na(ABIbCalcWaterAccess) | + !is.na(ABIcCalcProduct) | + !is.na(ABIdCalcAccess) | + !is.na(ABIeCalcEnvBenefit) | + !is.na(ABIfCalcTraining) | + !is.na(ABIgCalcDHardship) + ) %>% + dplyr::summarise( + Participants = sum(HHFFAPart == 1, na.rm = TRUE), + Non_participants = sum(HHFFAPart == 0, na.rm = TRUE), + Total = dplyr::n() + ) + +# 6. Calculate the % of households reporting each type of benefit. +# These variables (ABIaCalcProtect–ABIgCalcDHardship) are already calculated in MoDa and coded 1 = Yes, 0 = No. +# This section calculates the % of households that reported each benefit. +ABI_disaggregated <- data %>% + dplyr::filter( + !is.na(ABIaCalcProtect) | + !is.na(ABIbCalcWaterAccess) | + !is.na(ABIcCalcProduct) | + !is.na(ABIdCalcAccess) | + !is.na(ABIeCalcEnvBenefit) | + !is.na(ABIfCalcTraining) | + !is.na(ABIgCalcDHardship) + ) %>% + dplyr::summarise( + ABIa = mean(ABIaCalcProtect, na.rm = TRUE), + ABIb = mean(ABIbCalcWaterAccess, na.rm = TRUE), + ABIc = mean(ABIcCalcProduct, na.rm = TRUE), + ABId = mean(ABIdCalcAccess, na.rm = TRUE), + ABIe = mean(ABIeCalcEnvBenefit, na.rm = TRUE), + ABIf = mean(ABIfCalcTraining, na.rm = TRUE), + ABIg = mean(ABIgCalcDHardship, na.rm = TRUE) + ) %>% + dplyr::mutate(across(dplyr::everything(), ~ round(.x * 100, 1))) + +# Add the corresponding label to each ABI component. +ABI_labels <- tibble( + component = c("ABIa", "ABIb", "ABIc", "ABId", "ABIe", "ABIf", "ABIg"), + label = c( + "a) Improved protection from sudden onset natural shocks", + "b) Improved water access availability", + "c) Increased or diversified production", + "d) Improved access to markets/basic services", + "e) Improved natural environment", + "f) Improved asset management/maintenance", + "g) Reduced hardship / increased time availability" + ) +) + +ABI_disaggregated_final <- ABI_disaggregated %>% + tidyr::pivot_longer(dplyr::everything(), names_to = "component", values_to = "percent") %>% + dplyr::left_join(ABI_labels, by = "component") %>% + dplyr::mutate(percent = paste0(percent, "%")) %>% + dplyr::select(label, percent) + +# 6b. Calculate the % of households reporting each type of benefit, disaggregated by participation status. +ABI_disaggregated_by_group <- data %>% + dplyr::filter( + !is.na(ABIaCalcProtect) | + !is.na(ABIbCalcWaterAccess) | + !is.na(ABIcCalcProduct) | + !is.na(ABIdCalcAccess) | + !is.na(ABIeCalcEnvBenefit) | + !is.na(ABIfCalcTraining) | + !is.na(ABIgCalcDHardship) + ) %>% + dplyr::group_by(HHFFAPart) %>% + dplyr::summarise( + ABIa = mean(ABIaCalcProtect, na.rm = TRUE), + ABIb = mean(ABIbCalcWaterAccess, na.rm = TRUE), + ABIc = mean(ABIcCalcProduct, na.rm = TRUE), + ABId = mean(ABIdCalcAccess, na.rm = TRUE), + ABIe = mean(ABIeCalcEnvBenefit, na.rm = TRUE), + ABIf = mean(ABIfCalcTraining, na.rm = TRUE), + ABIg = mean(ABIgCalcDHardship, na.rm = TRUE) + ) %>% + dplyr::mutate( + dplyr::across( + -HHFFAPart, + ~ round(.x * 100, 1) + ) + ) %>% + tidyr::pivot_longer( + cols = -HHFFAPart, + names_to = "component", + values_to = "percent" + ) %>% + dplyr::mutate( + group = dplyr::case_when( + HHFFAPart == 1 ~ "Participants", + HHFFAPart == 0 ~ "Non-participants" + ) + ) %>% + dplyr::left_join(ABI_labels, by = "component") %>% + dplyr::select(label, group, percent) + +ABI_disaggregated_by_group_final <- ABI_disaggregated_by_group %>% + tidyr::pivot_wider( + names_from = group, + values_from = percent + ) %>% + dplyr::mutate( + dplyr::across( + -label, + ~ paste0(.x, "%") + ) + ) +# 7. Calculate the overall ABI indicator. +ABI_overall <- tibble( + ABI_overall = paste0(max(unlist(ABI_disaggregated), na.rm = TRUE), "%") +) + +# 7b. Calculate the overall ABI indicator, disaggregated by participation status. +ABI_overall_by_group <- ABI_disaggregated_by_group %>% + dplyr::group_by(group) %>% + dplyr::summarise( + ABI_overall = max(percent, na.rm = TRUE) + ) %>% + dplyr::mutate( + ABI_overall = paste0(ABI_overall, "%") + ) + +# 8. Print final outputs. +ABI_disaggregated_final +ABI_overall +ABI_sample_size + +# 8b. Print final outputs, disaggregated by participation status. +ABI_disaggregated_by_group_final +ABI_overall_by_group +ABI_sample_size_by_group + From e7b8ff8c90b5b034faefd62783fbedf98bf9f3b9 Mon Sep 17 00:00:00 2001 From: lara-moreschi Date: Thu, 10 Sep 2026 11:52:34 +0200 Subject: [PATCH 2/7] Create sub-folder for ABI sample data Create sub-folder for ABI sample data under Static. --- Static/ABI_Sample_Survey/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Static/ABI_Sample_Survey/README.md diff --git a/Static/ABI_Sample_Survey/README.md b/Static/ABI_Sample_Survey/README.md new file mode 100644 index 0000000..1a791cf --- /dev/null +++ b/Static/ABI_Sample_Survey/README.md @@ -0,0 +1 @@ +Sample data for Asset Benefit Indicator (ABI) calculation. From ddad913f457a112330aa91c533be1b7cd8cff850 Mon Sep 17 00:00:00 2001 From: lara-moreschi Date: Thu, 10 Sep 2026 11:53:27 +0200 Subject: [PATCH 3/7] Upload sample data for ABI calculation Upload sample data for ABI calculation under relevant sub-folder. --- Static/ABI_Sample_Survey/ABI_sample_data.csv | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Static/ABI_Sample_Survey/ABI_sample_data.csv diff --git a/Static/ABI_Sample_Survey/ABI_sample_data.csv b/Static/ABI_Sample_Survey/ABI_sample_data.csv new file mode 100644 index 0000000..3be6261 --- /dev/null +++ b/Static/ABI_Sample_Survey/ABI_sample_data.csv @@ -0,0 +1,11 @@ +SvyDate,EnuPartner,EnuSupervisorName,EnuName,EnuSex,ADMIN0Name,ADMIN1Name,ADMIN2Name,ADMIN3Name,ADMIN4Name,RESPConsent,PAsstWFPRecCashYN1Y,PAsstWFPRecInKindYN1Y,PAsstWFPRecCapBuildYN1Y,RESPName,RESPLastName,RESPAge,RESPSex,RESPRelationHHH,RESPRelationHHH_oth,FreeResp,CallBack,EnuComments,CallBestH,phonenum_1,HHFFAPart,HHAssetProtect,HHAssetWaterAccess,HHAssetProduct,HHAssetAccess,HHAssetEnv,HHTrainingAsset,HHAssetDecHardship,ABIaCalcProtect,ABIbCalcWaterAccess,ABIcCalcProduct,ABIdCalcAccess,ABIeCalcEnvBenefit,ABIfCalcTraining,ABIgCalcDHardship,start,end,today,deviceid,instanceID,_id,_uuid,_submission_time,_date_modified,_tags,_notes,_version,_duration,_submitted_by,_last_edited_by,_total_media,_media_count,_media_all_received,_xform_id +2026-08-11,1,1,1,0,1,1,1,1,1,1,1,0,0,n/a,n/a,24,0,200,n/a,n/a,n/a,n/a,n/a,n/a,1,1,1,1,0,0,1,0,1,1,1,0,0,1,0,2026-08-11T11:32:53.033+02:00,2026-08-11T11:33:45.711+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:c0df9fec-a6ca-4c89-89f3-297f0760df7a,92651711,c0df9fec-a6ca-4c89-89f3-297f0760df7a,2026-08-11T09:33:45.920214+00:00,2026-08-11T09:33:45.982922+00:00,,,202608110932,52.0,laramoreschi,,0,0,True,391655 +2026-08-11,1,1,1,1,1,1,1,1,1,1,n/a,n/a,n/a,n/a,n/a,30,1,100,n/a,n/a,n/a,n/a,n/a,n/a,1,0,0,1,1,0,0,9999,0,0,1,1,0,0,0,2026-08-11T11:33:45.722+02:00,2026-08-11T11:36:15.177+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:9f4170d5-e83c-4d50-8d8d-aab06f8af9f0,92651954,9f4170d5-e83c-4d50-8d8d-aab06f8af9f0,2026-08-11T09:36:15.702379+00:00,2026-08-11T09:36:15.757500+00:00,,,202608110932,150.0,laramoreschi,,0,0,True,391655 +2026-08-11,1,1,1,0,1,1,1,1,1,1,0,0,0,n/a,n/a,25,0,100,n/a,n/a,n/a,n/a,n/a,n/a,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,2026-08-11T11:36:15.188+02:00,2026-08-11T11:36:55.325+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:36b32b24-a1fd-4d84-9ca0-a78e9d84fef8,92652017,36b32b24-a1fd-4d84-9ca0-a78e9d84fef8,2026-08-11T09:36:55.551657+00:00,2026-08-11T09:36:55.601827+00:00,,,202608110932,40.0,laramoreschi,,0,0,True,391655 +2026-08-11,1,1,1,0,1,1,1,1,1,1,1,0,0,n/a,n/a,46,1,100,n/a,n/a,n/a,n/a,n/a,n/a,0,1,1,9999,0,1,0,0,1,1,0,0,1,0,0,2026-08-11T11:36:55.342+02:00,2026-08-11T11:38:19.320+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:479427af-7a88-48e8-8f3c-e6c1003edf5e,92652076,479427af-7a88-48e8-8f3c-e6c1003edf5e,2026-08-11T09:38:19.667009+00:00,2026-08-11T09:38:19.756641+00:00,,,202608110932,84.0,laramoreschi,,0,0,True,391655 +2026-08-11,1,1,1,1,1,1,1,1,1,1,1,0,1,n/a,n/a,21,0,200,n/a,n/a,n/a,n/a,n/a,n/a,1,9999,1,0,9999,1,1,1,0,1,0,0,1,1,1,2026-08-11T11:38:19.333+02:00,2026-08-11T11:39:17.978+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:9ca4f975-e49d-47e3-8980-d41117c67249,92652087,9ca4f975-e49d-47e3-8980-d41117c67249,2026-08-11T09:39:18.181681+00:00,2026-08-11T09:39:18.237722+00:00,,,202608110932,58.0,laramoreschi,,0,0,True,391655 +2026-08-11,1,1,1,0,1,1,1,1,1,1,0,0,1,n/a,n/a,60,1,400,n/a,n/a,n/a,n/a,n/a,n/a,0,1,1,1,1,9999,0,0,1,1,1,1,0,0,0,2026-08-11T11:39:17.989+02:00,2026-08-11T11:40:53.335+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:7b8a47a1-18d1-44db-967d-478d81f66196,92652224,7b8a47a1-18d1-44db-967d-478d81f66196,2026-08-11T09:40:53.679389+00:00,2026-08-11T09:40:53.774327+00:00,,,202608110932,96.0,laramoreschi,,0,0,True,391655 +2026-08-11,1,1,1,0,1,1,1,1,1,1,1,0,0,n/a,n/a,34,0,100,n/a,n/a,n/a,n/a,n/a,n/a,1,0,0,0,1,0,1,1,0,0,0,1,0,1,1,2026-08-11T11:40:53.345+02:00,2026-08-11T11:41:47.062+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:e8577369-1195-470f-981a-c9d258287980,92652448,e8577369-1195-470f-981a-c9d258287980,2026-08-11T09:41:47.270393+00:00,2026-08-11T09:41:47.328325+00:00,,,202608110932,54.0,laramoreschi,,0,0,True,391655 +2026-08-11,1,1,1,1,1,1,1,1,1,1,1,0,0,n/a,n/a,52,1,100,n/a,n/a,n/a,n/a,n/a,n/a,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,2026-08-11T11:41:47.073+02:00,2026-08-11T11:42:42.287+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:c0ac776e-9514-4a47-9180-906cd9240cdc,92652642,c0ac776e-9514-4a47-9180-906cd9240cdc,2026-08-11T09:42:42.511199+00:00,2026-08-11T09:42:42.574813+00:00,,,202608110932,55.0,laramoreschi,,0,0,True,391655 +2026-08-11,1,1,1,1,1,1,1,1,1,1,0,1,0,n/a,n/a,25,0,100,n/a,n/a,n/a,n/a,n/a,n/a,1,0,1,0,1,1,1,1,0,1,0,1,1,1,1,2026-08-11T11:42:42.299+02:00,2026-08-11T11:43:22.206+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:d24958e0-7455-44f2-82ae-75b8fc01cdb4,92652763,d24958e0-7455-44f2-82ae-75b8fc01cdb4,2026-08-11T09:43:22.427198+00:00,2026-08-11T09:43:22.489640+00:00,,,202608110932,40.0,laramoreschi,,0,0,True,391655 +2026-08-11,1,1,1,0,1,1,1,1,1,1,0,0,1,n/a,n/a,41,1,100,n/a,n/a,n/a,n/a,n/a,n/a,1,9999,9999,1,0,1,1,0,0,0,1,0,1,1,0,2026-08-11T11:43:22.221+02:00,2026-08-11T11:45:59.252+02:00,2026-08-11,enketo.moda.wfp.org:PLOVOaSrnpIVCwLW,uuid:af913846-1fc4-4c61-812c-1b02eddb1008,92652944,af913846-1fc4-4c61-812c-1b02eddb1008,2026-08-11T09:45:59.596668+00:00,2026-08-11T09:45:59.658915+00:00,,,202608110932,157.0,laramoreschi,,0,0,True,391655 From 3247e5a08841de0d95491e2a967c70d16e305653 Mon Sep 17 00:00:00 2001 From: lara-moreschi Date: Thu, 10 Sep 2026 11:55:05 +0200 Subject: [PATCH 4/7] Delete ABI-CRF-25 sub-folder Delete ABI-CRF-25 sub-folder as this is no longer relevant under CRF 2026-29. This has now been replaced by a new sub-folder with updated script for indicator calculation following the new corporate methodology. --- Indicators/ABI-CRF-25/abi25.sps | 73 ------------------------- Indicators/ABI-CRF-25/abi25_tidyverse.R | 61 --------------------- 2 files changed, 134 deletions(-) delete mode 100644 Indicators/ABI-CRF-25/abi25.sps delete mode 100644 Indicators/ABI-CRF-25/abi25_tidyverse.R diff --git a/Indicators/ABI-CRF-25/abi25.sps b/Indicators/ABI-CRF-25/abi25.sps deleted file mode 100644 index 82b3309..0000000 --- a/Indicators/ABI-CRF-25/abi25.sps +++ /dev/null @@ -1,73 +0,0 @@ -* Encoding: UTF-8. - -* define variable and value labels - -Variable labels HHFFAPart "Have you or any of your household member participated in the asset creation activities and received a food assistance transfer?". - 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?". - 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)?". - 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)?". - 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)?". - 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?". - 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.)?". - 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?". - - Value labels HHFFAPart 1 'Yes' 0 'No'. -Value labels HHAssetProtect HHAssetProduct HHAssetDecHardship HHAssetAccess HHTrainingAsset HHAssetEnv HHWorkAsset 1 'Yes' 0 'No' 9999 "Not applicable". - -*take a look at of responses by community and note how many questions (and which were not answered by each community) for each community - -CROSSTABS - /TABLES= HHAssetProtect HHAssetProduct HHAssetDecHardship HHAssetAccess HHTrainingAsset HHAssetEnv HHWorkAsset BY ADMIN5Name - /CELLS=COUNT - /COUNT ROUND CELL. - -* recode 9999 to 0 - -RECODE HHAssetProtect HHAssetProduct HHAssetDecHardship HHAssetAccess HHTrainingAsset HHAssetEnv HHWorkAsset (9999=0) (0=0) (1=1). -EXECUTE. - - -*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 - -do if ADMIN5Name = "Community A". -compute ABIdenom =5. -else. -compute ABIdenom = 6. -end if. -EXECUTE. - -*Create ABI score (summing all response) and ABI percent (dividing total score by denominator of applicaple questions) - -Compute ABIScore = sum(HHAssetProtect,HHAssetProduct,HHAssetDecHardship,HHAssetAccess,HHTrainingAsset,HHAssetEnv,HHWorkAsset). -Compute ABIPerc = ((ABIScore / ABIdenom) * 100). -EXECUTE. - - -* Creates table of values - participants vs non-participants - -DATASET DECLARE ABIperc_particp. -AGGREGATE - /OUTFILE='ABIperc_particp' - /BREAK=HHFFAPart - /ABIPerc_mean=MEAN(ABIPerc). - -* calculate the ABI across using weight value of 2 for non-participants which accounts for sampling imbalance between participants and non-participants -* if ration of participants vs non-participants is not 2/1 then a more sophisticated method for creating weights should be used - -Dataset Activate ABIperc_particp. -do if HHFFAPart = 0. -compute ABIperc_wtd =2. -else. -compute ABIperc_wtd = 1. -end if. -EXECUTE. - -* add weight for non particpant and compute average - -compute ABIperc_total_partic = ((ABIPerc_mean * ABIperc_wtd)/3). -EXECUTE. - -AGGREGATE - /OUTFILE=* MODE=ADDVARIABLES - /BREAK= - /ABIperc_total =SUM(ABIperc_total_partic). diff --git a/Indicators/ABI-CRF-25/abi25_tidyverse.R b/Indicators/ABI-CRF-25/abi25_tidyverse.R deleted file mode 100644 index a5e1362..0000000 --- a/Indicators/ABI-CRF-25/abi25_tidyverse.R +++ /dev/null @@ -1,61 +0,0 @@ -library(tidyverse) -library(labelled) -library(expss) - -#import dataset -data <- read_csv("~/GitHub/RAMResourcesScripts/Static/ABI_Sample_Survey.csv") - -#assign variable and value labels -var_label(data$HHFFAPart) <- "Have you or any of your household member participated in the asset creation activities and received a food assistance transfer?" -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?" -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)?" -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)?" -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)?" -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?" -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.)?" -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?" - -data <- data %>% - mutate(across(c(HHAssetProtect,HHAssetProduct,HHAssetDecHardship,HHAssetAccess,HHTrainingAsset,HHAssetEnv,HHWorkAsset), ~labelled(., labels = c( - "No" = 0, - "Yes" = 1, - "Not applicable" = 9999 - )))) - -val_lab(data$HHFFAPart) = num_lab(" - 0 No - 1 Yes -") - -#recode 999 to 0 -data <- data %>% - mutate(across(HHAssetProtect:HHWorkAsset, ~ dplyr::recode(.x, "0" = 0, "1" = 1, "9999" = 0))) - - -#sum ABI rows -data <- data %>% - mutate(ABIScore = rowSums(across(c(HHAssetProtect:HHWorkAsset)))) - -#create denominator of questions asked -data <- data %>% mutate(ABIdenom = case_when( - ADMIN5Name == "Community A" ~ 5, - ADMIN5Name == "Community B" ~ 6 -)) - -#create % ABI for each respondent -data <- data %>% mutate(ABIperc = round((ABIScore/ABIdenom)*100)) - -#create table comparing ABI % of participants and non-participants by village -ABIperc_particp_ADMIN5Name <- data %>% mutate(HHFFAPart_lab = to_character(HHFFAPart)) %>% group_by(ADMIN5Name, HHFFAPart_lab) %>% summarize(ABIperc = mean(ABIperc)) - -#create table presenting ABI % participants vs non-particpants (average across villages) -ABIperc_particp <- data %>% mutate(HHFFAPart_lab = to_character(HHFFAPart)) %>% group_by(HHFFAPart_lab) %>% summarize(ABIperc = mean(ABIperc)) - -#calculate the ABI across using weight value of 2 for non-participants which accounts for sampling imbalance between nonparticipants and participants -#if ratio of participants/vs non-participants is not 2/1 then a more sophisticated method for creating weights should be used. -ABIperc_total <- ABIperc_particp %>% mutate(ABIperc_wtd = case_when(HHFFAPart_lab == "No" ~ ABIperc *2, TRUE ~ ABIperc)) %>% ungroup() %>% summarize(ABIperc_total = sum(ABIperc_wtd)/3) - - - - - \ No newline at end of file From 4c342359b7566762052002235feee1bf3f2f195b Mon Sep 17 00:00:00 2001 From: lara-moreschi Date: Thu, 10 Sep 2026 11:57:46 +0200 Subject: [PATCH 5/7] Delete Environmental-Benefit-Indicator-CRF-26 sub-folder Delete Environmental-Benefit-Indicator-CRF-26 sub-folder as this is no longer relevant under CRF 2026-29. The indicator has been merged into the new ABI as per the updated corporate methodology. --- .../ebi26.sps | 63 ------------------- .../ebi26_tidyverse.R | 62 ------------------ 2 files changed, 125 deletions(-) delete mode 100644 Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26.sps delete mode 100644 Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26_tidyverse.R diff --git a/Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26.sps b/Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26.sps deleted file mode 100644 index 7c401c5..0000000 --- a/Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26.sps +++ /dev/null @@ -1,63 +0,0 @@ -* Encoding: UTF-8. -* define variable and value labels - -Variable labels EBIFFAPart 'Have you or any of your household member participated in the asset creation activities and received a food assistance transfer?'. -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)'. -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.)?'. -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)?'. - -Value labels EBIFFAPart 1 'Yes' 0 'No'. -Value labels EBISoilFertility EBIStabilization EBISanitation 1 'Yes' 0 'No' 9999 'Not applicable'. - -*take a look at of responses by community and note how many questions were answered for each community - -CROSSTABS - /TABLES= EBISoilFertility EBIStabilization EBISanitation BY ADMIN5Name - /CELLS=COUNT - /COUNT ROUND CELL. - -* recode 9999 to 0 - -RECODE EBISoilFertility EBIStabilization EBISanitation (9999=0) (0=0) (1=1). -EXECUTE. - -* create table of % of yes responses to each of the 3 questions by ADMIN5Name - -DATASET DECLARE table_allperc. -SORT CASES BY ADMIN5Name. -AGGREGATE - /OUTFILE='table_allperc' - /PRESORTED - /BREAK=ADMIN5Name - /EBISoilFertility_mean=MEAN(EBISoilFertility) - /EBIStabilization_mean=MEAN(EBIStabilization) - /EBISanitation_mean=MEAN(EBISanitation) . - -DATASET ACTIVATE table_allperc. -COMPUTE EBISoilFertility_perc=EBISoilFertility_mean * 100. -COMPUTE EBIStabilization_perc=EBIStabilization_mean * 100. -COMPUTE EBISanitation_perc=EBISanitation_mean * 100. -EXECUTE. - -*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 - -DATASET ACTIVATE table_allperc. -do if ADMIN5Name = "Community A". - -compute EBIdenom =2. -else. -compute EBIdenom = 3. -end if. -EXECUTE. - -*calculate EBI by community - -DATASET ACTIVATE table_allperc. -compute EBI_ADMIN5Name = (EBISoilFertility_perc + EBIStabilization_perc + EBISanitation_perc) / EBIdenom. -EXECUTE. - -*finally calculate total EBI average EBI across all communities - -DATASET ACTIVATE table_allperc. -DESCRIPTIVES VARIABLES=EBI_ADMIN5Name - /STATISTICS=MEAN. diff --git a/Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26_tidyverse.R b/Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26_tidyverse.R deleted file mode 100644 index 9e161d6..0000000 --- a/Indicators/Environmental-Benefit-Indicator-CRF-26/ebi26_tidyverse.R +++ /dev/null @@ -1,62 +0,0 @@ -library(tidyverse) -library(labelled) -library(expss) - -#import dataset -data <- read_csv("~/GitHub/RAMResourcesScripts/Static/EBI_Sample_Survey.csv") - -#assign variable and value labels -var_label(data$EBIFFAPart) <- "Have you or any of your household member participated in the asset creation activities and received a food assistance transfer?" -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)?" -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.)?" -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)?" - -val_lab(data$EBIFFAPart) = num_lab(" - 0 No - 1 Yes -") - -data <- data %>% - mutate(across(c(EBISoilFertility,EBIStabilization,EBISanitation), ~labelled(., labels = c( - "No" = 0, - "Yes" = 1, - "Not applicable" = 999 - )))) - -#recode 9999 to 0 -data <- data %>% - mutate(across(EBISoilFertility:EBISanitation, ~ dplyr::recode(.x, "0" = 0, "1" = 1, "9999" = 0))) - - -#create 3 tables with the % of yes responses to each of the 3 questions by ADMIN5Name - -table_perc_soilfert <- data %>% group_by(ADMIN5Name) %>% - summarize(n = n(), EBISoilFertility_tot = sum(EBISoilFertility)) %>% mutate(EBISoilFertility_perc = round(((EBISoilFertility_tot / n) * 100),1)) %>% select(ADMIN5Name,EBISoilFertility_perc) - -table_perc_stab <- data %>% group_by(ADMIN5Name) %>% - summarize(n = n(), EBIStabilization_tot = sum(EBIStabilization)) %>% mutate(EBIStabilization_perc = round(((EBIStabilization_tot / n) * 100),1)) %>% select(ADMIN5Name,EBIStabilization_perc) - -table_perc_san <- data %>% group_by(ADMIN5Name) %>% - summarize(n = n(), EBISanitation_tot = sum(EBISanitation)) %>% mutate(EBISanitation_perc = round(((EBISanitation_tot / n) * 100),1)) %>% select(ADMIN5Name,EBISanitation_perc) - -#join together the perc values of each of the three tables -table_allperc <- table_perc_soilfert %>% left_join(table_perc_stab, by='ADMIN5Name') %>% left_join(table_perc_san, by='ADMIN5Name') - - - -#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 -num_quest_table <- data %>% count(ADMIN5Name) %>% mutate(EBIdenom = case_when( - ADMIN5Name == "Community A" ~ 2, - ADMIN5Name == "Community B" ~ 3 -)) %>% select(-n) - -#join table with percentages of each question with the table with count of number of questions (EBIdenom) -perc_denom_table <- table_allperc %>% left_join(num_quest_table, by='ADMIN5Name') -#then calculate EBI by community -EBI_ADMIN5Name <- perc_denom_table %>% mutate(EBI_ADMIN5Name = ((EBISoilFertility_perc + EBIStabilization_perc + EBISanitation_perc) / EBIdenom)) - -#finally calculate total EBI combining all communities -EBI_overall <- EBI_ADMIN5Name %>% summarize(EBI_overall = round(mean(EBI_ADMIN5Name),1)) - - - From 4d90dde318694b1382bb74c7eb584f812ca18373 Mon Sep 17 00:00:00 2001 From: lara-moreschi Date: Thu, 10 Sep 2026 12:00:23 +0200 Subject: [PATCH 6/7] Delete ABI_Sample_Survey Delete the previously uploaded ABI sample survey as this is no longer relevant under the new CRF 2026-29. This has been replaced by a new sample dataset with the structure of the updated XLSForm available in SurveyDesigner for collecting the indicator. --- Static/ABI_Sample_Survey.csv | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 Static/ABI_Sample_Survey.csv diff --git a/Static/ABI_Sample_Survey.csv b/Static/ABI_Sample_Survey.csv deleted file mode 100644 index 373b38f..0000000 --- a/Static/ABI_Sample_Survey.csv +++ /dev/null @@ -1,31 +0,0 @@ -ADMIN5Name,RespSex,HHHSex,HHFFAPart,HHAssetProtect,HHAssetProduct,HHAssetDecHardship,HHAssetAccess,HHTrainingAsset,HHAssetEnv,HHWorkAsset -Community A,0,0,1,1,1,0,0,0,9999,9999 -Community A,0,1,1,1,1,1,1,0,9999,9999 -Community A,1,1,1,1,1,1,1,1,9999,9999 -Community A,0,1,1,0,1,0,1,0,9999,9999 -Community A,1,1,1,0,0,0,0,0,9999,9999 -Community A,0,1,1,0,0,0,1,0,9999,9999 -Community A,1,0,1,1,0,1,0,0,9999,9999 -Community A,0,0,1,1,0,1,1,1,9999,9999 -Community A,0,1,1,1,1,1,1,1,9999,9999 -Community A,0,0,1,0,0,0,0,0,9999,9999 -Community A,0,0,0,0,1,0,0,0,9999,9999 -Community A,0,0,0,1,1,1,0,0,9999,9999 -Community A,1,0,0,0,0,0,1,1,9999,9999 -Community A,0,0,0,0,0,0,1,0,9999,9999 -Community A,1,1,0,0,0,0,0,0,9999,9999 -Community B,0,1,1,1,1,1,0,0,0,9999 -Community B,0,1,1,0,0,1,1,1,1,9999 -Community B,0,1,1,0,1,1,1,1,1,9999 -Community B,0,0,1,1,1,1,1,1,1,9999 -Community B,1,0,1,0,0,0,0,0,0,9999 -Community B,1,1,1,0,1,0,0,0,0,9999 -Community B,1,1,1,1,1,0,1,0,1,9999 -Community B,1,1,1,1,1,1,1,1,1,9999 -Community B,1,1,1,0,1,1,1,0,0,9999 -Community B,0,1,1,0,1,0,0,1,0,9999 -Community B,0,0,0,0,1,1,0,0,0,9999 -Community B,0,1,0,0,1,1,1,1,0,9999 -Community B,1,1,0,0,0,0,0,1,1,9999 -Community B,1,0,0,0,0,0,0,0,0,9999 -Community B,0,1,0,0,1,0,0,0,0,9999 From d5fa5b2b8deff497dbd27ba64579cbb27c101a17 Mon Sep 17 00:00:00 2001 From: lara-moreschi Date: Thu, 10 Sep 2026 12:01:29 +0200 Subject: [PATCH 7/7] Delete EBI_Sample_Survey Delete the EBI sample survey as this is no longer relevant under the new CRF 2026-29, since the indicator has been merged into the new ABI. --- Static/EBI_Sample_Survey.csv | 51 ------------------------------------ 1 file changed, 51 deletions(-) delete mode 100644 Static/EBI_Sample_Survey.csv diff --git a/Static/EBI_Sample_Survey.csv b/Static/EBI_Sample_Survey.csv deleted file mode 100644 index 1202239..0000000 --- a/Static/EBI_Sample_Survey.csv +++ /dev/null @@ -1,51 +0,0 @@ -ADMIN5Name,RespSex,HHHSex,EBIFFAPart,EBISoilFertility,EBIStabilization,EBISanitation -Community A,0,0,1,1,1,9999 -Community A,0,0,1,1,1,9999 -Community A,1,1,1,1,1,9999 -Community A,1,0,1,1,1,9999 -Community A,1,1,1,1,1,9999 -Community A,1,0,1,1,1,9999 -Community A,1,1,1,1,1,9999 -Community A,0,1,1,1,1,9999 -Community A,0,0,1,1,1,9999 -Community A,0,1,1,1,1,9999 -Community A,0,0,1,0,1,9999 -Community A,0,1,1,0,1,9999 -Community A,0,0,1,0,1,9999 -Community A,1,1,1,0,1,9999 -Community A,1,1,1,0,1,9999 -Community A,0,1,1,0,0,9999 -Community A,1,0,1,0,0,9999 -Community A,0,0,1,0,0,9999 -Community A,1,0,1,0,0,9999 -Community A,0,1,1,0,0,9999 -Community B,0,1,1,1,1,1 -Community B,0,0,1,1,1,1 -Community B,1,1,1,1,1,1 -Community B,1,1,1,1,1,1 -Community B,1,1,1,1,1,1 -Community B,0,1,1,1,1,0 -Community B,1,0,1,1,1,0 -Community B,1,0,1,1,1,0 -Community B,1,1,1,1,1,0 -Community B,0,1,1,1,1,0 -Community B,0,1,1,0,1,0 -Community B,0,0,1,0,1,0 -Community B,1,0,1,0,1,0 -Community B,1,0,1,0,1,0 -Community B,1,1,1,0,1,0 -Community B,0,1,1,0,0,0 -Community B,1,0,1,0,0,0 -Community B,0,1,1,0,0,0 -Community B,1,1,1,0,0,0 -Community B,0,0,1,0,0,0 -Community B,0,1,1,0,0,0 -Community B,1,0,1,0,0,0 -Community B,1,1,1,0,0,0 -Community B,1,0,1,0,0,0 -Community B,1,1,1,0,0,0 -Community B,0,1,1,0,0,0 -Community B,1,1,1,0,0,0 -Community B,0,0,1,0,0,0 -Community B,1,0,1,0,0,0 -Community B,1,0,1,0,0,0