* Program: Program for the Impact of COVID - Colombia * * Date: March 2020 * Version: 1.0 *-------------------------------------------------------------------------------- set more off clear all global root_COVID = "C:\Users\wb521296\OneDrive - WBG\Desktop\COVID" *=============================================================================== //------------------------------------------------------------------------------ // DO NOT MODIFY BEYOND THIS POINT //------------------------------------------------------------------------------ *=============================================================================== * COVID - GEIH * global data_COVID = "$root_COVID/data" global dataout_COVID = "$root_COVID/dataout" global dta_COVID = "$root_COVID/dta" // Save intermediate results in Stata format global xls_COVID = "$root_COVID/xls" // Saves MS Excel results global graphs_COVID = "$root_COVID/grphs" // Saves graphs into global dofiles_COVID = "$root_COVID/dofiles/GEIH" // Saves Dofile *------------------------------------------------------------------------------- *-------- USe the database used to the presidency presentation -------- *------------------------------------------------------------------------------- use "$dta_COVID\presentacion_presidencia_final.dta", clear /******************************************************************************** **** Social mitigation measures ***** *********************************************************************************/ global CM3 80000 global MFA3 145000 global JeA3 375000 gen CM_adicional4=(($CM3 /12)*total_CM) gen MFA_adicional4= $MFA3 /12 if Beneficiario_MFA==1 gen JeA_adicional4=(($JeA3 /12)*total_JeA) global simulaciones sim1 sim1_4 sim3 sim3_4 foreach k of global simulaciones{ egen ingreso_ug_`k'_af_end=rowtotal(ingreso_ug_`k'_af_final CM_adicional4 MFA_adicional4 JeA_adicional4) gen ingreso_pc_ug_`k'_af_end=ingreso_ug_`k'_af_end/Npersug } foreach var of global simulaciones{ gen poor_extrem_af_end_`var'=1 if ingreso_pc_ug_`var'_af_end1000000 replace ingreso_adicional_prima= 0 if P6870==1 replace ingreso_adicional_prima=0 if informal_legal2==1 replace ingreso_adicional_prima=0 if afectado_total==0 global alivio_pensiones 3 gen eliminacion_aportes=. replace eliminacion_aportes=ingresos_laborales* 0.04/0.92 if no_pension==0 & inlist(P6430 ,1,2,3,5,6,7,8,9) replace eliminacion_aportes=ingresos_laborales* 0.064/0.886 if no_pension==0 & P6430==4 replace eliminacion_aportes=eliminacion_aportes*$alivio_pensiones /12 foreach k of global simulaciones{ egen ingreso_laboral_nomina_`k'_f = rowtotal ( ingresos_laborales_`k' ingreso_adicional_nomina ingreso_adicional_prima eliminacion_aportes) } foreach k of global simulaciones{ egen ingresos_totales_nomina_`k'_f=rowtotal(ingreso_laboral_nomina_`k'_f Imdi Imdies Iof1 Iof1es Iof2 Iof2es Iof3h Iof3hes Iof3i Iof3ies Isa Isaes Iof6 Iof6es ) replace ingresos_totales_nomina_`k'_f=0 if ug==0 bys Directorio Secuencia_p: egen total_ingreso_ug_nomina_`k'_f=total(ingresos_totales_nomina_`k'_f) egen ingreso_total_ug_arr_n_`k'_f=rowtotal(impu_arr total_ingreso_ug_nomina_`k'_f) gen ingreso_pc_ug_n_`k'_f=ingreso_total_ug_arr_n_`k'_f/Npersug } foreach k of global sim{ gen ingresos_totales_ml_`k'_f=. replace ingresos_totales_ml_`k'_f= ingresos_totales_cr_`k' if ingresos_totales_cr_`k'>= ingresos_totales_nomina_`k'_f replace ingresos_totales_ml_`k'_f= ingresos_totales_nomina_`k' if ingresos_totales_cr_`k'<= ingresos_totales_nomina_`k'_f bys Directorio Secuencia_p: egen total_ingreso_ug_ml_`k'_f=total(ingresos_totales_ml_`k'_f) egen ingreso_total_ug_arr_ml_`k'_f=rowtotal(impu_arr total_ingreso_ug_ml_`k'_f) gen ingreso_pc_ug_ml_`k'_f=ingreso_total_ug_arr_ml_`k'_f/Npersug } foreach var of global sim{ gen poor_extrem_ml_`var'_f=1 if ingreso_pc_ug_ml_`var'_f
  • = ingresos_totales_nomina_`k'_f gen ingreso_pc_ug_nomina1_`k'= ingreso_pc_ug_credito_`k' if ingresos_totales_cr_`k'>= ingresos_totales_nomina_`k'_f replace ingreso_pc_ug_nomina1_`k'= ingreso_pc_ug_n1_`k'_f if ingresos_totales_cr_`k'<= ingresos_totales_nomina_`k'_f gen ingreso_pc_ug_nomina2_`k'= ingreso_pc_ug_credito_`k' if ingresos_totales_cr_`k'>= ingresos_totales_nomina_`k'_f replace ingreso_pc_ug_nomina2_`k'= ingreso_pc_ug_n2_`k'_f if ingresos_totales_cr_`k'<= ingresos_totales_nomina_`k'_f gen ingreso_pc_ug_nomina3_`k'= ingreso_pc_ug_credito_`k' if ingresos_totales_cr_`k'>= ingresos_totales_nomina_`k'_f replace ingreso_pc_ug_nomina3_`k'= ingreso_pc_ug_n3_`k'_f if ingresos_totales_cr_`k'<= ingresos_totales_nomina_`k'_f } local plines Lp Li preserve sp_groupfunction [aw=Fex_c], poverty(ingresos_pc_ug* ingreso_pc_ug_credito* ingreso_pc_ug_nomina*) povertyline(`plines') by(all) tempfile poverty2 save `poverty2' export excel "$xls_COVID/Results_covid_paper2.xls", sheet (mitigation_measures_all) sheetreplace first(variable) restore global simulaciones sim1 sim1_4 sim3 sim3_4 foreach k of global simulaciones{ gen poor_cm_`k'=1 if ingresos_pc_ug_`k'_cm