Dear Stata users,
I am using Stata 18 and would like to create a dummy variable if one of the three variables - remittances, govt_aid and hum_aid is among the top 3 of the variables empl - hum_aid.
The example dataset is below
My desired variable is unstable_inc.
Thanks in advance!
I am using Stata 18 and would like to create a dummy variable if one of the three variables - remittances, govt_aid and hum_aid is among the top 3 of the variables empl - hum_aid.
The example dataset is below
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double HHID str5 strata double(rand empl agric loans assets remittances govt_aid hum_aid) long unstable_inc 1 "Urban" 23145 1000 750 0 500 0 0 0 0 2 "Rural" 13755 1750 650 350 0 200 0 0 0 3 "Rural" 17890 480 400 300 0 1500 1200 800 1 4 "Urban" 25634 630 400 0 0 1250 1000 1200 1 5 "Rural" 56231 1200 0 0 700 0 0 0 0 6 "Rural" 96541 1000 750 1200 0 500 0 0 0 7 "Urban" 23654 1700 0 500 0 700 0 . 0 8 "Urban" 52361 500 0 250 500 900 900 1400 1 9 "Rural" 74125 300 750 500 150 1200 1300 1500 1 10 "Rural" 96124 0 0 0 0 0 0 0 0 11 "Urban" 37851 400 300 700 500 1000 800 200 0 12 "Rural" 85321 900 900 0 750 0 0 1100 0 13 "Urban" 64123 . 1400 700 600 800 400 1200 1 14 "Urban" 65241 800 400 400 500 1100 900 400 1 15 "Urban" 10789 350 450 750 0 0 850 950 1 16 "Rural" 36789 850 850 500 600 1050 850 0 1 end
Thanks in advance!
Comment