*Program to generate the results of the paper: "How was the COVID-19 outbreak initially managed in Mexico?" *To run this programs there are three documents needed: *1. dataset: base_mexico_early_response *2. do-file: program_mexico_early_response *3. Excel: graphs_tables_mexico (only to compare data from graphs) * COPY DATABASE IN STATA AND DOCUMENT IN EXCEL IN THE DIRECTORY *** change directory to see the results obtained for example: *cd "C:\Users\COVID" *see results log using "results_paper_mxcovid-19.smcl" use "base_mexico_early_response.dta", clear *description of the database codebook, compact ********************* Graphs *************************************** *Graph 1. Evolution of the lethality rate: An international comparison * see worksheet graph1 *Graph 2. Evolution of the lethality rate: A national comparison * see worksheet graph3 ********************* Tables *************************************** *Table A1. Time-invariant characteristics of the Mexican municipalities sum pobreza carretera_pav tot_def rdef100 medida_cont precipitaciones p_votos if month==1 * select any month because it is a time-invariant asdoc sum pobreza carretera_pav tot_def rdef100 medida_cont precipitaciones p_votos, by(month) *time-varying asdoc sum grocpharm parks residen retrec transit workplaces cases dead, by(month) * number of hospitals sum hgpriv hgpub if month==1 * hgpriv hgpub hprivotresp hpubesp tothmun *Table 1. Relationship between date of symptoms and date of COVID-19 confirmation use "base_mexico_early_response.dta", clear * confirmed cases and deaths tabstat cases dead, stat(sum) col(stat) by(month) * date of the symptoms: obtaining ratios symptoms/cases and then averaging foreach var of varlist sint* { gen p_`var'=(`var'/cases)*100 } table month, contents(mean p_sint1 mean p_sint2 mean p_sint3 mean p_sint4 mean p_sint5 ) *Had contact with another affected COVID-19 patient table month, contents(mean p_otrocaso ) ******Econometric models*********** * Longitudinal analysis with HAUSMAN-TAYLOR models /* TVexogenous: parks, residen , pac_hosp, sint2, sint3, sint4, sint5, otro_caso_s, ed2, ed3, ed4, ed5 TVendogenous: lncases, coali_t TIexogenous : lmedida_cont, lprecipitaciones, lcarretera_pav, ldefg, hgpriv TIendogenous : lpobreza, lp_votos */ use "base_mexico_early_response.dta", clear *************panel data: fixed-effects vs. random-effects****************** * panel data xtreg lndead lncases pobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav lneumonia_s ldiabetes_s lhipertension_s lobesidad_s ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, fe eststo mfe1 xtreg lndead lncases pobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav lneumonia_s ldiabetes_s lhipertension_s lobesidad_s ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, re eststo mre1 * test hausman hausman mfe1 mre1 * panel data: without comorbidities xtreg lndead lncases pobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, fe eststo mfe2 xtreg lndead lncases pobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, re eststo mre2 * test hausman hausman mfe2 mre2 * Use of fixed-effects is preferred but we do not have time-invariant variables, use Hausman-Taylor panel data models combinations of exogenous, endogenous and time-variant and time-invariant. *********************************************** *one endogenous var xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases) eststo m1 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lpobreza) eststo m2 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lp_votos) eststo m3 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(coali_t) eststo m4 xtoverid *one endogenous & co-morbidities xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases) eststo m5 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lpobreza) eststo m6 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lp_votos) eststo m7 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(coali_t) eststo m8 xtoverid * two endogenous vars xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lpobreza) eststo m9 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lp_votos) eststo m10 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases coali_t) eststo m11 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lp_votos coali_t) eststo m12 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lp_votos lpobreza) eststo m13 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(coali_t lpobreza) eststo m14 xtoverid * two endogenous vars & comorbidities xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lpobreza) eststo m15 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lp_votos) eststo m16 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases coali_t) eststo m17 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lp_votos coali_t) eststo m18 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lp_votos lpobreza) eststo m19 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(coali_t lpobreza) eststo m20 xtoverid * three endogenous variables xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lpobreza lp_votos) eststo m21 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lpobreza coali_t) eststo m22 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lp_votos coali_t lpobreza) eststo m23 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lpobreza lp_votos) eststo m24 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lpobreza coali_t) eststo m25 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lp_votos coali_t lpobreza) eststo m26 xtoverid *Models with Sargan-Hansen test valid: do not reject H0: m2, m9, m13, m14, m21, m22, m23 *robustness checks * All endogenous xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lpobreza lp_votos coali_t) eststo m27 xtoverid * all endogenous including comorbidities xthtaylor lndead lncases lpobreza parks residen pac_hosp sint2 sint3 sint4 sint5 lneumonia_s ldiabetes_s lhipertension_s lobesidad_s lmedida_cont lprecipitaciones lcarretera_pav ldefg lp_votos coali_t otro_caso_s hgpriv ed2 ed3 ed4 ed5, endog(lncases lpobreza lp_votos coali_t) eststo m28 xtoverid * Robustness checks * Excluding instruments: comorbidities, age, and general death rates *one endogenous xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lpobreza) eststo m29 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lncases) eststo m30 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lp_votos) eststo m31 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(coali_t) eststo m32 xtoverid *two endogenous xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lpobreza lncases) eststo m33 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lpobreza lp_votos) eststo m34 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lpobreza coali_t) eststo m35 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lncases lp_votos) eststo m36 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lncases coali_t) eststo m37 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lp_votos coali_t) eststo m38 xtoverid * three endogenous xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lpobreza lncases lp_votos) eststo m39 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lpobreza lncases coali_t) eststo m40 xtoverid xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lncases lp_votos coali_t) eststo m41 xtoverid * all endogenous xthtaylor lndead lncases lpobreza parks residen pac_hosp lmedida_cont lprecipitaciones lcarretera_pav lp_votos coali_t otro_caso_s hgpriv, endog(lpobreza lncases lp_votos coali_t) eststo m42 xtoverid *** article tables *** ******Econometric models*********** * Longitudinal analysis with HAUSMAN-TAYLOR models /* TVexogenous: parks, residen , pac_hosp, sint2, sint3, sint4, sint5, otro_caso_s, ed2, ed3, ed4, ed5 TVendogenous: lncases, coali_t TIexogenous : lmedida_cont, lprecipitaciones, lcarretera_pav, ldefg, hgpriv TIendogenous : lpobreza, lp_votos */ *Please note that the order in the article is according: *1. Time-varying exogenous *2. Time-invariant exogenous *3. Time-varying possibly endogenous *4. Time-invariant possibly endogenous * Table 2. Hausman-Taylor panel data results of the early stage of COVID-19 in Mexico esttab m2 m9 m13 m14 m21 m22 m23 using elast_table2.rtf, star(* 0.10 ** 0.05 *** 0.01) se obslast scalars(sigma_u sigma_e rho F chi2) compress label nonumber title("Table 2. Hausman-Taylor panel data results of the early stage of COVID-19 in Mexico") mtitle("m2" "m9" "m13" "m14" "m21" "m22" "m23") coeflabel(lndead "ln(deads)" lncases "ln(cases)" parks "mobility parks" residen "mobility around residence place" pobreza "ln(poverty)" pac_hosp "hospitalized" sint2 "symptons Mar-Apr" sint3 "symptons Apr-May" sint4 "symptons May-Jun" sint5 "symptons Jun-July" medida_cont "ln(pollution)" precipitaciones "ln(rainfall)" carretera_pav "ln(low access to paved roads)" p_neumonia_s "pneumonia" p_diabetes_s "diabetes" p_hipertension_s "hypertension" p_obesidad_s "obesity" ldefg "ln(general death rate)" lp_votos "ln(votes)" coali_t "federalist alliance" otro_caso_s "exposed to someone with COVID-19" hgpriv "Private hospitals" led1 "age 0-4" ed2 "age 5-14" ed3 "age 15-24" ed4 "age 25-64" ed5 "age 65-84") * In the paper, the order of the variables are according the exogenous and endogenous variables. * Table 3. Robustness analysis of Hausman-Taylor panel data models * select only with valid overidentification test esttab m30 m33 m37 m40 m41 using elast_table3.rtf, star(* 0.10 ** 0.05 *** 0.01) se obslast scalars(sigma_u sigma_e rho F chi2) compress label nonumber title("Table 3. Robustness analysis of Hausman-Taylor panel data models") mtitle("m30" "m33" "m37" "m40" "m41") coeflabel(lndead "ln(deads)" lncases "ln(cases)" parks "mobility parks" residen "mobility residence place" pobreza "ln(poverty)" pac_hosp "hospitalized" medida_cont "ln(pollution)" precipitaciones "ln(rainfall)" carretera_pav "ln(low access to paved roads)" lp_votos "ln(votes)" coali_t "federalist alliance" otro_caso_s "exposed to someone with COVID-19" hgpriv "Private hospitals" ) * In the paper, the order of the variables are according the exogenous and endogenous variables. log close