Dear Stata community,
I am trying to assess the impact of the number of police officers (log-transformed as ln_police) on the reported number of crimes (log-transformed as ln_crime) using city-level panel data and Lewbel's (2012) heteroscedasticity-based identification approach to establish the causal effect of police presence on crime reports. Here is the problem:
First: I run the following model using only the year fixed effect, and then everything went well.
xi: ivreg2h ln_crime (ln_police=) i.past_crime_exper $controls i.year, cluster (cty) first
outreg2 using Table_Main.doc,replace dec(3) keep (ln_police) addtext (Other controls, Yes, Year fixed effects, Yes, City fixed effects, No)
Second: I run another model controlling for both the year and city fixed effects, and I found a problem. Stata says "Unable to display first-stage estimates; macro e(first) is missing" and "Unable to display summary of first-stage estimates; macro e(first) is missing".
xi: ivreg2h ln_crime (ln_police=) i.past_crime_exper $controls i.year i.cty, cluster (cty) first
outreg2 using Table_Main.doc,append dec(3) keep (ln_police) addtext (Other controls, Yes, Year fixed effects, Yes, City fixed effects, Yes)
I am not clear why this problem arises when I further control for the city-level fixed effects. I appreciate any solution and thank you for your help in advance. The example dataset associated with the first year is provided here below.
I am trying to assess the impact of the number of police officers (log-transformed as ln_police) on the reported number of crimes (log-transformed as ln_crime) using city-level panel data and Lewbel's (2012) heteroscedasticity-based identification approach to establish the causal effect of police presence on crime reports. Here is the problem:
First: I run the following model using only the year fixed effect, and then everything went well.
xi: ivreg2h ln_crime (ln_police=) i.past_crime_exper $controls i.year, cluster (cty) first
outreg2 using Table_Main.doc,replace dec(3) keep (ln_police) addtext (Other controls, Yes, Year fixed effects, Yes, City fixed effects, No)
Second: I run another model controlling for both the year and city fixed effects, and I found a problem. Stata says "Unable to display first-stage estimates; macro e(first) is missing" and "Unable to display summary of first-stage estimates; macro e(first) is missing".
xi: ivreg2h ln_crime (ln_police=) i.past_crime_exper $controls i.year i.cty, cluster (cty) first
outreg2 using Table_Main.doc,append dec(3) keep (ln_police) addtext (Other controls, Yes, Year fixed effects, Yes, City fixed effects, Yes)
I am not clear why this problem arises when I further control for the city-level fixed effects. I appreciate any solution and thank you for your help in advance. The example dataset associated with the first year is provided here below.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float year str87 cty float(ln_crime ln_police past_crime_exper) 2019 "Municipality of Trelleborg" 1.8184465 1.8184465 1 2019 "Armstrong" . 4.276859 . 2019 "City of St Louis, MO" . 3.4023066 . 2019 "Baguio City" 1.4436355 1.4436355 1 2019 "Santiago de Cali" 2.3124382 2.3124382 0 2019 "City of Helsingborg" 2.644121 2.644121 1 2019 "City of Medford, MA" . 3.1797855 1 2019 "Odder Kommune" . 1.8184465 . 2019 "City of Melbourne" 3.093102 3.093102 . 2019 "Auckland Council" 2.893444 2.893444 0 2019 "City of Fayetteville, AR" 3.093102 3.093102 0 2019 "City of Oslo" 2.3124382 2.3124382 1 2019 "City of Muntinlupa" 3.638278 3.638278 0 2019 "Junta Intermunicipal de la Cuenca Baja del Rio Ayuquila (JIRA)" .8813736 1.4436355 1 2019 "City of Emeryville, CA" 2.893444 2.893444 1 2019 "Prefeitura Municipal de João Pessoa" . 2.893444 . 2019 "Gobierno Municipal de la Ciudad de Paraná" . 3.1797855 . 2019 "Municipalidad de Córdoba" 2.0947125 2.0947125 0 2019 "Perth and Kinross" . 2.3124382 1 2019 "Khon Kaen City" 1.8184465 1.8184465 1 2019 "Mahasarakham Municipality" 2.49178 2.49178 1 2019 "Gobiernación del Archipiélago de San Andrés" . 1.8184465 . 2019 "City of Somerville, MA" 2.3124382 2.3124382 1 2019 "Uranga" . 3.2595725 . 2019 "Município de Torres Vedras" 2.49178 2.49178 . 2019 "Aipromades Lago de Chapala" 2.3124382 2.3124382 1 2019 "City of North Vancouver, BC" . 3.3334775 1 2019 "Prefeitura de Limeira" . 2.998223 . 2019 "Town of Lexington, MA" 2.0947125 2.0947125 1 2019 "Prefeitura de Campo Grande" 2.3124382 2.3124382 . 2019 "Falkoping Kommun" 2.49178 2.49178 1 2019 "Municipalidad de Bellavista" . 2.0947125 0 2019 "Odder Kommune" . . . 2019 "Prefeitura de Betim" 2.644121 2.776472 1 2019 "City of Providence, RI" . 3.1797855 1 2019 "Municipality of Centeno" . 3.093102 . 2019 "Prefeitura Municipal de Canoas" 2.49178 2.49178 . 2019 "City of Ottawa, ON" . 2.0947125 . 2019 "Greater Manchester" 2.644121 2.644121 1 2019 "Prefeitura de Brusque" .8813736 .8813736 1 2019 "Town of Ithaca" . . . 2019 "Prefeitura de Guarujá" 2.0947125 2.0947125 1 2019 "Prefeitura Municipal de Santos" 2.776472 2.776472 1 2019 "Kochi Municipal Corporation" 2.49178 2.49178 1 2019 "San Carlos City" 2.893444 2.893444 1 2019 "Hobsons Bay City Council" . 2.49178 1 2019 "City of Stockholm" 2.0947125 2.0947125 0 2019 "Comune di Ferrara" 3.912423 3.912423 1 2019 "City of Podgorica" 2.49178 2.49178 1 2019 "Municipality of Bragado" . 3.2595725 . 2019 "City of North Vancouver, BC" . 3.3334775 1 2019 "Moroni City" 2.644121 2.644121 1 2019 "San Miguel" . 2.998223 . 2019 "Villa Eloisa" . 2.49178 1 2019 "San Carlos City" 2.893444 2.893444 1 2019 "Municipalidad de Santiago de Surco" . 1.4436355 1 2019 "City of Greater Sudbury / Grand Sudbury, ON" . 2.776472 1 2019 "City of Dar es Salaam" 1.8184465 1.8184465 1 2019 "Municipality of Olavarría" 0 3.2595725 . 2019 "City of Seattle, WA" . 1.8184465 . 2019 "Medan City Government" 1.4436355 1.4436355 1 2019 "KwaDukuza" 4.248699 4.248699 1 2019 "City of Buenos Aires" 3.784706 3.784706 1 2019 "City of Muntinlupa" 3.638278 3.638278 0 2019 "City of Paris" 3.1797855 3.2595725 1 2019 "Prefeitura Municipal de João Pessoa" . 2.893444 . 2019 "Helsingør Kommune / Elsinore Municipality" 1.8184465 2.0947125 1 2019 "City of Basel-Stadt" 2.49178 2.49178 1 2019 "Municipalidad de Montecarlo" . 2.3124382 1 2019 "Municipality of Rauch" . 2.3124382 . 2019 "City Government of Davao" . 3.093102 1 2019 "City Government of Davao" . 3.093102 . 2019 "City of Berlin" 1.8184465 1.8184465 1 2019 "Gemeente Rotterdam" 2.776472 2.998223 1 2019 "City of Boulder, CO" . 2.49178 1 2019 "Prefeitura de São Paulo" 2.49178 2.49178 1 2019 "Alcaldia de Valdivia" 1.8184465 1.8184465 1 2019 "Municipalidad de Provincial de Arequipa" 0 2.3124382 1 2019 "City of Albany, NY" . 2.0947125 . 2019 "Comune di Ferrara" 3.912423 3.912423 1 2019 "Municipality of Bell Ville" 2.998223 2.998223 1 2019 "City of Boston, MA" . 2.776472 1 2019 "City of Växjö" 2.49178 2.49178 1 2019 "Prefeitura de Natal" . 2.3124382 . 2019 "Municipio de Maneiro" .8813736 1.4436355 0 2019 "Municipalidad de Providencia" 3.738236 3.738236 1 2019 "Comune di Padova" 0 2.0947125 . 2019 "Municipality of Resistencia" . 2.49178 1 2019 "Arteaga" 2.49178 2.49178 1 2019 "City of Lisbon" 3.4023066 3.4023066 1 2019 "Tel Aviv-Yafo Municipality" 2.776472 2.776472 1 2019 "City of Providence, RI" . 3.1797855 1 2019 "City of Santa Cruz, CA" 2.644121 2.644121 0 2019 "City Government of Davao" . 3.093102 . 2019 "City of Abidjan" . 2.776472 . 2019 "Metropolitan Municipality of Lima" 2.0947125 2.0947125 1 2019 "City of Buenos Aires" 3.784706 3.784706 1 2019 "Godoy Cruz" 3.1797855 3.2595725 . 2019 "Alcaldia de Manizales" 3.093102 3.093102 1 2019 "City of Warsaw" 2.0947125 2.0947125 1 end label def past_crime_exper 0 "No", modify label def past_crime_exper 1 "Yes", modify