Household resilience capacity to food insecurity in Somalia: replication code and results (SIHBS 2022, RIMA-II)
Description
Replication code and results for the article "Household resilience capacity to food insecurity in Somalia: evidence from the 2022 Somali Integrated Household Budget Survey" (submitted to Cogent Food & Agriculture). The study applies the FAO Resilience Index Measurement and Analysis (RIMA-II) framework to 7,212 households in the 2022 Somali Integrated Household Budget Survey (SIHBS). Four pillars (Access to Basic Services, Assets, Social Safety Nets and Adaptive Capacity) are built by survey-weighted factor analysis. A weighted MIMIC model links the pillars to two food-security indicators, the 7-day Household Food Group Diversity Score (HFGDS-7) and the reversed Food Insecurity Experience Scale (FIES) raw score, to estimate a Resilience Capacity Index (RCI, 0-100). The Resilience Structure Matrix gives each pillar's contribution by residence (rural, urban, nomadic). Survey-weighted logit models relate the RCI to erosive and food-based coping among households that reported a shock, with drought interactions. The dataset contains: - code/SIHBS_2022_RIMA_data_prep.R: builds the household analysis file from the raw SIHBS 2022 modules; - code/SIHBS_2022_RIMA_Resilience.R: the full RIMA-II analysis, tables and figures; - results/SIHBS_RIMA_results.xlsx: all tables reported in the article; - figures/: Figures 1-6 and the graphical abstract; - README.txt and Codebook.csv: instructions and variable definitions. Run end to end in R, the scripts reproduce every cell of the results workbook exactly. The SIHBS 2022 microdata are owned by the Somalia National Bureau of Statistics and are not redistributed here. They are available on registration from the Somali National Data Archive (SoNADA): https://microdata.nbs.gov.so/index.php/catalog/59. Administrative boundaries for Figure 1 are from OCHA Somalia (COD-AB) on the Humanitarian Data Exchange. Results are cross-sectional associations, not causal effects. No PSU identifier is released, so standard errors use region x residence proxy strata and are likely understated.
Files
Steps to reproduce
1. Download the SIHBS 2022 microdata from SoNADA (https://microdata.nbs.gov.so/index.php/catalog/59) after registering. Put these modules in one folder, keeping the exact file names: hh, hhm, food, consagg, shock, crops, livestock_own, fishing, land, hhbus, asset (.dta). For Figure 1, download the OCHA Somalia COD-AB admin-1 shapefile (som_admin1.shp) from the Humanitarian Data Exchange. 2. Install R (4.3 or later) and the packages: haven, dplyr, tidyr, lavaan, survey, ggplot2, writexl, MASS, sf, ggspatial. 3. In both scripts, set the paths in the "SET THESE PATHS" block at the top: SOURCE (folder with the SIHBS modules), OUT (folder for all outputs) and, in the analysis script, BOUNDARIES (path to som_admin1.shp). 4. Run code/SIHBS_2022_RIMA_data_prep.R. It creates SIHBS_food_systems_household.dta in OUT and stops with an error unless it finds 7,212 households, 7,209 with food-module data and 7,152 with a consumption aggregate. 5. Run code/SIHBS_2022_RIMA_Resilience.R. It writes SIHBS_RIMA_results.xlsx, Figures 1-6, the graphical abstract, a log file and a household-level analysis file to OUT in under a minute. 6. Compare the new workbook with results/SIHBS_RIMA_results.xlsx. All point estimates match exactly. The 95% intervals in sheet Coping_predictions come from 1,000 simulated draws (seed 20221) and may differ slightly on other R versions or platforms. See README.txt for file descriptions and Codebook.csv for variable definitions.