
* -----------------------------------------------------------------------------*
*
*     	SOMALI HIGH FREQUENCY  
*     	SURVEY (SHFS) Wave 2 (2017)
*         
*------------------------------------------------------------------------------*


The following simple steps allow you to carry out the analysis in Stata from the Somali Poverty and Vulnerability
Report 2018 using the data from Wave 2 of the Somali High Frequency Survey:


A) SETTING UP THE FOLDER STRUCTURE IN YOUR COMPUTER

   1 - From the "Other materials" subsection in the Microdata library, download "Somali High Frequency Survey 2017 Wave II - Do files". Unzip it and open the "setup.do" file. Next, 
       define a directory in your computer and include the folder location in line 8 of the do file (Example of line 8: local swdLocal = "C:\Users\JohnStata\Desktop\Somali HFS").
       This location will contain the files from the Microdata Library in a specific folder structure (see next steps), and where the output datasets and figures for the analysis 
       will be placed  

   2 - Next, run the "setup.do" file; this process will automatically create the folder structure needed to do the analysis in your computer, and install the packages 
       used in the process. In the selected location, you will now have 4 folders (Data, Do, Output & Temp) and 3 subfolder in the "Data" folder (1-CleanInput, 1-CleanTemp 
       & 1-CleanOutput). Close "setup.do"; this file is only intended to be used once while setting up the folder structure in your computer, thus you do not need to save 
       any changes and/or a copy of it.


B) DOWLOADING THE FILES TO THE CORRECT FOLDER 

   3 - From "Somali High Frequency Survey 2017 Wave II - Do files", unzip the "Do" folder and put its content (15 do files) in the "Do" folder created by "setup.do" in the selected 
       location of your computer

   4 - From the Microdata library, download the "Data in Stata" file, unzip it and put the 22 files whose name begins with "Input" in the "1-CleanInput" subfolder from  
       the "Data" folder created by "setup.do". Rename the files by removing the prefix "Input " (including the space at the end) for each of the 22 files.


C) USING THE DO FILES 

   5 - Afterwards, open the "init.do" file from the "Do" folder of your computer, and include in line 10 the same general directory from your computer as in step 1 (in "setup.do"). 
       That is, the location that contains the 4 folders (Data, Do, Output & Temp). (Example of line 10: local swdLocal = "C:\Users\JohnStata\Desktop\Somali HFS"). Save the changes 
       and close the "init.do" file.

   6 - To run any do file, first open "init.do" and the do file you want to use. Then, copy and paste all the code from "init.do" in the "command" window of the do file you want 
       to use. Hit enter to run the code, and make sure all the lines were run by Stata. Otherwise copy, paste and hit enter twice. This will link the do file with the folder structure 
       in the selected location of your computer. You now will be able to use the chosen do file

   7 - If you run all the do files in sequential order (as indicated by their names, starting with "1-2-clean_fcons.do" and finishing with "1-9-clean_hh.do"), you will obtain the final 
       datasets in the subfolder "1-CleanOutput" from the "Data" folder. These will be identical to the 11 datasets from "Data in Stata" in the Microdata library whose name begins 
       with "Output"

   8 - In addition, if you run the do files that begin with "2-1-PA" you will obtain several excel files in the "Output" folder of your computer. These will contain the raw data used 
       to produce graphs and tables with the analysis of Chapter 1 (Poverty Profile) from the Somali Poverty and Vulnerability Report 2018. These excel files are identical to those from 
       the "Reports" subsection of the Microdata library: "PA_Poverty_Profile_A", "PA_Poverty_Profile_B", "PA_Poverty_Profile_C" and "PA_Poverty_Profile_D"

   9 - Remember to always run "init.do" before any do file from the "Do" folder (as explained in step 6). Every do file has a short header stating its objective, and "run.do" contains the 
       sequence of do files required to carry out all the analysis



NOTES: 

      I) The results from the Somali Poverty and Vulnerability Report 2018 ahd the associated Excel files were obtained with the data and code provided (as described) and using Stata 
         version 14.2. Using any other version of Stata, might result in slight differences from the figures contained in these files.

      II) The data from Wave 2 is not fully comparable to the data from Wave 1 due to differences in the sampling frame and accessibility of areas during fieldwork. Therefore, it is 
          not recommended to compare the data from both waves of the SHFS without addressing these caveats.  
