Dear Stata community,
I aim to investigate 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. My dataset includes past crime occurrence experience (past_crime_exper) and future expected crime levels (future_crime_freq_codes), which is a categorical variable with values: 0 "Decreasing," 1 "Uncertain," 2 "Increasing," 3 "None," and 4 "Not expected to happen in the future". Additionally, I have year fixed effects (year) and city fixed effects (city_name). How can I utilize Lewbel's (2012) heteroscedasticity-based identification approach to establish the causal effect of police presence (the endogenous ln_police)on crime reports? Please note that the same city could experience different types of crimes within the same year, so I do not use the year variable to declare xtset. I only use city_name.
The model without addressing endogeneity is given as follows:
ppmlhdfe ln_crime ln_police i.past_crime_exper, absorb (year city_name) irr nolog cluster (city_name)
and the example data is given below. Thanks for your insights!
I aim to investigate 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. My dataset includes past crime occurrence experience (past_crime_exper) and future expected crime levels (future_crime_freq_codes), which is a categorical variable with values: 0 "Decreasing," 1 "Uncertain," 2 "Increasing," 3 "None," and 4 "Not expected to happen in the future". Additionally, I have year fixed effects (year) and city fixed effects (city_name). How can I utilize Lewbel's (2012) heteroscedasticity-based identification approach to establish the causal effect of police presence (the endogenous ln_police)on crime reports? Please note that the same city could experience different types of crimes within the same year, so I do not use the year variable to declare xtset. I only use city_name.
The model without addressing endogeneity is given as follows:
ppmlhdfe ln_crime ln_police i.past_crime_exper, absorb (year city_name) irr nolog cluster (city_name)
and the example data is given below. Thanks for your insights!
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str87 city_name float(year ln_crime ln_police past_crime_exper future_crime_freq_codes) "Aarhus Kommune" 2021 1.8184465 1.8184465 1 2 "Aarhus Kommune" 2021 1.8184465 1.8184465 1 2 "Aarhus Kommune" 2021 1.8184465 1.8184465 1 2 "Aarhus Municipality" 2022 . .8813736 1 2 "Aarhus Municipality" 2023 .8813736 .8813736 0 2 "Abasan Al-Kabira Municipality" 2019 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2019 2.49178 2.49178 1 0 "Abasan Al-Kabira Municipality" 2019 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2019 2.49178 2.49178 0 2 "Abasan Al-Kabira Municipality" 2019 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2019 2.49178 2.49178 1 0 "Abasan Al-Kabira Municipality" 2020 2.49178 2.49178 0 2 "Abasan Al-Kabira Municipality" 2020 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2020 2.49178 2.49178 1 0 "Abasan Al-Kabira Municipality" 2020 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2020 2.49178 2.49178 1 0 "Abasan Al-Kabira Municipality" 2020 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2021 2.49178 2.49178 1 0 "Abasan Al-Kabira Municipality" 2021 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2021 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2021 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2021 2.49178 2.49178 1 2 "Abasan Al-Kabira Municipality" 2021 2.49178 2.49178 1 0 "Abasan Al-Kabira Municipality" 2022 2.3124382 2.3124382 1 2 "Abasan Al-Kabira Municipality" 2022 2.3124382 2.3124382 1 2 "Abasan Al-Kabira Municipality" 2022 2.3124382 2.3124382 1 2 "Abasan Al-Kabira Municipality" 2022 2.3124382 2.3124382 1 2 "Abasan Al-Kabira Municipality" 2022 2.3124382 2.3124382 1 2 "Abasan Al-Kabira Municipality" 2023 2.3124382 2.3124382 . 2 "Abasan Al-Kabira Municipality" 2023 2.3124382 2.3124382 . 2 "Abasan Al-Kabira Municipality" 2023 2.3124382 2.3124382 . 2 "Abasan Al-Kabira Municipality" 2023 2.3124382 2.3124382 . 2 "Abasan Al-Kabira Municipality" 2023 2.3124382 2.3124382 . 2 "Abejorral" 2022 . .8813736 . . "Aberdeenshire Council" 2023 2.776472 2.776472 1 2 "Aberdeenshire Council" 2023 2.776472 2.776472 1 2 "Aberdeenshire Council" 2023 2.776472 2.776472 1 2 "Aberdeenshire Council" 2023 2.776472 2.776472 1 2 "Aberdeenshire Council" 2023 2.776472 2.776472 1 2 "Aberdeenshire Council" 2023 2.776472 2.776472 1 2 "Aberdeenshire Council" 2023 2.776472 2.776472 1 2 "Aberdeenshire Council" 2023 2.776472 2.776472 1 2 "Abington Township" 2019 1.4436355 1.4436355 . . "Abington Township" 2019 1.4436355 1.4436355 . . "Abington Township" 2020 2.644121 2.644121 1 2 "Abington Township" 2020 2.644121 2.644121 1 1 "Abington Township" 2020 2.644121 2.644121 1 2 "Abington Township" 2020 2.644121 2.644121 1 2 "Abington Township" 2020 2.644121 2.644121 1 1 "Abington Township" 2020 2.644121 2.644121 0 1 "Abington Township, PA" 2019 . 2.3124382 1 1 "Abington Township, PA" 2019 . 2.3124382 1 1 "Abington Township, PA" 2019 . 2.3124382 1 2 "Abington Township, PA" 2019 . 2.3124382 1 2 "Abington Township, PA" 2019 . 2.3124382 1 2 "Abington Township, PA" 2021 2.644121 2.644121 1 1 "Abington Township, PA" 2021 2.644121 2.644121 1 2 "Abington Township, PA" 2021 2.644121 2.644121 1 2 "Abington Township, PA" 2021 2.644121 2.644121 1 2 "Abington Township, PA" 2021 2.644121 2.644121 0 1 "Abington Township, PA" 2021 2.644121 2.644121 1 1 "Abington Township, PA" 2022 . 2.3124382 1 2 "Abington Township, PA" 2022 . 2.3124382 1 1 "Abington Township, PA" 2022 . 2.3124382 1 2 "Abington Township, PA" 2022 . 2.3124382 1 2 "Abington Township, PA" 2022 . 2.3124382 1 2 "Abington Township, PA" 2023 2.0947125 2.0947125 . 2 "Abington Township, PA" 2023 2.0947125 2.0947125 1 2 "Abington Township, PA" 2023 2.0947125 2.0947125 . 2 "Abington Township, PA" 2023 2.0947125 2.0947125 0 2 "Abuja Federal Capital Territory" 2019 . .8813736 . 2 "Abuja Federal Capital Territory" 2020 .8813736 .8813736 1 2 "Abuja Federal Capital Territory" 2021 .8813736 .8813736 1 2 "Abuja Federal Capital Territory" 2022 . .8813736 . . "Abuja Federal Capital Territory" 2023 .8813736 .8813736 . . "Accra Metropolitan Assembly" 2019 1.4436355 1.4436355 1 2 "Accra Metropolitan Assembly" 2019 1.4436355 1.4436355 1 2 "Accra Metropolitan Assembly" 2020 1.4436355 1.4436355 1 2 "Accra Metropolitan Assembly" 2020 1.4436355 1.4436355 1 2 "Accra Metropolitan Assembly" 2021 1.4436355 1.4436355 1 2 "Accra Metropolitan Assembly" 2021 1.4436355 1.4436355 1 2 "Accra Metropolitan Assembly" 2022 . 1.4436355 1 . "Accra Metropolitan Assembly" 2022 . 1.4436355 1 . "Accra Metropolitan Assembly" 2023 1.4436355 1.4436355 . . "Accra Metropolitan Assembly" 2023 1.4436355 1.4436355 . . "Adana Metropolitan Municipality" 2020 . .8813736 1 0 "Adana Metropolitan Municipality" 2021 . .8813736 1 0 "Addis Ababa City Administration" 2019 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2019 1.8184465 1.8184465 1 . "Addis Ababa City Administration" 2019 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2020 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2020 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2020 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2021 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2021 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2021 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2022 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2022 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2022 1.8184465 1.8184465 1 2 "Addis Ababa City Administration" 2023 1.8184465 1.8184465 . 2 end
Comment