Stata Code Übersetzung
Verfasst: So Dez 21, 2025 9:04 pm
Ich habe folgenden Stata Code und muss die Ergebnisse mit R nachbilden. Habe mir über GitHub das fwildclusterboot Paket installiert, aber ich komme auch damit nicht wirklich weiter.
Kann mir hier jemand helfen?
Der benötigte Datensatz liegt in der ZIP Datei (ADD_Mafia_municipality.dta).
Danke im voraus für jeden Tipp oder Hinweis.
----
Code:
use "ADD_Mafia_municipality.dta", clear
set more off
local det_Fasci "predr_peas_fasci ruralcentre1861 Rural_rent Urban_rent agricola_rel seminatoritot_rel"
local det_Mafia "Citrus_groves sulfurproduction1868_70 Vineyards Olives_groves Mafia1885"
local basics "lnpop1861 lnsurface centreheight maxheight slope2 pa_pdist1856 port2_pdist1856 roads1799 ave_temp var_sp3m_n30 sp3m_ave_n30"
local provinces "province2-province7"
local specification1 "`det_Fasci'"
local specification2 "`det_Fasci' `det_Mafia'"
local specification3 "`det_Fasci' `det_Mafia' `basics'"
foreach var of varlist army1875_pop eff_civ1{
g state_capacity=`var'
g state_capacity_rain=`var'*sp3m1893_n30
g peasants_state_capacity=peasants_fasci*`var'
foreach i of numlist 2/3 {
*Panel A
reg peasants_fasci sp3m1893_n30 state_capacity_rain state_capacity `specification`i'' `provinces' if Mafia1900!=. & sp3m1893_n30!=.
predict peasants_fasci_h
reg peasants_state_capacity sp3m1893_n30 state_capacity_rain state_capacity `specification`i'' `provinces' if Mafia1900!=. & sp3m1893_n30!=.
predict peasants_state_capacity_h
cluster2bootGDLF Mafia1900 peasants_fasci_h peasants_state_capacity_h state_capacity `specification`i'' `provinces' if Mafia1900!=. & sp3m1893_n30!=., fcluster(cl1_stn_sp1893_n30) tcluster(distretto1853) nboot(1000) seed(1111)
outreg2 using TAB8a.tex, keep(peasants_fasci_h state_capacity peasants_state_capacity_h) dec(2) noaster append
drop peasants_fasci_h
drop peasants_state_capacity_h
*Panel B
cluster2bootGDLF Mafia1900 sp3m1893_n30 state_capacity_rain state_capacity `specification`i'' `provinces' if Mafia1900!=. & sp3m1893_n30!=., fcluster(cl1_stn_sp1893_n30) tcluster(distretto1853) nboot(1000) seed(1111)
outreg2 using TAB8b.tex, keep(sp3m1893_n30 state_capacity state_capacity_rain) dec(2) noaster append
}
drop state_capacity state_capacity_rain peasants_state_capacity
}
Kann mir hier jemand helfen?
Der benötigte Datensatz liegt in der ZIP Datei (ADD_Mafia_municipality.dta).
Danke im voraus für jeden Tipp oder Hinweis.
----
Code:
use "ADD_Mafia_municipality.dta", clear
set more off
local det_Fasci "predr_peas_fasci ruralcentre1861 Rural_rent Urban_rent agricola_rel seminatoritot_rel"
local det_Mafia "Citrus_groves sulfurproduction1868_70 Vineyards Olives_groves Mafia1885"
local basics "lnpop1861 lnsurface centreheight maxheight slope2 pa_pdist1856 port2_pdist1856 roads1799 ave_temp var_sp3m_n30 sp3m_ave_n30"
local provinces "province2-province7"
local specification1 "`det_Fasci'"
local specification2 "`det_Fasci' `det_Mafia'"
local specification3 "`det_Fasci' `det_Mafia' `basics'"
foreach var of varlist army1875_pop eff_civ1{
g state_capacity=`var'
g state_capacity_rain=`var'*sp3m1893_n30
g peasants_state_capacity=peasants_fasci*`var'
foreach i of numlist 2/3 {
*Panel A
reg peasants_fasci sp3m1893_n30 state_capacity_rain state_capacity `specification`i'' `provinces' if Mafia1900!=. & sp3m1893_n30!=.
predict peasants_fasci_h
reg peasants_state_capacity sp3m1893_n30 state_capacity_rain state_capacity `specification`i'' `provinces' if Mafia1900!=. & sp3m1893_n30!=.
predict peasants_state_capacity_h
cluster2bootGDLF Mafia1900 peasants_fasci_h peasants_state_capacity_h state_capacity `specification`i'' `provinces' if Mafia1900!=. & sp3m1893_n30!=., fcluster(cl1_stn_sp1893_n30) tcluster(distretto1853) nboot(1000) seed(1111)
outreg2 using TAB8a.tex, keep(peasants_fasci_h state_capacity peasants_state_capacity_h) dec(2) noaster append
drop peasants_fasci_h
drop peasants_state_capacity_h
*Panel B
cluster2bootGDLF Mafia1900 sp3m1893_n30 state_capacity_rain state_capacity `specification`i'' `provinces' if Mafia1900!=. & sp3m1893_n30!=., fcluster(cl1_stn_sp1893_n30) tcluster(distretto1853) nboot(1000) seed(1111)
outreg2 using TAB8b.tex, keep(sp3m1893_n30 state_capacity state_capacity_rain) dec(2) noaster append
}
drop state_capacity state_capacity_rain peasants_state_capacity
}