* =============================================================================
* Set paths
* =============================================================================
* !!! WARNING !!! Put your paths here before executing
local dir_in "C:/your/path"
local dir_out "`dir_in'"
* =============================================================================
* Data preparation
* =============================================================================
* -----------------------------------------------------------------------------
* Import the sample to be assigned
* -----------------------------------------------------------------------------
import delimited using "`dir_in'/example_sample.tsv", ///
varnames(1) /// treat first line as variable names
clear
* -----------------------------------------------------------------------------
* Transform columns into those expected by SuSo
* -----------------------------------------------------------------------------
* convert from numeric to string
rename province province_old
gen province =
gen days_preferred = .
replace province = 1 if province_old == "Bulawayo
replace province = 2 if province_old == "Harare
replace province = 3 if province_old == "Manicaland
replace province = 4 if province_old == "Mashonaland Central
replace province = 5 if province_old == "Mashonaland East
replace province = 6 if province_old == "Mashonaland West
replace province = 7 if province_old == "Masvingo
replace province = 8 if province_old == "Matabeleland North
replace province = 9 if province_old == "Matabeleland South
replace province = 10 if province_old == "Midlands
* rename variables to match expected name