Commit ·
d3186e9
1
Parent(s): 6d52531
82 83
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+1
- 82/paper.pdfAdded+3
- 82/replication_package/DATASET_ANCIENT_CITIES.dtaAdded+3
- 82/replication_package/DATASET_ARCHAEOLOGY.dtaAdded+3
- 82/replication_package/DATASET_COUNTRIES.dtaAdded+3
- 82/replication_package/DATASET_ETHNOATLAS.dtaAdded+3
- 82/replication_package/DO_FILES/Main.doAdded+39
- 82/replication_package/DO_FILES/Replication Ancient Settlements FINAL.doAdded+315
- 82/replication_package/DO_FILES/Replication Archaeological Results FINAL.doAdded+71
- 82/replication_package/DO_FILES/Replication Country Results FINAL.doAdded+679
- 82/replication_package/DO_FILES/Replication EthnoAtlas FINAL.doAdded+806
- 82/replication_package/ESTA/esta.adoAdded+842
- 82/replication_package/ESTA/esta.hlpAdded+824
- 82/replication_package/ESTA/esta.pkgAdded+7
- 82/replication_package/ESTA/readme.txtAdded+3
- 82/replication_package/ESTA/stata.tocAdded+2
- 82/replication_package/PACKAGES/x_gmm.adoAdded+298
- 82/replication_package/PACKAGES/x_ols.adoAdded+181
- 82/replication_package/PACKAGES/xgmlt.adoAdded+250
- 82/replication_package/README.docxAdded
- 82/should_reproduce.txtAdded+3
- 83/paper.pdfAdded+3
- 83/replication_package/README.pdfAdded+3
- 83/replication_package/data/Hydropower_USA_Developed_1953.csvAdded+3
- 83/replication_package/data/Hydropower_USA_Developed_1953.dtaAdded+3
- 83/replication_package/data/Hydropower_USA_Undeveloped_1953.csvAdded+3
- 83/replication_package/data/Hydropower_USA_Undeveloped_1953.dtaAdded+3
- 83/replication_package/data/NBER_gaz1990countydistance100miles.csvAdded+3
- 83/replication_package/data/NBER_gaz1990countydistance100miles.dtaAdded+3
- 83/replication_package/data/climate1950_2000.csvAdded+3
- 83/replication_package/data/climate1950_2000.dtaAdded+3
- 83/replication_package/data/counties_largeplants100mwff.csvAdded+3
- 83/replication_package/data/counties_largeplants100mwff.dtaAdded+3
- 83/replication_package/data/counties_tiger_2000.csvAdded+3
- 83/replication_package/data/counties_tiger_2000.dtaAdded+3
- 83/replication_package/data/county_distance_trlinesHv.csvAdded+3
- 83/replication_package/data/county_distance_trlinesHv.dtaAdded+3
- 83/replication_package/data/county_latlon_landarea.csvAdded+3
- 83/replication_package/data/county_latlon_landarea.dtaAdded+3
- 83/replication_package/data/deflator.xlsAdded+3
- 83/replication_package/data/deflator_historical.xlsAdded+3
- 83/replication_package/data/egrid2007_generators.csvAdded+3
- 83/replication_package/data/egrid2007_generators.dtaAdded+3
- 83/replication_package/data/egrid2007_plants_counties.csvAdded+3
- 83/replication_package/data/egrid2007_plants_counties.dtaAdded+3
- 83/replication_package/data/egrid_dams_sample.xlsxAdded+3
- 83/replication_package/data/eletricity_generation_usa.csvAdded+3
- 83/replication_package/data/eletricity_generation_usa.dtaAdded+3
- 83/replication_package/data/emp_c1990.csvAdded+3
- 83/replication_package/data/emp_c1990.dtaAdded+3
84 unmodified lines85868784 unmodified lines*.mpk filter=lfs diff=lfs merge=lfs -text*.log filter=lfs diff=lfs merge=lfs -text*.dct filter=lfs diff=lfs merge=lfs -text84 unmodified lines8586878884 unmodified lines*.mpk filter=lfs diff=lfs merge=lfs -text*.log filter=lfs diff=lfs merge=lfs -text*.dct filter=lfs diff=lfs merge=lfs -text*.gph filter=lfs diff=lfs merge=lfs -text
123version https://git-lfs.github.com/spec/v1oid sha256:b5768e05d32cd0280a50362dfb05b3dae4df8678c6846b5e4d51e150e41b51bbsize 5634570123version https://git-lfs.github.com/spec/v1oid sha256:2fe0e61e788a0118bd0ea7185e44f26a5a011766d083d87c53a6b62c7f069140size 5078166123version https://git-lfs.github.com/spec/v1oid sha256:d237d3b9f4aa15c9cb533313ac299a20572002975378e262f718fdd624dc2e97size 3800766123version https://git-lfs.github.com/spec/v1oid sha256:d92199762eda290509653f769cfa76e4fb5f36bd972f5bc44a9005f2ef740441size 1291205123version https://git-lfs.github.com/spec/v1oid sha256:4bac034b0871756c199879e80834215a6b1da03fbe0f711c2e47e90136121290size 634258123456789101112131415161718192021222324252627282930313233343536373839
clear allset more offglobal MAIN "/Users/luigipascali/Desktop/REPLICATION/" /*Insert here the directory of the replication material*/ cd "$MAIN"
***Install relevant packages
*Estanet from "$MAIN/ESTA/"net install esta, replace
*Conleycap program drop cap program drop xgmltcap program drop x_olsdo "$MAIN/PACKAGES/xgmlt.ado"do "$MAIN/PACKAGES/x_ols.ado"do "$MAIN/PACKAGES/x_gmm.ado"
*Lassossc install pdslassossc install lassopack
***Run do-filesdo "$MAIN/DO_FILES/Replication EthnoAtlas FINAL.do"do "$MAIN/DO_FILES/Replication Country Results FINAL.do"do "$MAIN/DO_FILES/Replication Ancient Settlements FINAL.do"do "$MAIN/DO_FILES/Replication Archaeological Results FINAL.do"
***Erase temp fileserase "$MAIN/TEMP1.dta"erase "$MAIN/TEMP2.dta"erase "$MAIN/TEMP_PANEL_country.dta"erase "$MAIN/TEMP_ANCIENT_CITIES.dta"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
************************************************************************************************************************************ UPLOAD DATASET AND DEFINE VARIABLESuse DATASET_ANCIENT_CITIES.dta, clear
*Settlements and archeological evidencegen ln1_ruin2_grid=ln(1+ruin2_grid)gen I_ruin2_grid=(ruin2_grid>0 & ruin2_grid~=.)
gen ln1_n_Pyramid_Mastaba=ln(1+n_Pyramid_Mastaba)gen I_Pyramid_Mastaba=(n_Pyramid_Mastaba>0 & n_Pyramid_Mastaba~=.)
gen ln1_n_Ancient_Temple=ln(1+n_Ancient_Temple)gen I_Ancient_Temple=(n_Ancient_Temple>0 & n_Ancient_Temple~=.)
gen ln1_n_Ancient_Mine=ln(1+n_Ancient_Mine)gen I_Ancient_Mine=(n_Ancient_Mine>0 & n_Ancient_Mine~=.)
gen ln1_n_Ancient_Palace=ln(1+n_Ancient_Palace)gen I_Ancient_Palace=(n_Ancient_Palace>0 & n_Ancient_Palace~=.)
gen ln1_n_Sculptured_Stone=ln(1+n_Sculptured_Stone)gen I_Sculptured_Stone=(n_Sculptured_Stone>0 & n_Sculptured_Stone~=.)
gen ln1_n_Standing_Stone=ln(1+n_Standing_Stone)gen I_Standing_Stone=(n_Standing_Stone>0 & n_Standing_Stone~=.)
gen dummy_ancient_city_500BC=(ancient_city_500BC>0)gen dummy_ancient_city_450AD=(ancient_city_450AD>0)
reg I_ruin1_grid only_cerforeach vari of var Precipitation Temperature Ruggedness irrigation_dep Plow_advantage1 Elevation {egen `vari'_std=std(`vari') if e(sample)==1}
*Old and New World gen old_world=1 if continent=="Africa" | continent=="Asia" | continent=="Oceania" | continent=="Europe"replace old_world=0 if continent=="North America" | continent=="South America"
**caloric advantage of cereals and land productivity before Columbian exchange
*crops Old Worldlocal cereals_ante_OW "Barley_median_cal, Buckwheat_median_cal , Dryland_Rice_median_cal ,Foxtail_Millet_median_cal, Oat_median_cal ,Pearl_Millet_median_cal, Rye_median_cal ,Sorghum_median_cal, Wetland_Rice_median_cal, Wheat_median_cal"local tubers_ante_OW "Yams_median_cal"
*crops New Worldlocal cereals_ante_NW "Maize_median_cal"local tubers_ante_NW "White_Potato_median_cal, Sweet_Potato_median_cal, Cassava_median_cal"
gen max_cal_ante_OW =max(`cereals_ante_OW' , `tubers_ante_OW', 0) /*here we have a zero because desertic places are considered as missing variables*/gen max_cal_ante_OW_t =max(`tubers_ante_OW' , 0) gen max_cal_ante_OW_c =max(`cereals_ante_OW' , 0) gen diff_cal_ante_OW =max_cal_ante_OW_c-max_cal_ante_OW_t
gen max_cal_ante_NW =max(`cereals_ante_NW' , `tubers_ante_NW', 0) gen max_cal_ante_NW_t =max(`tubers_ante_NW' , 0) gen max_cal_ante_NW_c =max(`cereals_ante_NW' , 0) gen diff_cal_ante_NW =max_cal_ante_NW_c-max_cal_ante_NW_t
gen max_cal_ante =max_cal_ante_OW if old_world==1replace max_cal_ante =max_cal_ante_NW if old_world==0
gen diff_cal_ante =diff_cal_ante_OW if old_world==1replace diff_cal_ante =diff_cal_ante_NW if old_world==0
egen std_max=std(max_cal_ante)egen std_diff=std(diff_cal_ante)
tabulate isocode, gen(dummy_country)
save TEMP_ANCIENT_CITIES, replace
************************************************************************************************************************************ TABLES IN PAPERuse TEMP_ANCIENT_CITIES, clear
***************************TABLE 4
reg I_ruin1_grid only_cer , cluster(isocode)est sto a1reg I_ruin1_grid only_cer only_rt both , cluster(isocode)est sto a2xi: reg I_ruin1_grid only_cer only_rt both i.continent , cluster(isocode)est sto a3xi: reg I_ruin1_grid only_cer only_rt both i.isocode , cluster(isocode)est sto a4
local controls_geo "only_rt both Precipitation_std Temperature_std Elevation_std Ruggedness_std abs_LatitudeA irrigation_dep_std Plow_advantage1_std "local dummy "dummy_country*"pdslasso I_ruin1_grid only_cer (`controls_geo' `dummy' ) , cluster(isocode)est sto a5
xi: reg dummy_ancient_city_450AD only_cer only_rt both , cluster(isocode)est sto a6pdslasso dummy_ancient_city_450AD only_cer (`controls_geo' `dummy' ) , cluster(isocode)est sto a7
xi: reg dummy_ancient_city_500BC only_cer only_rt both , cluster(isocode)est sto a8pdslasso dummy_ancient_city_500BC only_cer (`controls_geo' `dummy' ) , cluster(isocode)est sto a9
esta a* using Table4.txt, title(Table 4) se keep(only_cer only_rt both) replace starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE 5
reg I_ruin1_grid DIST_CLOSE_CER , cluster(isocode)est sto a1reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE , cluster(isocode)est sto a2xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a3xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE i.isocode , cluster(isocode)est sto a4
local controls_geo "DIST_CLOSE Precipitation_std Temperature_std Elevation_std Ruggedness_std abs_LatitudeA irrigation_dep_std Plow_advantage1_std "local dummy "dummy_country*"pdslasso I_ruin1_grid DIST_CLOSE_CER (`controls_geo' `dummy' ) , cluster(isocode)est sto a5
xi: reg dummy_ancient_city_450AD DIST_CLOSE_CER DIST_CLOSE , cluster(isocode)est sto a6pdslasso dummy_ancient_city_450AD DIST_CLOSE_CER (`controls_geo' `dummy' ) , cluster(isocode)est sto a7
xi: reg dummy_ancient_city_500BC DIST_CLOSE_CER DIST_CLOSE , cluster(isocode)est sto a8pdslasso dummy_ancient_city_500BC DIST_CLOSE_CER (`controls_geo' `dummy' ) , cluster(isocode)est sto a9
esta a* using Table5.txt, title(Table 5) se keep(DIST_CLOSE_CER DIST_CLOSE) replace starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
************************************************************************************************************************************ TABLES IN APPENDIX
*************************** FIGURE F12preservegen city="ancient large settlement" if I_ruin1_grid==1replace city="no large settlement" if I_ruin1_grid==0label var DIST_CLOSE_CER "Distance adoption cereals"label var DIST_CLOSE_ROOTTUBER "Distance adoption roots/tubers"graph box DIST_CLOSE_CER DIST_CLOSE_ROOTTUBER, over(city) nooutside ytitle("Distance in '000 km") graph export FigureF12.pdf, replacerestore***************************TABLE F3
latabstat dummy_ancient_city_450AD dummy_ancient_city_500BC I_ruin1_grid /// ruin2_grid /// n_Pyramid_Mastaba n_Ancient_Temple n_Ancient_Mine n_Ancient_Palace n_Sculptured_Stone n_Standing_Stone /// std_max std_diff only_cer only_rt both /// DIST_CLOSE_CER DIST_CLOSE /// Precipitation_std Temperature_std Elevation_std Ruggedness_std abs_LatitudeA irrigation_dep_std Plow_advantage1_std /// if I_ruin1_grid!=. & DIST_CLOSE!=. & only_cer!=., s(mean p50 sd Min Max N) f(%9.2fc) c(s) tf(TableF3_PanelA) replace
***************************TABLE F35*table A0 - APPENDIX: EXCLUDING CONTINENTS ONE BY ONEforeach cont in "Africa" "Asia" "Europe" "America" "Oceania"{xi: reg I_ruin1_grid only_cer only_rt both i.continent if continent_large!="`cont'" , cluster(isocode)est sto a2`cont'}esta a* using TableF35.txt, title(Table F35) se drop( _I*) replace starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE F36logit I_ruin1_grid only_cer , cluster(isocode)est sto a1logit I_ruin1_grid only_cer only_rt both , cluster(isocode)est sto a2xi: logit I_ruin1_grid only_cer only_rt both i.continent , cluster(isocode)est sto a3xi: logit I_ruin1_grid only_cer only_rt both i.isocode , cluster(isocode)est sto a4esta a* using TableF36.txt, title(Table F36) se drop( _I*) replace starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE F37xi: reg I_ruin1_grid only_cer only_rt both Precipitation_std i.continent , cluster(isocode)est sto a1xi: reg I_ruin1_grid only_cer only_rt both Temperature_std i.continent , cluster(isocode)est sto a2xi: reg I_ruin1_grid only_cer only_rt both Elevation_std i.continent , cluster(isocode)est sto a3xi: reg I_ruin1_grid only_cer only_rt both Ruggedness_std i.continent , cluster(isocode)est sto a4xi: reg I_ruin1_grid only_cer only_rt both abs_LatitudeA i.continent , cluster(isocode)est sto a5xi: reg I_ruin1_grid only_cer only_rt both irrigation_dep_std i.continent , cluster(isocode)est sto a6xi: reg I_ruin1_grid only_cer only_rt both Plow_advantage1_std i.continent , cluster(isocode)est sto a7
esta a* using TableF37.txt, title(Table F37) se drop( _I*) replace starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE F38xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE Precipitation_std i.continent , cluster(isocode)est sto a1xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE Temperature_std i.continent , cluster(isocode)est sto a2xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE Elevation_std i.continent , cluster(isocode)est sto a3xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE Ruggedness_std i.continent , cluster(isocode)est sto a4xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE abs_LatitudeA i.continent , cluster(isocode)est sto a5esta a* using TableF38.txt, title(Table F38) se drop( _I*) replace starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE F39xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE irrigation_dep_std i.continent , cluster(isocode)est sto a2xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE Plow_advantage1_std i.continent , cluster(isocode)est sto a3xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE i.continent if continent~="Europe" , cluster(isocode) est sto a5xi: reg I_ruin1_grid DIST_CLOSE_CER DIST_CLOSE i.continent if non_desert==1 , cluster(isocode) est sto a6esta a* using TableF39.txt, title(Table F39) drop( _I*) se replace starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE F40
xi: reg I_ruin2_grid DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a1xi: reg I_Pyramid_Mastaba DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a2xi: reg I_Ancient_Temple DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a3xi: reg I_Ancient_Mine DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a4xi: reg I_Ancient_Palace DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a5xi: reg I_Sculptured_Stone DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a6xi: reg I_Standing_Stone DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a7esta a* using TableF40.txt, title(Table F40) drop( _I*) replace se starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE F41 TO BE COMPLETEDxi: reg ln1_ruin2_grid DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a1xi: reg ln1_n_Pyramid_Mastaba DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a2xi: reg ln1_n_Ancient_Temple DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a3xi: reg ln1_n_Ancient_Mine DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a4xi: reg ln1_n_Ancient_Palace DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a5xi: reg ln1_n_Sculptured_Stone DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a6xi: reg ln1_n_Standing_Stone DIST_CLOSE_CER DIST_CLOSE i.continent , cluster(isocode)est sto a7esta a* using TableF41.txt, title(Table F41) drop( _I*) replace se starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE F42
*table A4xi: reg I_ruin2_grid DIST_CLOSE_CER DIST_CLOSE i.continent if continent~="Europe" , cluster(isocode)est sto a1xi: reg I_Pyramid_Mastaba DIST_CLOSE_CER DIST_CLOSE i.continent if continent~="Europe" , cluster(isocode)est sto a2xi: reg I_Ancient_Temple DIST_CLOSE_CER DIST_CLOSE i.continent if continent~="Europe" , cluster(isocode)est sto a3xi: reg I_Ancient_Mine DIST_CLOSE_CER DIST_CLOSE i.continent if continent~="Europe" , cluster(isocode)est sto a4xi: reg I_Ancient_Palace DIST_CLOSE_CER DIST_CLOSE i.continent if continent~="Europe" , cluster(isocode)est sto a5xi: reg I_Sculptured_Stone DIST_CLOSE_CER DIST_CLOSE i.continent if continent~="Europe" , cluster(isocode)est sto a6xi: reg I_Standing_Stone DIST_CLOSE_CER DIST_CLOSE i.continent if continent~="Europe" , cluster(isocode)est sto a7esta a* using TableF42.txt, title(Table F42) drop( _I*) replace se starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE F43
reg I_ruin1_grid std_diff , cluster(isocode)est sto a1reg I_ruin1_grid std_diff std_max , cluster(isocode)est sto a2xi: reg I_ruin1_grid std_diff std_max i.continent, cluster(isocode)est sto a3xi: reg I_ruin1_grid std_diff std_max i.isocode , cluster(isocode)est sto a4 xi: reg dummy_ancient_city_450AD std_diff std_max , cluster(isocode)est sto a5xi: reg dummy_ancient_city_450AD std_diff std_max i.continent, cluster(isocode)est sto a6xi: reg dummy_ancient_city_500BC std_diff std_max , cluster(isocode)est sto a7xi: reg dummy_ancient_city_500BC std_diff std_max i.continent, cluster(isocode)est sto a8
esta a* using TableF43.txt, title(Table F43) drop( _I*) se replace starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
************************************************************************************************************************************ UPLOAD DATASET AND DEFINE VARIABLES
use DATASET_ARCHAEOLOGY, clear
gen ln1_ATLAS_ruin1_grid=ln(1+ATLAS_ruin1_grid)gen I_ATLAS_ruin1_grid=(ATLAS_ruin1_grid>0 & ATLAS_ruin1_grid~=.)gen ln1_ATLAS_Settlements_grid=ln(1+ATLAS_Settlements_grid)gen I_ATLAS_Settlements_grid=(ATLAS_Settlements_grid>0 & ATLAS_Settlements_grid~=.)
label var I_ATLAS_ruin1_grid "Carbon-dated Archaeological evidence"label var I_ATLAS_Settlements_grid "Carbon-dated Archaeological evidence of settlements"
label var ln1_ATLAS_ruin1_grid "Carbon-dated Archaeological evidence (ln(1+ruins))"label var ln1_ATLAS_Settlements_grid "Carbon-dated Archaeological evidence of settlements (ln(1+settlements))"
************************************************************************************************************************************ TABLES IN PAPER
***************************TABLE 6
reg I_ATLAS_ruin1_grid c.ATLAS_Agriculture##c.both c.ATLAS_Agriculture##c.only_cer c.ATLAS_Agriculture##c.only_rt , cluster(isocode)est sto a1reg I_ATLAS_ruin1_grid c.ATLAS_Agriculture##c.DIST_CLOSE_CER c.ATLAS_Agriculture##c.DIST_CLOSE , cluster(isocode)est sto a2reg ln1_ATLAS_ruin1_grid c.ATLAS_Agriculture##c.both c.ATLAS_Agriculture##c.only_cer c.ATLAS_Agriculture##c.only_rt , cluster(isocode)est sto a3reg ln1_ATLAS_ruin1_grid c.ATLAS_Agriculture##c.DIST_CLOSE_CER c.ATLAS_Agriculture##c.DIST_CLOSE , cluster(isocode)est sto a4
reg I_ATLAS_Settlements_grid c.ATLAS_Agriculture##c.both c.ATLAS_Agriculture##c.only_cer c.ATLAS_Agriculture##c.only_rt , cluster(isocode)est sto a5reg I_ATLAS_Settlements_grid c.ATLAS_Agriculture##c.DIST_CLOSE_CER c.ATLAS_Agriculture##c.DIST_CLOSE , cluster(isocode)est sto a6reg ln1_ATLAS_Settlements_grid c.ATLAS_Agriculture##c.both c.ATLAS_Agriculture##c.only_cer c.ATLAS_Agriculture##c.only_rt , cluster(isocode)est sto a7reg ln1_ATLAS_Settlements_grid c.ATLAS_Agriculture##c.DIST_CLOSE_CER c.ATLAS_Agriculture##c.DIST_CLOSE , cluster(isocode)est sto a8esta a* using Table6.txt, title(Table 6) replace se starl(* 0.10 ** 0.05 *** 0.01) s(r2 N) order(c.ATLAS_Agriculture#c.only_cer c.ATLAS_Agriculture#c.both c.ATLAS_Agriculture#c.only_rt c.ATLAS_Agriculture#c.DIST_CLOSE_CER c.ATLAS_Agriculture#c.DIST_CLOSE) keep(c.ATLAS_Agriculture#c.only_cer c.ATLAS_Agriculture#c.both c.ATLAS_Agriculture#c.only_rt c.ATLAS_Agriculture#c.DIST_CLOSE_CER c.ATLAS_Agriculture#c.DIST_CLOSE) est clear
************************************************************************************************************************************ TABLES IN APPENDIX
***************************TABLE F3 Panel B
preservekeep if std_max!=. & only_cer!=.latabstat ATLAS_ruin1_grid ATLAS_Settlements_grid if std_max!=. & only_cer!=. , s(mean p50 sd Min Max N) f(%9.2fc) c(s) tf(TableF3_PanelB) replacerestore ***************************TABLE F44
reg I_ATLAS_ruin1_grid c.ATLAS_Agriculture##c.std_diff c.ATLAS_Agriculture##c.std_max , cluster(isocode)est sto a1reg ln1_ATLAS_ruin1_grid c.ATLAS_Agriculture##c.std_diff c.ATLAS_Agriculture##c.std_max , cluster(isocode)est sto a3reg I_ATLAS_Settlements_grid c.ATLAS_Agriculture##c.std_diff c.ATLAS_Agriculture##c.std_max , cluster(isocode)est sto a5reg ln1_ATLAS_Settlements_grid c.ATLAS_Agriculture##c.std_diff c.ATLAS_Agriculture##c.std_max , cluster(isocode)est sto a7esta a* using TableF44.txt, title(Table F44) replace se starl(* 0.10 ** 0.05 *** 0.01) s(r2 N) keep( c.ATLAS_Agriculture#c.std_diff c.ATLAS_Agriculture#c.std_max) est clear
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
************************************************************************************************************************************ UPLOAD DATASET AND DEFINE VARIABLESuse DATASET_COUNTRIES.dta, clear
*dummiestabulate year, gen(dummy_Y_)tabulate isocode, gen(dummy_C_)
*State capacitygen hierarchy_1=1 if (PUTTER2_S1>0 & PUTTER2_S1~=. )replace hierarchy_1=0 if (PUTTER2_S1==0 & PUTTER2_S1~=. )gen hierarchy_3=PUTTER2_S1
*Old and New World gen old_world=1 if Continent=="Africa" | Continent=="Asia" | Continent=="Oceania"replace old_world=0 if Continent=="America"
**calories before and after new crops*ante Old Worldlocal cereals_ante_OW "Barley_median_cal, Buckwheat_median_cal , Dryland_Rice_median_cal ,Foxtail_Millet_median_cal, Oat_median_cal ,Pearl_Millet_median_cal, Rye_median_cal ,Sorghum_median_cal, Wetland_Rice_median_cal, Wheat_median_cal"local tubers_ante_OW "Yams_median_cal"
*ante New Worldlocal cereals_ante_NW "Maize_median_cal"local tubers_ante_NW "White_Potato_median_cal, Sweet_Potato_median_cal, Cassava_median_cal"
**main regressorsgen max_cal_ante_OW =max(`cereals_ante_OW' , `tubers_ante_OW', 0) /*here we have a zero because desertic places are considered as missing variables*/gen max_cal_ante_OW_t =max(`tubers_ante_OW' , 0) gen max_cal_ante_OW_c =max(`cereals_ante_OW' , 0) gen diff_cal_ante_OW =max_cal_ante_OW_c-max_cal_ante_OW_t
gen max_cal_ante_NW =max(`cereals_ante_NW' , `tubers_ante_NW', 0) gen max_cal_ante_NW_t =max(`tubers_ante_NW' , 0) gen max_cal_ante_NW_c =max(`cereals_ante_NW' , 0) gen diff_cal_ante_NW =max_cal_ante_NW_c-max_cal_ante_NW_t
gen max_cal_ante =max_cal_ante_OW if (Continent=="Asia" | Continent=="Europe" | Continent=="Africa" | Continent=="Oceania")replace max_cal_ante =max_cal_ante_NW if Continent=="America"
gen max_cal_post_c =max(max_cal_ante_OW_c, max_cal_ante_NW_c , 0) gen max_cal_post_t =max(max_cal_ante_OW_t, max_cal_ante_NW_t , 0) gen max_cal_post =max(max_cal_ante_NW , max_cal_ante_OW, 0)
gen diff_cal_ante =diff_cal_ante_OW if (Continent=="Asia" | Continent=="Europe" | Continent=="Africa" | Continent=="Oceania")replace diff_cal_ante =diff_cal_ante_NW if Continent=="America" gen diff_cal_post =max_cal_post_c-max_cal_post_t
gen max_cal_year = max_cal_ante_OW if year<=1500 & (Continent=="Asia" | Continent=="Europe" | Continent=="Africa" | Continent=="Oceania")replace max_cal_year = max_cal_ante_NW if year<=1500 & Continent=="America"replace max_cal_year = max_cal_post if year>=1600
gen diff_cal_year = diff_cal_ante_OW if year<=1500 & (Continent=="Asia" | Continent=="Europe" | Continent=="Africa" | Continent=="Oceania")replace diff_cal_year = diff_cal_ante_NW if year<=1500 & Continent=="America"replace diff_cal_year = diff_cal_post if year>=1600
**Galor/Ozak measure of suitability of landgen max_cal_Galor_year = suit_GalOz_Pre if year<=1500replace max_cal_Galor_year = suit_GalOz_Post if yea>=1600
**calories from plough positive and plough negative crops *these are the crops used in Alesina, Giuliano, Nunn. local plowpos_ante_OW "Barley_median_cal, Rye_median_cal , Wheat_median_cal"local plowneg_ante_OW "Foxtail_Millet_median_cal, Pearl_Millet_median_cal, Sorghum_median_cal"
local plowpos_ante_NW "0"local plowneg_ante_NW "0"
gen max_cal_ante_OW_pp =max(`plowpos_ante_OW' , 0) gen max_cal_ante_OW_pn =max(`plowneg_ante_OW' , 0) gen plow_cal_ante_OW =max_cal_ante_OW_pp-max_cal_ante_OW_pn
gen max_cal_ante_NW_pp =max(`plowpos_ante_NW' , 0) gen max_cal_ante_NW_pn =max(`plowneg_ante_NW' , 0) gen plow_cal_ante_NW =max_cal_ante_NW_pp-max_cal_ante_NW_pn
gen max_cal_post_pp =max(max_cal_ante_OW_pp,max_cal_ante_NW_pp , 0) gen max_cal_post_pn =max(max_cal_ante_OW_pn,max_cal_ante_NW_pn , 0) gen plow_cal_post =max_cal_post_pp-max_cal_post_pn
gen plow_cal_year = plow_cal_ante_OW if year<=1500 & (Continent=="Asia" | Continent=="Europe" | Continent=="Africa" | Continent=="Oceania")replace plow_cal_year = plow_cal_ante_NW if year<=1500 & Continent=="America"replace plow_cal_year = plow_cal_post if year>=1600
* alternative samplegen sample_time3=1 if (year<=1500 | year>=1750)gen sample_time5=1 if year>=1000 & (year<=1500 | year>=1600)
*dummiestabulate Continent, generate(dum_continent_)global dummy1 "dum_continent_*"
*standardize variablesgen PUGA_abslat=abs(PUGA_lat)replace PUGA_tropical= PUGA_tropical/100
egen std_PRECIP_mean_precip =std(PRECIP_mean_precip) if year>=1000 egen std_ACEMOG_temp1 =std(ACEMOG_temp1) if year>=1000 egen std_GEO_elev =std(GEO_elev) if year>=1000 egen std_PUGA_rugged =std(PUGA_rugged) if year>=1000 egen std_PUGA_abslat =std(PUGA_abslat) if year>=1000 egen std_ACEMOG_lpd1500 =std(ACEMOG_lpd1500) if year>=1000 egen std_ACEMOG_logem4 =std(ACEMOG_logem4) if year>=1000 egen std_PUGA_slave_exports =std(PUGA_slave_exports) if year>=1000 egen std_GEO_distr =std(GEO_distr) if year>=1000 egen std_GEO_distcr =std(GEO_distcr) if year>=1000 egen std_GALOR_pdiv_aa =std(GALOR_pdiv_aa) if year>=1000 egen std_max_cal_year =std(max_cal_year) if year>=1000
egen std1_PRECIP_mean_precip =std(PRECIP_mean_precip) if year==450 egen std1_ACEMOG_temp1 =std(ACEMOG_temp1) if year==450 egen std1_GEO_elev =std(GEO_elev) if year==450 egen std1_PUGA_rugged =std(PUGA_rugged) if year==450 egen std1_PUGA_abslat =std(PUGA_abslat) if year==450 egen std1_ACEMOG_lpd1500 =std(ACEMOG_lpd1500) if year==450 egen std1_ACEMOG_logem4 =std(ACEMOG_logem4) if year==450 egen std1_PUGA_slave_exports =std(PUGA_slave_exports) if year==450 egen std1_GEO_distr =std(GEO_distr) if year==450 egen std1_GEO_distcr =std(GEO_distcr) if year==450 egen std1_GALOR_pdiv_aa =std(GALOR_pdiv_aa) if year==450 egen std1_max_cal_year =std(max_cal_year) if year==450
egen std_max_cal_Galor_year =std(max_cal_Galor_year) if year>=1000
egen std_diff_cal_year =std(diff_cal_year) if year>=1000
egen std_max_cal_ante1 =std(max_cal_ante) if year>=0 egen std_max_cal_ante =std(max_cal_ante) if year>=1000 egen std_max_cal_post =std(max_cal_post) if year>=1000
egen std_diff_cal_ante1 =std(diff_cal_ante) if year>=0 egen std_diff_cal_ante =std(diff_cal_ante) if year>=1000 egen std_diff_cal_post =std(diff_cal_post) if year>=1000
egen std_plow_cal_year =std(plow_cal_year) if year>=1000
gen std_max_cal_yearPOST_ANTE =std_max_cal_post-std_max_cal_ante
gen std_diff_cal_yearPOST_ANTE =std_diff_cal_post-std_diff_cal_ante
*controlsgen post=1 if year>1500replace post=0 if year<=1500
gen precipitation_post =std_PRECIP_mean_precip*postgen temperature_post =std_ACEMOG_temp1*postgen elevation_post =std_GEO_elev*postgen rugged_post =std_PUGA_rugged*postgen abslat_post =std_PUGA_abslat*postgen legor_fra_post =PUGA_legor_fra*post gen legor_soc_post =PUGA_legor_soc*post gen legor_deu_post =PUGA_legor_deu*post gen legor_sca_post =PUGA_legor_sca*post gen slave_exports_post =std_PUGA_slave_exports*post gen lpd1500s_post =std_ACEMOG_lpd1500*postgen logem4_post =std_ACEMOG_logem4*postgen genetic_div_post =std_GALOR_pdiv_aa*post gen distr_post =std_GEO_distr *postgen distcr_post =std_GEO_distcr*postgen Mal46a_post =GEO_Mal46a*post
gen tropical_post =PUGA_tropical*postgen plow_post =std_plow_cal_year*post
gen area_post =area1*post
gen animal_density_post =animal_density*postgen ruminant_density_post =ruminant_density*post
gen irrigation_post =BENTZEN_irri_impact5*post
*variables interacted with year dummiesforeach lname of num 1(1)20 {gen std_max_cal_ante__`lname'= std_max_cal_ante*dummy_Y_`lname'}
foreach lname of num 1(1)20 {gen std_diff_cal_ante__`lname'= std_diff_cal_ante*dummy_Y_`lname'}
foreach lname of num 1(1)20 {gen std_max_cal_post__`lname'= std_max_cal_post*dummy_Y_`lname'}
foreach lname of num 1(1)20 {gen std_diff_cal_post__`lname'= std_diff_cal_post*dummy_Y_`lname'}
foreach lname of num 1(1)20 {gen std_max_cal_yearPOST_ANTE__`lname'= std_max_cal_yearPOST_ANTE*dummy_Y_`lname'}
foreach lname of num 1(1)20 {gen std_diff_cal_yearPOST_ANTE__`lname'= std_diff_cal_yearPOST_ANTE*dummy_Y_`lname'}
foreach year1 of numlist 1000 1500 1600 1650 1700 1750 {gen std_max_cal_year`year1'_1 =std_max_cal_year if year==`year1'egen std_max_cal_year`year1' =max(std_max_cal_year`year1'_1), by(country)
gen std_diff_cal_year`year1'_1 =std_diff_cal_year if year==`year1'egen std_diff_cal_year`year1' =max(std_diff_cal_year`year1'_1), by(country)
gen hierarchy_3_`year1'_1 =hierarchy_3 if year==`year1'egen hierarchy_3_`year1' =max(hierarchy_3_`year1'_1), by(country)}
foreach year1 of numlist 1600 1650 1700 1750 {gen std_max_cal_year_1500_`year1' =std_max_cal_year`year1' -std_max_cal_year1500gen std_diff_cal_year_1500_`year1' =std_diff_cal_year`year1' -std_diff_cal_year1500gen hierarchy_3_1500_`year1' =hierarchy_3_`year1' -hierarchy_3_1500}
*variables interacted with trendgen std_diff_cal_yearPOST_ANTE_inty=std_diff_cal_yearPOST_ANTE*yeargen std_max_cal_yearPOST_ANTE_inty=std_max_cal_yearPOST_ANTE*year
save TEMP_PANEL_country, replace
************************************************************************************************************************************ TABLES IN PAPERuse TEMP_PANEL_country, clear
***************************TABLE 2
ivreg2 hierarchy_3 only_cer if year==450 , rest sto a1ivreg2 hierarchy_3 only_cer only_rt both if year==450 , rest sto a2ivreg2 hierarchy_3 $dummy1 only_cer only_rt both if year==450 , rest sto a3ivreg2 hierarchy_3 $dummy1 only_cer only_rt both PUGA_abslat if year==450 , rest sto a4ivreg2 hierarchy_3 $dummy1 only_cer only_rt both PRECIP_mean_precip if year==450 , rest sto a5ivreg2 hierarchy_3 $dummy1 only_cer only_rt both ACEMOG_temp1 if year==450 , rest sto a6ivreg2 hierarchy_3 $dummy1 only_cer only_rt both GEO_elev if year==450 , rest sto a7ivreg2 hierarchy_3 $dummy1 only_cer only_rt both PUGA_rugged if year==450 , rest sto a8
local controls "only_rt both PUGA_legor_fra PUGA_legor_soc PUGA_legor_deu PUGA_legor_sca PRECIP_mean_precip ACEMOG_temp1 GEO_elev PUGA_rugged PUGA_abslat dum_continent_* std1_ACEMOG_lpd1500 std1_ACEMOG_logem4 std1_PUGA_slave_exports std1_GALOR_pdiv_aa std1_GEO_distr std1_GEO_distcr GEO_Mal46a PUGA_tropical animal_density ruminant_density BENTZEN_irri_impact5"ivlasso hierarchy_3 only_cer (`controls') if year==450 , sqrt cluster(isocode) est sto a9esta a* using Table2.txt, s(N r2) replace se starl(* 0.10 ** 0.05 *** 0.01) drop($dummy1) title(TABLE 2)est clear
***************************TABLE 3
ivreg2 hierarchy_3 std_max_cal_year dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a0ivreg2 hierarchy_3 std_diff_cal_year dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a1ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a2ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year precipitation_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a3ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year temperature_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a4ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year elevation_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a5ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year rugged_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a6ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year abslat_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a7
local controls "std_max_cal_year precipitation_post temperature_post elevation_post rugged_post abslat_post dummy_C_* dummy_Y_* legor_*post lpd1500s_post logem4_post slave_exports_post distr_post distcr_post Mal46a_post tropical_post genetic_div_post animal_density_post ruminant_density_post irrigation_post"ivlasso hierarchy_3 std_diff_cal_year (`controls') if sample_time5==1 , sqrt cluster(isocode) est sto a8
esta a* using Table3.txt, s(N r2) replace order(std_diff_cal_year std_max_cal_year) se starl(* 0.10 ** 0.05 *** 0.01) drop(dummy_C_* dummy_Y_*) title(TABLE 3)est clear
************************************************************************************************************************************ TABLES IN APPENDIX
***************************FIGURE F3
preserveivreg2 hierarchy_3 std_max_cal_year dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )gen samp=e(sample)keep if e(sample)==1 keep country year name_colonizergen colony_=(name_colonizer!="")egen colony_ever=max(colony_), by(country)keep if colony_ever==1 & year>=1400sort country year encode country, gen(country1)
gen country2=0replace country2=country1browse country2 country1 if year==1400drop country2
drop country name_colonizer colony_everrename colony_ v_reshape wide v_, i(year) j(country1)foreach l of numlist 1/108 {replace v_`l'=`l' if v_`l'==1replace v_`l'=. if v_`l'==0}
label define countries ///1 "Albania" ///2 "Algeria" ///3 "Angola" ///4 "Argentina" ///5 "Armenia" ///6 "Australia" ///7 "Azerbaijan" ///8 "Bangladesh" ///9 "Barbados" ///10 "Belarus" ///11 "Benin" ///12 "Bolivia" ///13 "Bosnia Herzegovina" ///14 "Botswana" ///15 "Brazil" ///16 "Bulgaria" ///17 "Burkina Faso" ///18 "Burundi" ///19 "Comoros" ///20 "Cambodia" ///21 "Cameroon" ///22 "Canada" ///23 "Cape Verde" ///24 "Central African Republc" ///25 "Chad" ///26 "Chile" ///27 "Colombia" ///28 "Congo, Rep." ///29 "Costa Rica" ///30 "Cote d'Ivoire" ///31 "Cuba" ///32 "Democr Rep. of Congo" ///33 "Dominican Republic" ///34 "Equatorial Guinea" ///35 "Ecuador" ///36 "Egypt, Arab Rep." ///37 "El Salvador" ///38 "Eritrea" ///39 "Gabon" ///40 "Gambia, The" ///41 "Georgia" ///42 "Ghana" ///43 "Grenada" ///44 "Guatemala" ///45 "Guinea" ///46 "Guyana" ///47 "Haiti" ///48 "Honduras" ///49 "Hong Kong, China" ///50 "India" ///51 "Indonesia" ///52 "Iraq" ///53 "Israel" ///54 "Jamaica" ///55 "Jordan" ///56 "Kenya" ///57 "Kyrgyzstan" ///58 "Laos" ///59 "Latvia" ///60 "Lebanon" ///61 "Lesotho" ///62 "Libya" ///63 "Lithuania" ///64 "Madagascar" ///65 "Malawi" ///66 "Malaysia" ///67 "Mali" ///68 "Mauritania" ///69 "Mexico" ///70 "Morocco" ///71 "Mozambique" ///72 "Myanmar" ///73 "Namibia" ///74 "New Zealand" ///75 "Nicaragua" ///76 "Niger" ///77 "Nigeria" ///78 "Pakistan" ///79 "Panama" ///80 "Papua New Guinea" ///81 "Paraguay" ///82 "Peru" ///83 "Philippines" ///84 "Rwanda" ///85 "Senegal" ///86 "Serbia and Montenegro" ///87 "Sierra Leone" ///88 "Singapore" ///89 "Somalia" ///90 "South Africa" ///91 "Sri Lanka" ///92 "Sudan" ///93 "Swaziland" ///94 "Syrian Arab Rep." ///95 "Tanzania" ///96 "Togo" ///97 "Trinidad and Tobago" ///98 "Tunisia" ///99 "Turkmenistan" ///100 "Uganda" ///101 "United States" ///102 "Uruguay" ///103 "Uzbekistan" ///104 "Venezuela" ///105 "Vietnam" ///106 "Yemen" ///107 "Zambia" ///108 "Zimbabwe"
foreach l of numlist 1/108 { label val v_`l' countries}
foreach l of numlist 108/1 { order v_`l' }
scatter v_1-v_54 year if year<1950, ylabel(1(1)54) ylabel(, val angle(horizontal) labsize(vsmall)) xlabel(, angle(45) labsize(vsmall)) xlabel(1400(50)1900) xtitle("Years") graphregion(fcolor(white) lwidth(medthin) lcolor(black)) legend(off) graph save "Time_Coverage_Colony_p1.gph", replacegraph export FigureF3_part2, as(pdf) replacescatter v_55-v_108 year if year<1950, ylabel(55(1)108) ylabel(, val angle(horizontal) labsize(vsmall)) xlabel(, angle(45) labsize(vsmall)) xlabel(1400(50)1900) xtitle("Years") graphregion(fcolor(white) lwidth(medthin) lcolor(black)) legend(off) graph save "Time_Coverage_Colony_p2.gph", replacegraph export FigureF3_part1, as(pdf) replacerestoreerase "Time_Coverage_Colony_p1.gph"erase "Time_Coverage_Colony_p2.gph"
***************************TABLE F2latabstat hierarchy_3 std_max_cal_year std_diff_cal_year only_cer only_rt both /// std_PRECIP_mean_precip std_ACEMOG_temp1 std_GEO_elev std_PUGA_rugged std_PUGA_abslat /// PUGA_legor_* std_ACEMOG_lpd1500 std_ACEMOG_logem4 std_PUGA_slave_exports std_GALOR_pdiv_aa /// animal_density ruminant_density /// std_GEO_distr std_GEO_distcr GEO_Mal46a PUGA_tropical BENTZEN_irri_impact5 std_max_cal_Galor_year /// if sample_time5==1 , s(mean p50 sd Min Max N) f(%9.2fc) c(s) tf(TableF2) replace
***************************TABLE F23
ivreg2 hierarchy_3 $dummy1 only_cer only_rt both PUGA_legor_fra PUGA_legor_soc PUGA_legor_deu PUGA_legor_sca if year==450 , rest sto a1ivreg2 hierarchy_3 $dummy1 only_cer only_rt both std1_ACEMOG_lpd1500 if year==450 , rest sto a2ivreg2 hierarchy_3 $dummy1 only_cer only_rt both std1_ACEMOG_logem4 if year==450 , rest sto a3ivreg2 hierarchy_3 $dummy1 only_cer only_rt both std1_PUGA_slave_exports if year==450 , rest sto a4ivreg2 hierarchy_3 $dummy1 only_cer only_rt both std1_GALOR_pdiv_aa if year==450 , rest sto a5ivreg2 hierarchy_3 $dummy1 only_cer only_rt both std1_GEO_distr if year==450 , rest sto a6ivreg2 hierarchy_3 $dummy1 only_cer only_rt both std1_GEO_distcr if year==450 , rest sto a7esta a* using TableF23.txt, replace s(N r2) order(only_cer only_rt both) se drop($dummy1) starl(* 0.10 ** 0.05 *** 0.01) title(Table F23)est clear
***************************TABLE F24
ivreg2 hierarchy_3 $dummy1 only_cer only_rt both GEO_Mal46a if year==450 , rest sto a1ivreg2 hierarchy_3 $dummy1 only_cer only_rt both PUGA_tropical if year==450 , rest sto a2ivreg2 hierarchy_3 $dummy1 only_cer only_rt both animal_density if year==450 , rest sto a3ivreg2 hierarchy_3 $dummy1 only_cer only_rt both ruminant_density if year==450 , rest sto a4ivreg2 hierarchy_3 $dummy1 only_cer only_rt both BENTZEN_irri_impact5 if year==450 , rest sto a5esta a* using TableF24.txt, replace s(N r2) order(only_cer only_rt both) se drop($dummy1) starl(* 0.10 ** 0.05 *** 0.01) title(Table F24)est clear
***************************TABLE F25foreach cont in "Africa" "Asia" "Europe" "America" "Oceania"{ivreg2 hierarchy_3 $dummy1 only_cer only_rt both if year==450 & Continent!="`cont'", rest sto a2`cont'}esta a* using TableF25.txt, title(TABLE F25) drop($dummy1) se replace starl(* 0.10 ** 0.05 *** 0.01) s(r2 N)est clear
***************************TABLE F26ivreg2 hierarchy_3 $dummy1 std_diff_cal_ante1 std_max_cal_ante1 if year==450 , rest sto a1ivreg2 hierarchy_3 $dummy1 std_diff_cal_ante1 std_max_cal_ante1 PUGA_abslat if year==450 , rest sto a2ivreg2 hierarchy_3 $dummy1 std_diff_cal_ante1 std_max_cal_ante1 PRECIP_mean_precip if year==450 , rest sto a3ivreg2 hierarchy_3 $dummy1 std_diff_cal_ante1 std_max_cal_ante1 ACEMOG_temp1 if year==450 , rest sto a4ivreg2 hierarchy_3 $dummy1 std_diff_cal_ante1 std_max_cal_ante1 GEO_elev if year==450 , rest sto a5ivreg2 hierarchy_3 $dummy1 std_diff_cal_ante1 std_max_cal_ante1 PUGA_rugged if year==450 , rest sto a6
esta a* using TableF26.txt, s(N r2) replace order(std_diff_cal_ante1 std_max_cal_ante1) drop($dummy1) se starl(* 0.10 ** 0.05 *** 0.01) title(Table F26)est clear
***************************TABLE F27
ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year legor_*post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a1ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year lpd1500s_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a2ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year logem4_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a3ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year slave_exports_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a4ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year genetic_div_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a5ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year distr_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a6ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year distcr_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a7esta a* using TableF27.txt, replace s(N r2) order(std_diff_cal_year std_max_cal_year) se starl(* 0.10 ** 0.05 *** 0.01) drop(dummy_C_* dummy_Y_*) title(Table F27)est clear
***************************TABLE F28
ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year Mal46a_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a1ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year tropical_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a2ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year animal_density_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a3ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year ruminant_density_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a4ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year irrigation_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a5
esta a* using TableF28.txt, replace s(N r2) order(std_diff_cal_year std_max_cal_year) se starl(* 0.10 ** 0.05 *** 0.01) drop(dummy_C_* dummy_Y_*) title(Table F28)est clear
***************************TABLE F29ivreg2 hierarchy_3 std_diff_cal_year dummy_C_* dummy_Y_* if sample_time5==1 & name_colonizer=="", cluster(isocode )est sto a1ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year dummy_C_* dummy_Y_* if sample_time5==1 & name_colonizer=="", cluster(isocode )est sto a2ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year precipitation_post dummy_C_* dummy_Y_* if sample_time5==1 & name_colonizer=="", cluster(isocode )est sto a3ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year temperature_post dummy_C_* dummy_Y_* if sample_time5==1 & name_colonizer=="", cluster(isocode )est sto a4ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year elevation_post dummy_C_* dummy_Y_* if sample_time5==1 & name_colonizer=="", cluster(isocode )est sto a5ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year rugged_post dummy_C_* dummy_Y_* if sample_time5==1 & name_colonizer=="", cluster(isocode )est sto a6ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year abslat_post dummy_C_* dummy_Y_* if sample_time5==1 & name_colonizer=="", cluster(isocode )est sto a7
esta a* using TableF29.txt, replace s(N r2) order(std_diff_cal_year std_max_cal_year) se starl(* 0.10 ** 0.05 *** 0.01) drop(dummy_C_* dummy_Y_*) title(Table F29)est clear
***************************TABLE F30
ivreg2 hierarchy_1 std_diff_cal_year dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a1ivreg2 hierarchy_1 std_max_cal_year std_diff_cal_year dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a2ivreg2 hierarchy_1 std_max_cal_year std_diff_cal_year precipitation_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a3ivreg2 hierarchy_1 std_max_cal_year std_diff_cal_year temperature_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a4ivreg2 hierarchy_1 std_max_cal_year std_diff_cal_year elevation_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a5ivreg2 hierarchy_1 std_max_cal_year std_diff_cal_year rugged_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a6ivreg2 hierarchy_1 std_max_cal_year std_diff_cal_year abslat_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a7
esta a* using TableF30.txt, replace s(N r2) order(std_diff_cal_year std_max_cal_year) se starl(* 0.10 ** 0.05 *** 0.01) drop(dummy_C_* dummy_Y_*) title(Table F30)est clear
***************************TABLE F31
ivreg2 hierarchy_3 std_diff_cal_year dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a1ivreg2 hierarchy_3 std_max_cal_Galor_year std_diff_cal_year dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a2ivreg2 hierarchy_3 std_max_cal_Galor_year std_diff_cal_year precipitation_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a3ivreg2 hierarchy_3 std_max_cal_Galor_year std_diff_cal_year temperature_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a4ivreg2 hierarchy_3 std_max_cal_Galor_year std_diff_cal_year elevation_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a5ivreg2 hierarchy_3 std_max_cal_Galor_year std_diff_cal_year rugged_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a6ivreg2 hierarchy_3 std_max_cal_Galor_year std_diff_cal_year abslat_post dummy_C_* dummy_Y_* if sample_time5==1 , cluster(isocode )est sto a7
esta a* using TableF31.txt, replace s(N r2) order(std_diff_cal_year std_max_cal_Galor_year) se starl(* 0.10 ** 0.05 *** 0.01) drop(dummy_C_* dummy_Y_*) title(Table F31)est clear
***************************TABLE F32
ivreg2 hierarchy_3 std_diff_cal_year dummy_C_* dummy_Y_* if year>=1000 & (year<=1500 | year>=1750) , cluster(isocode )est sto a1ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year dummy_C_* dummy_Y_* if year>=1000 & (year<=1500 | year>=1750) , cluster(isocode )est sto a2ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year precipitation_post dummy_C_* dummy_Y_* if year>=1000 & (year<=1500 | year>=1750) , cluster(isocode )est sto a3ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year temperature_post dummy_C_* dummy_Y_* if year>=1000 & (year<=1500 | year>=1750) , cluster(isocode )est sto a4ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year elevation_post dummy_C_* dummy_Y_* if year>=1000 & (year<=1500 | year>=1750) , cluster(isocode )est sto a5ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year rugged_post dummy_C_* dummy_Y_* if year>=1000 & (year<=1500 | year>=1750) , cluster(isocode )est sto a6ivreg2 hierarchy_3 std_max_cal_year std_diff_cal_year abslat_post dummy_C_* dummy_Y_* if year>=1000 & (year<=1500 | year>=1750) , cluster(isocode )est sto a7
esta a* using TableF32.txt, replace s(N r2) order(std_diff_cal_year std_max_cal_year) se starl(* 0.10 ** 0.05 *** 0.01) drop(dummy_C_* dummy_Y_*) title(Table F32)est clear
***************************TABLE F33
ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE_inty year std_diff_cal_yearPOST_ANTE dummy_C_* dummy_Y_* if year>=1000 & year<=1500 , cluster(isocode )est sto a1ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE_inty year std_diff_cal_yearPOST_ANTE std_max_cal_yearPOST_ANTE_inty std_max_cal_yearPOST_ANTE dummy_C_* dummy_Y_* if year>=1000 & year<=1500 , cluster(isocode )est sto a2ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE_inty year std_diff_cal_yearPOST_ANTE std_max_cal_yearPOST_ANTE_inty std_max_cal_yearPOST_ANTE precipitation_post dummy_C_* dummy_Y_* if year>=1000 & year<=1500 , cluster(isocode )est sto a3ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE_inty year std_diff_cal_yearPOST_ANTE std_max_cal_yearPOST_ANTE_inty std_max_cal_yearPOST_ANTE temperature_post dummy_C_* dummy_Y_* if year>=1000 & year<=1500 , cluster(isocode )est sto a4ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE_inty year std_diff_cal_yearPOST_ANTE std_max_cal_yearPOST_ANTE_inty std_max_cal_yearPOST_ANTE elevation_post dummy_C_* dummy_Y_* if year>=1000 & year<=1500 , cluster(isocode )est sto a5ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE_inty year std_diff_cal_yearPOST_ANTE std_max_cal_yearPOST_ANTE_inty std_max_cal_yearPOST_ANTE rugged_post dummy_C_* dummy_Y_* if year>=1000 & year<=1500 , cluster(isocode )est sto a6ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE_inty year std_diff_cal_yearPOST_ANTE std_max_cal_yearPOST_ANTE_inty std_max_cal_yearPOST_ANTE abslat_post dummy_C_* dummy_Y_* if year>=1000 & year<=1500 , cluster(isocode )est sto a7
esta a* using TableF33.txt, replace s(N r2) order(std_diff_cal_yearPOST_ANTE std_diff_cal_yearPOST_ANTE_inty std_max_cal_yearPOST_ANTE std_max_cal_yearPOST_ANTE_inty) keep(std_diff_cal_yearPOST_ANTE_inty std_max_cal_yearPOST_ANTE_inty ) se starl(* 0.10 ** 0.05 *** 0.01) title(Table F33)est clear
***************************TABLE F34
ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE__3-std_diff_cal_yearPOST_ANTE__19 dummy_C_* dummy_Y_* if year>=1000 & year<=1850 , cluster(isocode )est sto a1ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE__3-std_diff_cal_yearPOST_ANTE__19 std_max_cal_yearPOST_ANTE__3-std_max_cal_yearPOST_ANTE__19 dummy_C_* dummy_Y_* if year>=1000 & year<=1850 , cluster(isocode )est sto a2ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE__3-std_diff_cal_yearPOST_ANTE__19 std_max_cal_yearPOST_ANTE__3-std_max_cal_yearPOST_ANTE__19 precipitation_post dummy_C_* dummy_Y_* if year>=1000 & year<=1850 , cluster(isocode )est sto a3ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE__3-std_diff_cal_yearPOST_ANTE__19 std_max_cal_yearPOST_ANTE__3-std_max_cal_yearPOST_ANTE__19 temperature_post dummy_C_* dummy_Y_* if year>=1000 & year<=1850 , cluster(isocode )est sto a4ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE__3-std_diff_cal_yearPOST_ANTE__19 std_max_cal_yearPOST_ANTE__3-std_max_cal_yearPOST_ANTE__19 elevation_post dummy_C_* dummy_Y_* if year>=1000 & year<=1850 , cluster(isocode )est sto a5ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE__3-std_diff_cal_yearPOST_ANTE__19 std_max_cal_yearPOST_ANTE__3-std_max_cal_yearPOST_ANTE__19 rugged_post dummy_C_* dummy_Y_* if year>=1000 & year<=1850 , cluster(isocode )est sto a6ivreg2 hierarchy_3 std_diff_cal_yearPOST_ANTE__3-std_diff_cal_yearPOST_ANTE__19 std_max_cal_yearPOST_ANTE__3-std_max_cal_yearPOST_ANTE__19 abslat_post dummy_C_* dummy_Y_* if year>=1000 & year<=1850 , cluster(isocode )est sto a7
esta a* using TableF34.txt, replace s(N r2) order(std_diff_cal_yearPOST_ANTE__*) keep(std_diff_cal_yearPOST_ANTE__*) se starl(* 0.10 ** 0.05 *** 0.01) title(Table F34)est clear123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
global outopts dec(3) label nocons excel ctitle(" ") cttop(" ") nonotes drop(const)
***Preamblecapture program drop newcov program define newcov, eclass ereturn repost V=cov_dep end
capture program drop F_stat_eiprogram define F_stat_ei, eclass ereturn scalar widstat=Fstat end
***Conley's logitcap program drop conleylogitmfxprogram define conleylogitmfx args depvar outfile ncont preserve for @ in any latitude longitude `depvar' const $currentcontrols: drop if missing(@)==1 keep if `depvar'~=. xgmlt latitude longitude c1 c2 `depvar' $currentcontrols const, xreg(`ncont') coord(2) logit `depvar' $currentcontrols newcov outreg2 using `outfile', $outopts append e(N r2_p) tex
restoreend
***Conley's OLScap program drop conleyolsprogram define conleyols args depvar outfile ncont preserve ereturn clear cap drop epsilon window dis1 dis2 for @ in any latitude longitude `depvar' const $currentcontrols: drop if missing(@)==1 x_ols latitude longitude c1 c2 `depvar' $currentcontrols const, xreg(`ncont') coord(2) ivreg2 `depvar' $currentcontrols const, noc newcov estimates replay outreg2 using `outfile', $outopts append e(N r2c) tex
restoreend
***Conley's IVcap program drop conleyivprogram define conleyivargs depvar outfile nregr ninstr
preserveereturn clear for @ in any latitude longitude `depvar' const $currentendoregressors $currentexoregressors $currentinstruments: drop if missing(@)==1
local num_instr : list sizeof global(currentinstruments)local num_exoreg : list sizeof global(currentexoregressors)display `num_instr'display `num_exoreg'
scalar nreg_num=`num_instr'+`num_exoreg'+1local nreg_num1=nreg_numcap drop zubar* cap drop dis1 dis2display `nreg_num1'x_ols latitude longitude c1 c2 $currentendoregressors $currentinstruments $currentexoregressors const, xreg(`nreg_num1') coord(2)matrix coefficient=e(b)scalar main_coef=coefficient[1,1]scalar main_var=cov_dep[1,1]scalar main_se=sqrt(main_var)scalar main_t=main_coef/main_sescalar Fstat=main_t*main_t
cap drop zubar* cap drop dis1 dis2x_gmm latitude longitude c1 c2 `depvar' $currentendoregressors $currentexoregressors const $currentinstruments $currentexoregressors const, xreg(`nregr') coord(2) inst(`ninstr')
ivreg2 `depvar' ($currentendoregressors =$currentinstruments ) $currentexoregressors const, noc newcovF_stat_eiestimates replay outreg2 using `outfile', $outopts append addstat(Cragg-Donald Wald F, `e(widstat)') tex
restoreend
************************************************************************************************************************************ UPLOAD DATASET AND DEFINE VARIABLES
use DATASET_ETHNOATLAS.dta, clearkeep if year~=. keep if year>=1500keep if Barley_point_cal!=. /*Delete observations without agricultural data*/
**generate main regressors
gen L_hier1=V33 if V33~=0 /*Jurisdictional Hierarchy Beyond Local Community: 0(missing) 1 (no political authority beyond community), 2 (one level) to 5 (for levels)*/
gen L_crop_cereals=1 if V29==6replace L_crop_cereals=0 if L_crop_cereals==. & V29~=. & V29~=0 gen cereals=L_crop_cereals
gen L_surplus=0 if TUDEN_MARSHALL_v93==1replace L_surplus=1 if TUDEN_MARSHALL_v93<10 & TUDEN_MARSHALL_v93>1
gen Tax_burden=0 if SCSS_v1737==1 replace Tax_burden=1 if SCSS_v1737==2 | SCSS_v1737==3 | SCSS_v1737==6replace Tax_burden=2 if SCSS_v1737==4 | SCSS_v1737==5 | SCSS_v1737==7label var Tax_burden "=0 no tax; =1 small tax; =2 regular and relevant tax"
gen depend_agric = (5-0)/2 if V5==0replace depend_agric = 6+(15-6)/2 if V5==1replace depend_agric = 16+(25-16)/2 if V5==2replace depend_agric = 26+(35-26)/2 if V5==3replace depend_agric = 36+(45-36)/2 if V5==4replace depend_agric = 46+(55-46)/2 if V5==5replace depend_agric = 56+(65-56)/2 if V5==6replace depend_agric = 66+(75-66)/2 if V5==7replace depend_agric = 76+(85-76)/2 if V5==8replace depend_agric = 86+(100-86)/2 if V5==9replace depend_agric = depend_agric/100
gen Cal_positive_plow1=max(Wheat_point_cal, Barley_point_cal ,Rye_point_cal) gen Cal_negative_plow1=max(Foxtail_Millet_point_cal , Pearl_Millet_point_cal ,Sorghum_point_cal) gen Plow_advantage1 =Cal_positive_plow1-Cal_negative_plow1
gen Animal_husbandry1b=1 if V4>0 & V4!=.replace Animal_husbandry1b=0 if V4==0tabulate Animal_husbandry1b, gen(dummy_Animal_husbandry1b_)
gen Animal_cultivation2=(V39==2 | V39==3) if V39!=0tabulate Animal_cultivation2, gen(dummy_Animal_cultivation2_)
gen Ruminants=1 if V40==3 | V40==7replace Ruminants=0 if Ruminants==.
gen max_cal_point_c1=max(Barley_point_cal, Buckwheat_point_cal , Dryland_Rice_point_cal ,Foxtail_Millet_point_cal, Maize_point_cal ,Oat_point_cal ,Pearl_Millet_point_cal, Rye_point_cal ,Sorghum_point_cal, Wetland_Rice_point_cal, Wheat_point_cal )gen max_cal_point_t=max(Cassava_point_cal ,Sweet_Potato_point_cal, White_Potato_point_cal, Yams_point_cal)
label var max_cal_point_c1 "cal/ha cereal with MaxCalYield (on a circle(5cell radius)around Ethnoatlas point)(LowInput RainFed)" label var max_cal_point_t "cal/ha root/tub with MaxCalYield (on a circle(5cell radius)around Ethnoatlas point)(LowInput RainFed)"
gen diff= max_cal_point_c1- max_cal_point_tgen max = max(max_cal_point_c1, max_cal_point_t)
egen std_max=std(max)egen std_diff=std(diff)
gen sample_non_desertic=1 if max_cal_point_t~=0 & max_cal_point_c1 ~=0 /*non-desertic points; cereals and roots/tubers can be planted (Murdock points)*/
gen hierarchyA="1.tribe" if L_hier1==1replace hierarchyA="2.small chiefd" if L_hier1==2replace hierarchyA="3.large chiefd" if L_hier1==3replace hierarchyA="4.small state" if L_hier1==4replace hierarchyA="5.large state" if L_hier1==5
egen rainmean_std=std(rainmean) egen atemp_std=std(atemp) egen elevation_std=std(elevation) egen ruggedness_std=std(ruggedness) egen abslat_std=std(abslat) egen river_std=std(river) egen distcoast_std=std(distcoast) egen popd95_std=std(popd95) egen histpopd_std=std(histpopd) egen historicpopdB_std=std(historicpopdB) egen Plow_advantage1_std=std(Plow_advantage1) gen Plow_advantage1_std_7squared= Plow_advantage1_std*Plow_advantage1_stdegen ramank_std=std(ramank) egen suit_GalOz_std=std(suit_GalOz) egen irrigation_dep_std=std(irrigation_dep)
tab dummy_continental3, gen(continent3_d)
tab dummy_continental_ref1, gen(continental_ref1_d)
gen const=1
save TEMP1.dta, replacekeep if sample_non_desertic==1save TEMP2.dta, replace
************************************************************************************************************************************ TABLES IN PAPER
***************************TABLE 1 2SLS ESTIMATES (standard errors clustered at the country level)use TEMP2.dta, clear
****PANEL A: SECOND STAGEivreg2 L_hier1 cereals ,cluster(iso) est store a1ivreg2 L_hier1 (cereals = std_diff) ,cluster(iso) est store a2ivreg2 L_hier1 (cereals = std_diff) continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 ,cluster(iso) est store a3ivreg2 L_hier1 (cereals = std_diff) std_max continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 ,cluster(iso) est store a4ivreg2 L_hier1 (cereals = std_diff) depend_agric continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 ,cluster(iso) est store a5
local varcontrols "std_max continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d5 continent3_d6 rainmean_std atemp_std elevation_std ruggedness_std abslat_std latitude longitude river_std distcoast_std histpopd_std Plow_advantage1_std Plow_advantage1_std_7squared dummy_Animal_husbandry1b_1 dummy_Animal_husbandry1b_2 Ruminants dummy_Animal_cultivation2_2 irrigation_dep_std"ivlasso L_hier1 (cereals=std_diff) (`varcontrols'), sqrt pnotpen(std_diff) cluster(iso) idstatslocal selected_regressors= e(xselected)local selected_regressors2= "`selected_regressors'"macro listgen missing_var=0foreach vari of local varcontrols {replace missing_var=1 if missing(`vari')==1}ivreg2 L_hier1 (cereals = std_diff ) `selected_regressors2' if missing_var==0, cluster(iso) ffirstest sto a6
esta a* using Table1a_se_clustered_country.txt, se s(N widstat r2) starl(* 0.10 ** 0.05 *** 0.01) replace keep(cereals std_max depend_agric)est clear
****PANEL B: FIRST STAGE
ivreg2 cereals std_diff if L_hier1!=.,cluster(iso) est store a1ivreg2 cereals std_diff continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 if L_hier1!=.,cluster(iso) est store a2ivreg2 cereals std_diff std_max continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 if L_hier1!=.,cluster(iso) est store a3ivreg2 cereals std_diff depend_agric continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 if L_hier1!=.,cluster(iso) est store a4
ivreg2 cereals std_diff `selected_regressors2' if missing_var==0 & L_hier1!=., cluster(iso) ffirstest sto a5drop missing_var
esta a* using Table1b_se_clustered_country.txt, se s(N r2) starl(* 0.10 ** 0.05 *** 0.01) replace keep(std_diff)est clear
***************************TABLE 1 2SLS ESTIMATES (columns 1-5; standard errors adjusted for Conley with a distance cut-off of 5 and 10 decimal degrees)
foreach c in 5 10 {
cap drop c1 c2 gen c1=`c' gen c2=c1
****PANEL A: SECOND STAGE cap erase Table1a_se_conley_`c'.xmlcap erase Table1a_se_conley_`c'.txt
global currentcontrols cerealsconleyols L_hier1 Table1a_se_conley_`c' 2
global currentendoregressors cereals global currentexoregressors global currentinstruments std_diff conleyiv L_hier1 Table1a_se_conley_`c' 2 2
global currentendoregressors cereals global currentexoregressors continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 Table1a_se_conley_`c' 7 7
global currentendoregressors cereals global currentexoregressors std_max continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 Table1a_se_conley_`c' 8 8
global currentendoregressors cereals global currentexoregressors depend_agric continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 Table1a_se_conley_`c' 8 8
****PANEL B: FIRST STAGE (columns 1-5) preservekeep if L_hier1 !=.cap erase Table1b_se_conley_`c'.xmlcap erase Table1b_se_conley_`c'.txt
global currentcontrols std_diffconleyols cereals Table1b_se_conley_`c' 2global currentcontrols std_diff continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals Table1b_se_conley_`c' 7global currentcontrols std_diff std_max continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals Table1b_se_conley_`c' 8global currentcontrols std_diff depend_agric continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals Table1b_se_conley_`c' 8restore}
************************************************************************************************************************************ TABLES IN PAPER APPENDIX
use TEMP2.dta, clear
cap drop c1 c2 gen c1=10gen c2=c1
*************************** FIGURE F1hist yeargraph export FigureF1.pdf, replace
*************************** FIGURE F10
ivreg L_hier1 (L_crop_cereals = std_diff) , cluster(iso)graph box std_diff if e(sample)==1, over(hierarchyA, sort(small state large state) ) ytitle("Productivity advantage of cereals over roots and tubers") graph export FigureF10.pdf, replace
***************************TABLE F1preserveuse TEMP1.dta, clear
latabstat L_hier1 L_crop_cereals depend_agric /// dummy_Animal_husbandry1b_2 Ruminants Animal_cultivation2 /// L_surplus Tax_burden historicpopdB /// std_max std_diff /// rainmean_std atemp_std elevation_std ruggedness_std abslat_std /// river_std distcoast_std histpopd_std Plow_advantage1_std irrigation_dep_std /// ramank_std suit_GalOz_std /// , s(mean p50 sd Min Max N) f(%9.2fc) c(s) tf(TableF1) replacerestore***************************TABLE F5
preserveuse TEMP1.dta, clear corrtex L_hier1 L_crop_cereals depend_agric /// L_surplus historicpopdB /// std_max std_diff ramank_std suit_GalOz_std /// , file(TableF5) replace digits(1)restore
***************************TABLE F6
cap erase TableF6.xmlcap erase TableF6.txtglobal currentcontrols std_diffconleyols cereals TableF6 2global currentcontrols std_max std_diffconleyols cereals TableF6 3global currentcontrols std_max std_diff continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF6 8global currentcontrols std_max std_diffconleylogitmfx cereals TableF6 3global currentcontrols std_diffconleyols depend_agric TableF6 2global currentcontrols std_max std_diffconleyols depend_agric TableF6 3global currentcontrols std_max std_diff continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols depend_agric TableF6 8
***************************TABLE F7
cap erase TableF7.xmlcap erase TableF7.txt
global currentcontrols std_max std_diff rainmean_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF7 9global currentcontrols std_max std_diff atemp_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF7 9global currentcontrols std_max std_diff elevation_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF7 9global currentcontrols std_max std_diff ruggedness_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF7 9global currentcontrols std_max std_diff abslat_std latitude longitude continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF7 11
***************************TABLE F8
cap erase TableF8.xmlcap erase TableF8.txt
global currentcontrols std_max std_diff river_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF8 9global currentcontrols std_max std_diff distcoast_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF8 9global currentcontrols std_max std_diff histpopd_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF8 9global currentcontrols std_max std_diff historicpopdB_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF8 9global currentcontrols std_max std_diff popd95_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF8 9global currentcontrols std_max std_diff irrigation_dep_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF8 9global currentcontrols std_max std_diff Plow_advantage1_std Plow_advantage1_std_7squared continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols cereals TableF8 10
***************************TABLE F9cap erase TableF9.xmlcap erase TableF9.txtglobal currentcontrols std_max continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols L_hier1 TableF9 7global currentcontrols std_diff continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols L_hier1 TableF9 7global currentcontrols std_max std_diff continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols L_hier1 TableF9 8
***************************TABLE F10
*This replicates column 1xi: ologit L_hier1 std_max std_diff continent3_d* , cluster(iso)est sto a1outreg2 [a1] using TableF10_column1, replace onecol nor2
*These replicates the results in columns 2-5capture: gologit2 L_hier1 std_max std_diff continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d5 if L_hier1!=., lrforce cluster(iso)est sto a2outreg2 [a2] using TableF10_column2_3_4_5, replace onecol nor2
***************************TABLE F11
cap erase TableF11.xmlcap erase TableF11.txt
global currentendoregressors cereals global currentexoregressors std_max rainmean_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF11 9 9
global currentendoregressors cereals global currentexoregressors std_max atemp_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF11 9 9
global currentendoregressors cereals global currentexoregressors std_max elevation_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF11 9 9
global currentendoregressors cereals global currentexoregressors std_max ruggedness_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF11 9 9
global currentendoregressors cereals global currentexoregressors std_max abslat_std latitude longitude continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF11 11 11
***************************TABLE F12
cap erase TableF12.xmlcap erase TableF12.txt
global currentendoregressors cereals global currentexoregressors std_max river_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF12 9 9
global currentendoregressors cereals global currentexoregressors std_max distcoast_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF12 9 9
global currentendoregressors cereals global currentexoregressors std_max histpopd_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF12 9 9
global currentendoregressors cereals global currentexoregressors std_max historicpopdB_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF12 9 9
global currentendoregressors cereals global currentexoregressors std_max irrigation_dep_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 global currentinstruments std_diff conleyiv L_hier1 TableF12 9 9
global currentendoregressors cereals global currentexoregressors std_max Plow_advantage1_std Plow_advantage1_std_7squared continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 global currentinstruments std_diff conleyiv L_hier1 TableF12 10 10
***************************TABLE F13
preserveuse TEMP1.dta, cleargen c1=10gen c2=10cap erase TableF13.xmlcap erase TableF13.txt
global currentcontrols cerealsconleyols L_hier1 TableF13 2global currentendoregressors cereals global currentexoregressors global currentinstruments std_diff conleyiv L_hier1 TableF13 2 2global currentendoregressors cereals global currentexoregressors std_maxglobal currentinstruments std_diff conleyiv L_hier1 TableF13 3 3global currentendoregressors cereals depend_agric global currentexoregressors global currentinstruments std_max std_diff conleyiv L_hier1 TableF13 3 3global currentcontrols cereals continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols L_hier1 TableF13 7 global currentendoregressors cereals global currentexoregressors continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF13 7 7global currentendoregressors cereals global currentexoregressors std_max continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF13 8 8global currentendoregressors cereals depend_agric global currentexoregressors continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_max std_diffconleyiv L_hier1 TableF13 8 8restore
***************************TABLE F14 gen diff2= cal2_c1- cal2_tgen max2 = max(cal2_c1, cal2_t)egen std_max2=std(max2)egen std_diff2=std(diff2)
cap erase TableF14.xmlcap erase TableF14.txt
global currentcontrols cerealsconleyols L_hier1 TableF14 2global currentendoregressors cereals global currentexoregressors global currentinstruments std_diff2 conleyiv L_hier1 TableF14 2 2global currentendoregressors cereals global currentexoregressors std_max2global currentinstruments std_diff2 conleyiv L_hier1 TableF14 3 3global currentendoregressors cereals depend_agric global currentexoregressors global currentinstruments std_max2 std_diff2 conleyiv L_hier1 TableF14 3 3global currentcontrols cereals continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6conleyols L_hier1 TableF14 7 global currentendoregressors cereals global currentexoregressors continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff2 conleyiv L_hier1 TableF14 7 7global currentendoregressors cereals global currentexoregressors std_max2 continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff2 conleyiv L_hier1 TableF14 8 8global currentendoregressors cereals depend_agric global currentexoregressors continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_max2 std_diff2 conleyiv L_hier1 TableF14 8 8
***************************TABLE F15cap erase TableF15.xmlcap erase TableF15.txt
global currentendoregressors cereals global currentexoregressors ramank_std global currentinstruments std_diffconleyiv L_hier1 TableF15 3 3
global currentendoregressors cereals global currentexoregressors ramank_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF15 8 8
global currentendoregressors cereals global currentexoregressors suit_GalOz_std global currentinstruments std_diff conleyiv L_hier1 TableF15 3 3
global currentendoregressors cereals global currentexoregressors suit_GalOz_std continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6global currentinstruments std_diff conleyiv L_hier1 TableF15 8 8
***************************TABLE F16
cap erase TableF16.xmlcap erase TableF16.txt
global currentendoregressors cereals global currentexoregressors continental_ref1_d1 continental_ref1_d2 global currentinstruments std_diffconleyiv L_hier1 TableF16 4 4
global currentendoregressors cereals global currentexoregressors dummy_Animal_husbandry1b_1 global currentinstruments std_diffconleyiv L_hier1 TableF16 3 3
global currentendoregressors cereals global currentexoregressors dummy_Animal_husbandry1b_1 continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 global currentinstruments std_diffconleyiv L_hier1 TableF16 8 8
global currentendoregressors cereals global currentexoregressors Ruminantsglobal currentinstruments std_diff conleyiv L_hier1 TableF16 3 3
global currentendoregressors cereals global currentexoregressors Ruminants continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 global currentinstruments std_diff conleyiv L_hier1 TableF16 8 8
global currentendoregressors cereals global currentexoregressors dummy_Animal_cultivation2_2 global currentinstruments std_diffconleyiv L_hier1 TableF16 3 3
global currentendoregressors cereals global currentexoregressors dummy_Animal_cultivation2_2 continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 global currentinstruments std_diff conleyiv L_hier1 TableF16 8 8
***************************TABLE F17
xi: ivreg2 L_surplus std_diff , rob est store a1xi: ivreg2 L_surplus std_max std_diff , rob est store a2xi: ivreg2 L_surplus std_max std_diff continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 , rob est store a3xi: ologit L_surplus std_max std_diff , rob est store a4mfx, dydx
xi: ivreg2 Tax_burden std_diff , rob est store a6xi: ivreg2 Tax_burden std_max std_diff , rob est store a7xi: ivreg2 Tax_burden std_max std_diff continent3_d1 continent3_d2 continent3_d3 continent3_d4 continent3_d6 , rob est store a8xi: ologit Tax_burden std_max std_diff , rob est store a9mfx, dydx
esta a* using TableF17.txt, replace starl(* 0.10 ** 0.05 *** 0.01) s(N r2) se order(std_diff std_max) title(TABLE F17)estimates clear
***************************TABLE F18
xi: ivreg2 L_surplus L_crop_cereals , rob est store a1xi: ivreg2 L_surplus (L_crop_cereals = std_diff) , rob est store a2xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max , rob est store a3xi: ivreg2 L_surplus (L_crop_cereals depend_agric= std_diff std_max) , rob est store a4
xi: ivreg2 Tax_burden L_crop_cereals , rob est store a5xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) , rob est store a6xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max , rob est store a7xi: ivreg2 Tax_burden (L_crop_cereals depend_agric= std_diff std_max) , rob est store a8esta a* using TableF18.txt, replace starl(* 0.10 ** 0.05 *** 0.01) s(N widstat ) se order(L_crop_cereals std_max depend_agric) title(TABLE F18)est clear
***************************TABLE F19
xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max rainmean_std , rob est store a2xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max atemp_std , rob est store a3xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max elevation_std , rob est store a4xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max ruggedness_std , rob est store a5xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max abslat_std latitude longitude , rob est store a6esta a* using TableF19.txt, replace starl(* 0.10 ** 0.05 *** 0.01) s(N widstat ) se order(L_crop_cereals) title(TABLE F19)est clear
***************************TABLE F20
xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max river_std , rob est store a7xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max distcoast_std , rob est store a8xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max histpopd_std , rob est store a9xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max historicpopdB_std , rob est store a10xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max popd95_std , rob est store a11xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max irrigation_dep_std , rob est store a12xi: ivreg2 L_surplus (L_crop_cereals = std_diff) std_max Plow_advantage1_std Plow_advantage1_std_7squared , rob est store a13esta a* using TableF20.txt, replace starl(* 0.10 ** 0.05 *** 0.01) s(N widstat ) se order(L_crop_cereals) title(TABLE F20)est clear
***************************TABLE F21xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max rainmean_std , rob est store a1xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max atemp_std , rob est store a2xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max elevation_std , rob est store a3xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max ruggedness_std , rob est store a4xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max abslat_std latitude longitude , rob est store a5esta a* using TableF21.txt, replace starl(* 0.10 ** 0.05 *** 0.01) s(N widstat ) se order(L_crop_cereals) title(TABLE F21)est clear
***************************TABLE F22
xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max river_std , rob est store a7xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max distcoast_std , rob est store a8xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max histpopd_std , rob est store a9xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max historicpopdB_std , rob est store a10xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max popd95_std , rob est store a11xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max irrigation_dep_std , rob est store a12xi: ivreg2 Tax_burden (L_crop_cereals = std_diff) std_max Plow_advantage1_std Plow_advantage1_std_7squared , rob est store a13esta a* using TableF22.txt, replace starl(* 0.10 ** 0.05 *** 0.01) s(N widstat ) se order(L_crop_cereals) title(TABLE F22)est clear
*************************** ERASE USELESS FILESerase Table1a_se_conley_5.txt erase Table1a_se_conley_10.txt erase Table1b_se_conley_5.txt erase Table1b_se_conley_10.txt erase TableF6.txt erase TableF7.txt erase TableF8.txt erase TableF9.txt erase TableF11.txt erase TableF12.txt erase TableF13.txt erase TableF14.txt erase TableF15.txt erase TableF16.txterase Table1a_se_conley_5.tex erase Table1a_se_conley_10.tex erase Table1b_se_conley_5.tex erase Table1b_se_conley_10.tex erase TableF6.tex erase TableF7.tex erase TableF8.tex erase TableF9.tex erase TableF11.tex erase TableF12.tex erase TableF13.tex erase TableF14.tex erase TableF15.tex erase TableF16.tex
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842*! version 1.1.4, Ben Jann, 29nov2006
*! wrapper for estout
program define esta, rclass
version 8.2
// mode specific defaults
// - fixed
local fixed_open0 `""% `c(current_date)' `c(current_time)'""'
local fixed_close0 `""""'
local fixed_open `""'
local fixed_close `""'
local fixed_caption `"@title"'
local fixed_open2 `""'
local fixed_close2 `""'
local fixed_toprule `"@hline"'
local fixed_midrule `"@hline"'
local fixed_bottomrule `"@hline"'
local fixed_topgap `""""'
local fixed_midgap `""""'
local fixed_bottomgap `""""'
local fixed_ssl `"N R-sq "adj. R-sq" "pseudo R-sq" AIC BIC"'
local fixed_lsl `"Observations R-squared "Adjusted R-squared" "Pseudo R-squared" AIC BIC"'
local fixed_starlevels `"* 0.05 ** 0.01 *** 0.001"'
local fixed_begin `""'
local fixed_delimiter `"" ""'
local fixed_end `""'
local fixed_varwidth `"\`= cond("\`label'"=="", 12, 20)'"'
local fixed_modelwidth `"12"'
local fixed_abbrev `"abbrev"'
local fixed_substitute `""'
// - tab
local tab_open0 `"`macval(fixed_open0)'"'
local tab_close0 `""""'
local tab_open `""'
local tab_close `""'
local tab_caption `"@title"'
local tab_open2 `""'
local tab_close2 `""'
local tab_toprule `""'
local tab_midrule `""'
local tab_bottomrule `""'
local tab_topgap `""""'
local tab_midgap `""""'
local tab_bottomgap `""""'
local tab_ssl `"`macval(fixed_ssl)'"'
local tab_lsl `"`macval(fixed_lsl)'"'
local tab_starlevels `"`macval(fixed_starlevels)'"'
local tab_begin `""'
local tab_delimiter `"_tab"'
local tab_end `""'
local tab_varwidth `""'
local tab_modelwidth `""'
local tab_abbrev `""'
local tab_substitute `""'
// - csv
local csv_open0 `"`"\`csvlhs'% `c(current_date)' `c(current_time)'""'"'
local csv_close0 `""""'
local csv_open `""'
local csv_close `""'
local csv_caption `"`"\`csvlhs'@title""'"'
local csv_open2 `""'
local csv_close2 `""'
local csv_toprule `""'
local csv_midrule `""'
local csv_bottomrule `""'
local csv_topgap `""""'
local csv_midgap `""""'
local csv_bottomgap `""""'
local csv_ssl `"`macval(fixed_ssl)'"'
local csv_lsl `"`macval(fixed_lsl)'"'
local csv_starlevels `"`macval(fixed_starlevels)'"'
local csv_begin `"`"\`csvlhs'"'"'
local csv_delimiter `"`"";\`csvlhs'"'"'
local csv_end `"`"""'"'
local csv_varwidth `""'
local csv_modelwidth `""'
local csv_abbrev `""'
local csv_substitute `""'
// - rtf
local rtf_open0 `""'
local rtf_close0 `""'
local rtf_open `"{\rtf1`=cond("`c(os)'"=="MacOSX", "\mac", "\ansi")'"'
local rtf_close `"}"'
local rtf_caption `"@title \par"'
local rtf_open2 `""'
local rtf_close2 `""'
local rtf_toprule `""'
local rtf_midrule `""'
local rtf_bottomrule `""'
local rtf_topgap `""""'
local rtf_midgap `""""'
local rtf_bottomgap `""""'
local rtf_ssl `"N "R{\super 2}" "adj. R{\super 2}" "pseudo R{\super 2}" AIC BIC"'
local rtf_lsl `"Observations "R{\super 2}" "Adjusted R{\super 2}" "Pseudo R{\super 2}" AIC BIC"'
local rtf_starlevels `""{\super *}" 0.05 "{\super **}" 0.01 "{\super **}" 0.001"'
local rtf_begin `""\trowd\intbl\trgaph108\trql\trleft-108\`rtf_twidth'\trautofit1\cellx\ql ""'
local rtf_twidth `"\`=cond("\`width'"=="", "", "\trftsWidth2\trwWidth\`=50*\`rtf_twidthf''")'"'
local rtf_twidthf `"\`=cond("\`width'"=="", "0", "\`width'")'"'
local rtf_delimiter `"`"\cell\cellx\q\`=cond(`"\`alignment'"'!="", `"\`alignment'"', "c")' "'"'
local rtf_end `"\cell\row"'
local rtf_varwidth `""'
local rtf_modelwidth `""'
local rtf_abbrev `""'
local rtf_substitute `""'
// - html
local html_open0 `"<html> <head> "<title>`=cond(`"\`macval(title)'"'=="","estimates table, created `c(current_date)' `c(current_time)'","@title")'</title>" </head> <body> """'
local html_close0 `""" </body> </html> """'
local html_open `"`"<table border="0" width="\`=cond("\`width'"=="","*","\`width'")'">"'"'
local html_close `"</table>"'
local html_caption `"<caption>@title</caption>"'
local html_open2 `""'
local html_close2 `""'
local html_toprule `""<tr><td colspan=@span><hr></td></tr>""'
local html_midrule `""<tr><td colspan=@span><hr></td></tr>""'
local html_bottomrule `""<tr><td colspan=@span><hr></td></tr>""'
local html_topgap `""'
local html_midgap `""<tr><td colspan=@span> </td></tr>""'
local html_bottomgap `""'
local html_ssl `"N R<sup>2</sup> "adj. R<sup>2</sup>" "pseudo R<sup>2</sup>" AIC BIC"'
local html_lsl `"Observations R<sup>2</sup> "Adjusted R<sup>2</sup>" "Pseudo R<sup>2</sup>" AIC BIC"'
local html_starlevels `"<sup>*</sup> 0.05 <sup>**</sup> 0.01 <sup>***</sup> 0.001"'
local html_begin `"<tr><td>"'
local html_delimiter `"</td><td\`=cond(`"\`alignment'"'!="", `" align="\`alignment'""', "")'>"'
local html_end `"</td></tr>"'
local html_varwidth `"\`= cond("\`label'"=="", 12, 20)'"'
local html_modelwidth `"12"'
local html_abbrev `""'
local html_substitute `""'
// - tex
local tex_open0 `""% `c(current_date)' `c(current_time)'" \documentclass{article} \begin{document} """'
local tex_close0 `""" \end{document} """'
local tex_open `"\begin{table}[htbp]\centering"'
local tex_close `"\end{table}"'
local tex_caption `"\caption{@title}"'
local tex_open2 `"\`=cond("\`width'"=="", "\begin{tabular}", `"\begin{tabular*}{\`width'}"')'"'
local tex_close2 `"\`=cond("\`width'"=="", "\end{tabular}", `"\end{tabular*}"')'"'
local tex_toprule `"\hline\hline"'
local tex_midrule `"\hline"'
local tex_bottomrule `"\hline\hline"'
local tex_topgap `""'
local tex_midgap `"[1em]"' // `"\\\"'
local tex_bottomgap `""'
local tex_ssl `"N R$^{2}$ "adj. R$^{2}$" "pseudo R$^{2}$>" AIC BIC"'
local tex_lsl `"Observations R$^{2}$ "Adjusted R$^{2}$" "Pseudo R$^{2}$" AIC BIC"'
local tex_starlevels `"\sym{*} 0.05 \sym{**} 0.01 \sym{***} 0.001"'
local tex_begin `""'
local tex_delimiter `"&"'
local tex_end `"\\\"'
local tex_varwidth `"\`= cond("\`label'"=="", 12, 20)'"'
local tex_modelwidth `"12"'
local tex_abbrev `""'
local tex_substitute `"_ \_ "\_cons " \_cons < $<$"'
// - booktabs
local booktabs_open0 `""% `c(current_date)' `c(current_time)'" \documentclass{article} \usepackage{booktabs} \begin{document} """'
local booktabs_close0 `"`macval(tex_close0)'"'
local booktabs_open `"`macval(tex_open)'"'
local booktabs_close `"`macval(tex_close)'"'
local booktabs_caption `"`macval(tex_caption)'"'
local booktabs_open2 `"`macval(tex_open2)'"'
local booktabs_close2 `"`macval(tex_close2)'"'
local booktabs_toprule `"\toprule"'
local booktabs_midrule `"\midrule"'
local booktabs_bottomrule `"\bottomrule"'
local booktabs_topgap `"`macval(tex_topgap)'"'
local booktabs_midgap `"\addlinespace"'
local booktabs_bottomgap `"`macval(tex_bottomgap)'"'
local booktabs_ssl `"`macval(tex_ssl)'"'
local booktabs_lsl `"`macval(tex_lsl)'"'
local booktabs_starlevels `"`macval(tex_starlevels)'"'
local booktabs_begin `"`macval(tex_begin)'"'
local booktabs_delimiter `"`macval(tex_delimiter)'"'
local booktabs_end `"`macval(tex_end)'"'
local booktabs_varwidth `"`macval(tex_varwidth)'"'
local booktabs_modelwidth `"`macval(tex_modelwidth)'"'
local booktabs_abbrev `"`macval(tex_abbrev)'"'
local booktabs_substitute `"`macval(tex_substitute)'"'
// hello estout
capt findfile estout.ado
if _rc {
di as err "-estout- is required; type {stata ssc install estout}"
error 499
}
// syntax
syntax [anything] [using] [ , ///
/// coefficients and t-stats, se, etc.
b Bfmt(string) ///
noT Tfmt(string) ///
se SEfmt(string) ///
p Pfmt(string) ///
ci CIfmt(string) ///
BEta BEtafmt(string) ///
main(string) /// syntax: name format
aux(string) /// syntax: name format
abs /// absolute t-values
wide ///
NOSTAr STAR ///
staraux ///
NOCONstant CONstant ///
COEFlabels(string asis) ///
/// summary statistics
noOBS obslast ///
r2 R2fmt(string) ar2 AR2fmt(string) pr2 PR2fmt(string) ///
aic AICfmt(string) bic BICfmt(string) ///
SCAlars(string asis) /// syntax: "name1 [label1]" "name2 [label2]" etc.
sfmt(string) ///
/// layout
NODEPvars DEPvars ///
NOPArentheses PArentheses ///
BRackets ///
NONOTEs NOTEs /// without s in helpfile
NOMTItles MTItles MTItles2(string asis) ///
NOGAPs GAPs ///
NOLInes LInes ///
ADDNotes(string asis) ///
COMpress ///
plain ///
fixed tab csv rtf html tex BOOKTabs ///
Fragment ///
page ///
ALIGNment(str asis) ///
width(str asis) ///
/// other
Noisily ///
* ]
_estout_options , `macval(options)'
// syntax consistency etc
gettoken chunk using0: using
foreach opt in constant gaps lines star abbrev ///
depvars numbers parentheses notes mtitles type {
NotBothAllowed "``opt''" `no`opt''
}
NotBothAllowed "`staraux'" `nostar'
if `"`macval(mtitles2)'"'!="" NotBothAllowed "mtitles" `nomtitles'
if `"`pfmt'"'!="" local p p
if `"`sefmt'"'!="" local se se
if `"`cifmt'"'!="" local ci ci
if `"`betafmt'"'!="" local beta beta
if "`level'"=="" local level $S_level
if ((("`margin'"!="" | `"`margin2'"'!="") & "`nomargin'"=="") | ///
("`beta'"!="") | ("`eform'"!="" & "`noeform'"=="")) ///
& "`constant'"=="" local noconstant noconstant
if `"`r2fmt'"'!="" local r2 r2
if `"`ar2fmt'"'!="" local ar2 ar2
if `"`pr2fmt'"'!="" local pr2 pr2
if `"`aicfmt'"'!="" local aic aic
if `"`bicfmt'"'!="" local bic bic
if "`type'"=="" & `"`using'"'!="" local notype notype
// format modes
local mode `fixed' `tab' `csv' `rtf' `html' `tex' `booktabs'
if `:list sizeof mode'>1 {
di as err "only one allowed of fixed, tab, csv, rtf, html, tex, or booktabs"
exit 198
}
if "`mode'"=="" {
if `"`using'"'!="" {
_getfilename `"`using0'"'
_getfilesuffix `"`r(filename)'"'
local suffix `"`r(suffix)'"'
if inlist(`"`suffix'"', ".html", ".htm") local mode html
else if `"`suffix'"'==".tex" local mode tex
else if `"`suffix'"'==".csv" local mode csv
else if `"`suffix'"'==".rtf" local mode rtf
else local mode fixed
}
else local mode fixed
}
local mode0 `mode'
if "`mode0'"=="booktabs" local mode0 tex
else if "`mode0'"=="csv" {
if "`plain'"=="" local csvlhs `"=""'
else local csvlhs `"""'
}
if "`compress'"!="" & !inlist("`mode0'", "tab", "csv", "rtf") {
if "`modelwidth'"=="" local modelwidth modelwidth(9)
if "`varwidth'"=="" {
if "`label'"!="" local varwidth varwidth(16)
else local varwidth varwidth(10)
}
}
if "`plain'"=="" {
foreach opt in star depvars numbers parentheses notes lines {
SwitchOnIfEmpty `opt' `no`opt''
}
if "`wide'"=="" & ("`t'"=="" | "`se'`p'`ci'`aux'"!="") ///
SwitchOnIfEmpty gaps `nogaps'
}
if inlist("`mode0'", "tab", "csv", "rtf") local lines
if inlist("`mode0'", "rtf") local gaps
if "`notes'"!="" & "`nolegend'"=="" local legend legend
if "`plain'"!="" {
if "`bfmt'"=="" local bfmt %9.0g
if "`tfmt'"=="" local tfmt `bfmt'
if "`sefmt'"=="" local sefmt `bfmt'
if "`pfmt'"=="" local pfmt `bfmt'
if "`cifmt'"=="" local cifmt `bfmt'
if "`betafmt'"=="" local betafmt `bfmt'
}
if "`nomtitles'"!="" local depvars
else if "`depvars'"=="" local mtitles mtitles
// cells() option
if "`notes'"!="" {
if ("`margin'"!="" | `"`margin2'"'!="") & "`nomargin'"=="" ///
local note "`note'Marginal effects"
if "`eform'"!="" & "`noeform'"=="" ///
local note "`note'Exponentiated coefficients"
}
if "`bfmt'"=="" local bfmt a3
if `"`macval(cells)'"'=="" {
if "`star'"!="" & "`staraux'"=="" local bstar star
if "`beta'"!="" {
if "`main'"!="" {
di as err "beta() and main() not allowed both"
exit 198
}
if "`betafmt'"=="" local betafmt 3
local cells fmt(`betafmt') `bstar'
local cells beta(`cells')
if "`notes'"!="" {
if `"`note'"'!="" local note "`note'; "
local note "`note'Standardized beta coefficients"
}
}
else if "`main'"!="" {
tokenize "`main'"
if "`2'"=="" local 2 "`bfmt'"
local cells fmt(`2') `bstar'
local cells `1'(`cells')
if "`notes'"!="" {
if `"`note'"'!="" local note "`note'; "
local note "`note'`1' coefficients"
}
}
else {
local cells fmt(`bfmt') `bstar'
local cells b(`cells')
}
if "`t'"=="" | "`se'`p'`ci'`aux'"!="" {
// parse aux optio
tokenize "`aux'"
local auxname `1'
local auxfmt `2'
// type of auxiliary statistic
local aux `se' `p' `ci' `auxname'
if `"`aux'"'=="" local aux t
else {
if `:list sizeof aux'>1 {
di as err "only one allowed of se, p, ci, and aux()"
exit 198
}
}
if `"`aux'"'!="t" local abs
// parentheses/brackets
if "`parentheses'"!="" | "`brackets'"!="" {
if `"`aux'"'=="ci" {
local brackets brackets
local paren par
}
else if "`brackets'"!="" local paren "par([ ])"
else local paren par
}
// compose note
if "`notes'"!="" {
if `"`note'"'!="" local note "`note'; "
if `"`auxname'"'!="" {
local note `"`macval(note)'`auxname'"'
}
else if `"`aux'"'=="t" {
if "`abs'"!="" local note `"`macval(note)'Absolute "'
local note `"`macval(note)'t-statistics"'
}
else if `"`aux'"'=="se" {
local note `"`macval(note)'Standard errors"'
}
else if `"`aux'"'=="p" {
local note `"`macval(note)'p-values"'
}
else if `"`aux'"'=="ci" {
local note `"`macval(note)'`level'% confidence intervalls"'
}
if "`parentheses'"=="" {
if "`wide'"=="" local note `"`macval(note)' in second row"'
else local note `"`macval(note)' in second column"'
}
else if "`brackets'"!="" {
local note `"`macval(note)' in brackets"'
}
else local note `"`macval(note)' in parentheses"'
}
// formats
if "`tfmt'"=="" local tfmt 2
if "`sefmt'"=="" local sefmt `bfmt'
if "`pfmt'"=="" local pfmt 3
if "`cifmt'"=="" local cifmt `bfmt'
if `"`auxfmt'"'=="" local auxfmt `bfmt'
if `"`auxname'"'=="" {
local auxfmt ``aux'fmt'
}
// stars
if "`staraux'"!="" local staraux star
// put together
local bin fmt(`auxfmt') `paren' `abs' `staraux'
local cells `cells' `aux'(`bin')
}
if "`wide'"!="" local cells cells(`"`cells'"')
else local cells cells(`cells')
}
// stats() option
if `"`macval(stats)'"'=="" {
if `"`sfmt'"'=="" local sfmt `bfmt'
if `"`r2fmt'"'=="" local r2fmt = cond("`plain'"!="", "`bfmt'", "3")
if `"`ar2fmt'"'=="" local ar2fmt = cond("`plain'"!="", "`bfmt'", "3")
if `"`pr2fmt'"'=="" local pr2fmt = cond("`plain'"!="", "`bfmt'", "3")
if `"`aicfmt'"'=="" local aicfmt `bfmt'
if `"`bicfmt'"'=="" local bicfmt `bfmt'
if "`label'"=="" {
local stalabs `"``mode'_ssl'"'
}
else {
local stalabs `"``mode'_lsl'"'
}
gettoken obslab stalabs: stalabs
if "`obs'"=="" & "`obslast'"=="" {
local sta N
local stalab `"`macval(obslab)'"'
local stafmt %18.0g
}
local i 0
foreach s in r2 ar2 pr2 aic bic {
local ++i
if "``s''"!="" {
local sta `sta' `:word `i' of r2 r2_a r2_p aic bic'
local chunk: word `i' of `macval(stalabs)'
local stalab `"`macval(stalab)' `"`macval(chunk)'"'"'
local stafmt `stafmt' ``s'fmt'
}
}
local i 0
foreach addstat of local scalars {
local ++i
gettoken addstatname addstatlabel: addstat
if `: list posof `"`addstatname'"' in sta' continue
if `"`addstatname'"'=="N" & "`obs'"=="" & "`obslast'"!="" continue
if trim(`"`macval(addstatlabel)'"')=="" local addstatlabel `addstatname'
local addstatfmt: word `i' of `sfmt'
if `"`addstatfmt'"'=="" {
local addstatfmt: word `: list sizeof sfmt' of `sfmt'
}
local sta `sta' `addstatname'
local stalab `"`macval(stalab)' `"`macval(addstatlabel)'"'"'
local stafmt `stafmt' `addstatfmt'
}
if "`obs'"=="" & "`obslast'"!="" {
local sta `sta' N
local stalab `"`macval(stalab)' `macval(obslab)'"'
local stafmt `stafmt' %18.0g
}
if "`sta'"!="" {
local stats stats(`sta', fmt(`stafmt') labels(`macval(stalab)'))
}
}
// table header
if `"`macval(mlabels)'"'=="" {
if "`mode0'"=="tex" local mspan " span prefix(\multicolumn{@span}{c}{) suffix(})"
if `"`depvars'"'!="" {
local mlabels `"mlabels(, depvar`mspan')"'
}
else local mlabels `"mlabels(, none)"'
if "`mtitles'"!="" {
if "`mode0'"=="tex" local mlabels `"mlabels(,`mspan')"'
else local mlabels
}
if `"`macval(mtitles2)'"'!="" {
local mlabels `"mlabels(`macval(mtitles2)',`mspan')"'
}
}
if `"`macval(collabels)'"'=="" {
local collabels `"collabels(, none)"'
}
if "`mode0'"=="tex" & "`numbers'"!="" {
local numbers "numbers(\multicolumn{@span}{c}{( )})"
}
// pre-/posthead, pre-/postfoot, gaps and lines
// - complete note
if `"`macval(note)'"'!="" {
local note `"`"`macval(note)'"'"'
}
if "`legend'"!="" {
if ("`margin'"!="" | `"`margin2'"'!="") & ///
"`nomargin'"=="" & "`nodiscrete'"=="" {
local note `"`macval(note)' @discrete"'
}
if "`star'"!="" {
local note `"`macval(note)' @starlegend"'
}
}
if `"`macval(addnotes)'"'!="" {
local note `"`macval(note)' `macval(addnotes)'"'
}
// - mode specific settings
foreach opt in starlevels begin delimiter end ///
varwidth modelwidth substitute {
if `"`macval(`opt')'"'=="" & `"`macval(`mode'_`opt')'"'!="" {
local `opt' `"`opt'(``mode'_`opt'')"'
}
}
if "`noabbrev'`abbrev'"=="" {
local abbrev ``mode'_abbrev'
}
if `"`fragment'"'=="" {
if "`page'"!="" {
local opening `"``mode'_open0'"'
}
if `"`macval(title)'"'!="" {
local opening `"`macval(opening)' ``mode'_open'"'
if "`mode0'"=="tex" & "`star'"!="" {
local opening `"`macval(opening)' \def\sym#1{\ifmmode^{#1}\else$^{#1}$\fi}"'
}
local opening `"`macval(opening)' ``mode'_caption'"'
}
else if "`mode0'"=="tex" & "`star'"!="" {
local opening `"`macval(opening)' { \def\sym#1{\ifmmode^{#1}\else$^{#1}$\fi}"'
}
else if "`mode0'"!="tex" {
local opening `"`macval(opening)' ``mode'_open'"'
}
local opening `"`macval(opening)' ``mode'_open2'"'
if "`mode0'"=="tex" {
if `"`width'"'!="" local extracolsep "@{\hskip\tabcolsep\extracolsep\fill}"
if `"`macval(alignment)'"'!="" {
local opening `"`macval(opening)'{`extracolsep'l*{@E}{`macval(alignment)'}}"'
}
else {
MakeTeXColspec "`wide'" "`not'" "`star'" "`stardetach'" "`staraux'"
local opening `"`macval(opening)'{`extracolsep'l*{@E}{`value'}}"'
}
}
if "`mode0'"=="html" {
local brr
foreach chunk of local note {
local closing `"`macval(closing)' `"`brr'`macval(chunk)'"'"'
local brr "<br />"
}
if `"`macval(closing)'"'!="" {
local closing `""<tr><td colspan=@span>" `macval(closing)' </td></tr>"'
}
}
else if "`mode0'"=="tex" {
foreach chunk of local note {
local closing `"`macval(closing)' `"\multicolumn{@span}{l}{\footnotesize `macval(chunk)'}\\\"'"'
}
}
else if "`mode0'"=="csv" {
foreach chunk of local note {
local closing `"`macval(closing)' `"`csvlhs'`macval(chunk)'""'"'
}
}
else if "`mode0'"=="rtf" {
if `"`macval(note)'"'!="" local closing "\pard"
foreach chunk of local note {
local closing `"`macval(closing)' `"`macval(chunk)'\par"'"'
}
}
else {
local closing `"`macval(note)'"'
}
local closing `"`macval(closing)' ``mode'_close2'"'
if `"`macval(title)'"'!="" | "`mode0'"!="tex" {
local closing `"`macval(closing)' ``mode'_close'"'
}
else if "`mode0'"=="tex" & "`star'"!="" {
local closing `"`macval(closing)' }"'
}
if "`page'"!="" {
local closing `"`macval(closing)' ``mode'_close0'"'
}
local toprule `"``mode'_toprule'"'
local bottomrule `"``mode'_bottomrule'"'
local topgap `"``mode'_topgap'"'
local bottomgap `"``mode'_bottomgap'"'
}
local midrule `"``mode'_midrule'"'
local midgap `"``mode'_midgap'"'
// - compose prehead()
if `"`macval(prehead)'"'=="" {
if `"`lines'"'!="" {
local opening `"`macval(opening)' `macval(toprule)'"'
}
else if `"`gaps'"'!="" {
local opening `"`macval(opening)' `macval(topgap)'"'
}
SaveRetok `macval(opening)'
local opening `"`macval(value)'"'
if `"`macval(opening)'"'!="" {
local prehead `"prehead(`macval(opening)')"'
}
}
// - compose posthead()
if `"`macval(posthead)'"'=="" {
if `"`lines'"'!="" {
local posthead `"posthead(`macval(midrule)')"'
}
else if `"`gaps'"'!="" {
local posthead `"posthead(`macval(midgap)')"'
}
}
// - compose prefoot()
if `"`macval(prefoot)'"'=="" & `"`macval(stats)'"'!="" {
if `"`lines'"'!="" {
local prefoot `"prefoot(`macval(midrule)')"'
}
else if `"`gaps'"'!="" {
local prefoot `"prefoot(`macval(midgap)')"'
}
}
// - compose postfoot()
if `"`macval(postfoot)'"'=="" {
if `"`lines'"'!="" {
local closing `"`macval(bottomrule)' `macval(closing)'"'
}
else if `"`gaps'"'!="" {
local closing `"`macval(bottomgap)' `macval(closing)'"'
}
SaveRetok `macval(closing)'
local closing `"`macval(value)'"'
if `"`macval(closing)'"'!="" {
local postfoot postfoot(`macval(closing)')
}
}
if `"`macval(varlabels)'"'=="" {
if `"`gaps'"'!="" {
local varl `", end("" `macval(midgap)') nolast"'
}
if "`label'"!="" {
local varl `"_cons Constant`macval(varl)'"'
}
if `"`macval(coeflabels)'"'!="" {
local varl `"`macval(coeflabels)' `macval(varl)'"'
}
if trim(`"`macval(varl)'"')!="" {
local varlabels varlabels(`macval(varl)')
}
}
// noconstant option
if `"`drop'"'=="" {
if "`noconstant'"!="" {
local drop drop(_cons)
}
}
// compute beta coefficients (run estadd to add e(beta))
if "`beta'"!="" {
capt findfile estadd.ado
if _rc {
di as err "-estadd- is required to compute beta coefficients"
di as err "type {stata ssc install estadd}"
error 499
}
local estnames `"`anything'"'
if `"`estnames'"'=="" {
capt est_expand $esto
if !_rc {
local estnames `"$esto"'
}
}
estadd beta, replace: `estnames'
}
// execute estout
CleanEstoutCmd `anything' `using' , ///
`macval(cells)' `drop' `nomargin' `margin' `margin2' `noeform' `eform' ///
`nodiscrete' `macval(stats)' `stardetach' `macval(starlevels)' ///
`varwidth' `modelwidth' `noabbrev' `abbrev' `unstack' ///
`macval(begin)' `macval(delimiter)' `macval(end)' ///
`macval(title)' `macval(prehead)' `macval(posthead)' `macval(prefoot)' ///
`macval(postfoot)' `label' `macval(varlabels)' `macval(mlabels)' `nonumbers' ///
`numbers' `macval(collabels)' `macval(eqlabels)' `macval(mgroups)' ///
`macval(substitute)' `notype'`type' level(`level') `macval(options)'
if "`noisily'"!="" {
gettoken chunk rest: cmd, parse(",")
di as txt `"`chunk'"' _c
gettoken chunk rest: rest, bind
while `"`macval(chunk)'"'!="" {
di as txt `" `macval(chunk)'"'
gettoken chunk rest: rest, bind
}
}
`macval(cmd)'
if `"`using'"'!="" {
di as txt `"(output written to {browse `using0'})"'
}
return local estout `macval(cmd)'
end
program _estout_options
syntax [, ///
Cells(passthru) ///
Drop(passthru) ///
/// Keep(string asis) ///
/// Order(string asis) ///
/// Indicate(string asis) ///
/// TRansform(string asis) ///
/// EQuations(passthru) ///
NOEFORM eform ///EFORM2(string) ///
NOMargin Margin Margin2(passthru) ///
NODIscrete /// DIscrete(string asis) ///
/// MEQs(string) ///
level(numlist max=1 int >=10 <=99) ///
Stats(passthru) ///
STARLevels(passthru) ///
/// NOSTARDetach ///
STARDetach ///
VARwidth(passthru) ///
MODELwidth(passthru) ///
NOABbrev ABbrev ///
/// NOUNStack
UNStack ///
BEGin(passthru) ///
DELimiter(passthru) ///
end(passthru) ///
/// DMarker(string) ///
/// MSign(string) ///
/// NOLZ lz ///
SUBstitute(passthru) ///
TItle(passthru) ///
NOLEgend LEgend ///
PREHead(passthru) ///
POSTHead(passthru) ///
PREFoot(passthru) ///
POSTFoot(passthru) ///
/// HLinechar(string) ///
/// NOLabel
Label ///
VARLabels(passthru) ///
/// REFcat(string asis) ///
MLabels(passthru) ///
NONUMbers NUMbers ///NUMbers2(string asis) ///
COLLabels(passthru) ///
EQLabels(passthru) ///
MGRoups(passthru) ///
/// NOReplace Replace ///
/// NOAppend Append ///
NOTYpe TYpe ///
/// NOSHOWTABS showtabs ///
/// STYle(string) ///
/// DEFaults(string) ///
* ]
foreach opt in ///
cells drop noeform eform nomargin margin margin2 nodiscrete ///
level stats starlevels stardetach varwidth modelwidth unstack ///
noabbrev abbrev begin delimiter end substitute title nolegend ///
legend prehead posthead prefoot postfoot label varlabels mlabels ///
nonumbers numbers collabels eqlabels mgroups notype type ///
options {
c_local `opt' `macval(`opt')'
}
end
prog NotBothAllowed
args opt1 opt2
if `"`opt1'"'!="" {
if `"`opt2'"'!="" {
di as err `"options `opt1' and `opt2' not both allowed"'
exit 198
}
}
end
prog SwitchOnIfEmpty
args opt1 opt2
if `"`opt2'"'=="" {
c_local `opt1' `opt1'
}
end
prog _getfilesuffix, rclass // based on official _getfilename.ado
version 8
gettoken filename rest : 0
if `"`rest'"' != "" {
exit 198
}
local hassuffix 0
gettoken word rest : filename, parse(".")
while `"`rest'"' != "" {
local hassuffix 1
gettoken word rest : rest, parse(".")
}
if `"`word'"'=="." {
di as err `"incomplete filename; ends in ."'
exit 198
}
if `hassuffix' return local suffix `".`word'"'
else return local suffix ""
end
prog MakeTeXColspec
args wide not star detach aux
if "`star'"!="" & "`detach'"!="" & "`aux'"=="" local value "r@{}l"
else local value "c"
if "`wide'"!="" & "`not'"=="" {
if "`star'"!="" & "`detach'"!="" & "`aux'"!="" local value "`value'r@{}l"
else local value "`value'c"
}
c_local value "`value'"
end
prog SaveRetok
gettoken chunk 0: 0, q
local value `"`macval(chunk)'"'
gettoken chunk 0: 0, q
while `"`macval(chunk)'"'!="" {
local value `"`macval(value)' `macval(chunk)'"'
gettoken chunk 0: 0, q
}
c_local value `"`macval(value)'"'
end
prog CleanEstoutCmd
syntax [anything] [using] [ , * ]
local cmd estout
if `"`macval(anything)'"'!="" {
local cmd `"`macval(cmd)' `macval(anything)'"'
}
if `"`macval(using)'"'!="" {
local cmd `"`macval(cmd)' `macval(using)'"'
}
if `"`macval(options)'"'!="" {
local cmd `"`macval(cmd)', `macval(options)'"'
}
c_local cmd `"`macval(cmd)'"'
end123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824{smcl}
{* 29nov2006}{...}
{hi:help esta}{right:also see: {helpb estout}, {helpb estadd}, {helpb esto}}
{hline}
{title:Title}
{p 4 4 2}{hi:esta} {hline 2} Display formatted regression table
{title:Table of contents}
{help esta##syn:Syntax}
{help esta##des:Description}
{help esta##opt:Options}
{help esta##exa:Examples}
{help esta##ret:Returned results}
{help esta##aut:Backmatter}
{marker syn}
{title:Syntax}
{p 8 15 2}
{cmd:esta} [ {it:namelist} ] [ {cmd:using} {it:filename} ] [ {cmd:,}
{it:options} ]
where {it:namelist} is {cmd:_all} | {cmd:*} | {it:name} [{it:name} ...]
{it:name} is {it:identifier} | {cmd:.}
{it:options}{col 26}description
{hline 70}
{help esta##main:Main}
{cmd:b(}{it:{help esta##fmt:fmt}}{cmd:)}{col 26}{...}
specify format for point estimates
{cmd:beta}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]{col 26}{...}
display beta coefficients instead of point est's
{cmd:main(}{it:name} [{it:{help esta##fmt:fmt}}]{cmd:)}{col 26}{...}
display contents of {cmd:e(}{it:name}{cmd:)} instead of point e's
{cmd:t(}{it:{help esta##fmt:fmt}}{cmd:)}{col 26}{...}
specify format for t-statistics
{cmd:abs}{col 26}{...}
use absolute value of t-statistics
{cmd:not}{col 26}{...}
suppress t-statistics
{cmd:se}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]{col 26}{...}
display standard errors instead of t-statistics
{cmd:p}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]{col 26}{...}
display p-values instead of t-statistics
{cmd:ci}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]{col 26}{...}
display confidence intervals instead of t-stat's
{cmd:aux(}{it:name} [{it:{help esta##fmt:fmt}}]{cmd:)}{col 26}{...}
display contents of {cmd:e(}{it:name}{cmd:)} instead of t-stat's
[{ul:{cmd:no}}]{cmdab:con:stant}{col 26}{...}
drop/keep models' intercepts
{help esta##stars:Significance stars}
[{cmd:no}]{cmd:star}{col 26}{...}
do not/do report significance stars
{cmd:staraux}{col 26}{...}
attach stars to t-stat's instead of point est's
{cmdab:starl:evels:(}{it:list}{cmd:)}{col 26}{...}
define significance symbols and thresholds
{help esta##stat:Summary statistics}
{cmd:r2}|{cmd:ar2}|{cmd:pr2}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]{col 26}{...}
display (adjusted, pseudo) R-squared
{cmd:aic}|{cmd:bic}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]{col 26}{...}
display Akaike's or Schwarz's information crit.
{cmdab:sca:lars:(}{it:list}{cmd:)}{col 26}{...}
display any other scalars contained in {cmd:e()}
{cmd:sfmt(}{it:{help esta##fmt:fmt}} [{it:...}]{cmd:)}{col 26}{...}
set format(s) for {cmd:scalars()}
{cmd:noobs}{col 26}{...}
do not display the number of observations
{cmd:obslast}{col 26}{...}
place the number of observations last
{help esta##layout:Layout}
{cmd:wide}{col 26}{...}
place point est's and t-stat's beside one another
[{ul:{cmd:no}}]{cmdab:pa:rentheses}{col 26}{...}
do not/do print parentheses around t-statistics
{cmdab:br:ackets}{col 26}{...}
use brackets instead of parentheses
[{ul:{cmd:no}}]{cmdab:gap:s}{col 26}{...}
suppress/add vertical spacing
[{ul:{cmd:no}}]{cmdab:li:nes}{col 26}{...}
suppress/add horizontal lines
{cmd:compress}{col 26}{...}
reduce horizontal spacing
{cmd:plain}{col 26}{...}
produce a minimally formatted table
{help esta##label:Labeling}
{cmdab:l:abel}{col 26}{...}
make use of variable labels
{cmdab:ti:tle:(}{it:string}{cmd:)}{col 26}{...}
specify a title for the table
{cmdab:mti:tles:(}{it:list}{cmd:)}{col 26}{...}
specify model titles to appear in table header
{cmdab:nomti:tles}{col 26}{...}
disable model titles
[{ul:{cmd:no}}]{cmdab:dep:vars}{col 26}{...}
do not/do print dependent variables in header
[{ul:{cmd:no}}]{cmdab:num:bers}{col 26}{...}
do not/do print model numbers in table header
{cmdab:coef:labels:(}{it:list}{cmd:)}{col 26}{...}
specify labels for coefficients
[{ul:{cmd:no}}]{cmdab:note:s}{col 26}{...}
suppress/add notes in the table footer
{cmdab:addn:otes:(}{it:list}{cmd:)}{col 26}{...}
add lines at the end of the table
{help esta##format:Document format}
{cmd:fixed} | {cmd:tab} | {cmd:csv} | {cmd:rtf} | {cmd:html} | {cmd:tex} | {cmd:booktabs}
{col 26}{...}
set the document format ({cmd:fixed} is the default)
{cmdab:f:ragment}{col 26}{...}
suppress table opening and closing (LaTeX, HTML)
{cmd:page}{col 26}{...}
add page opening and closing (LaTeX, HTML)
{cmdab:align:ment(}{it:string}{cmd:)}{col 26}{...}
set alignment within columns (LaTeX, HTML, RTF)
{cmdab:width(}{it:string}{cmd:)}{col 26}{...}
set width of table (LaTeX, HTML, RTF)
{help esta##output:Output}
{cmdab:r:eplace}{col 26}{...}
overwrite an existing file
{cmdab:a:ppend}{col 26}{...}
append the output to an existing file
{cmdab:ty:pe}{col 26}{...}
force prining the table in the results window
{cmdab:n:oisily}{col 26}{...}
display the executed {helpb estout} command
{help esta##advanced:Advanced}
{cmdab:d:rop:(}{it:list}{cmd:)}{col 26}{...}
drop individual coefficients
{cmdab:k:eep:(}{it:list}{cmd:)}{col 26}{...}
keep individual coefficients
{cmdab:o:rder:(}{it:list}{cmd:)}{col 26}{...}
change order of coefficients
{cmdab:eq:uations:(}{it:list}{cmd:)}{col 26}{...}
match the models' equations
{cmd:eform}{col 26}{...}
report exponentiated coefficients
{cmdab:m:argin}{col 26}{...}
report marginal effects/elasticities
{cmdab:uns:tack}{col 26}{...}
place multiple equations in separate columns
{it:estout_options}{col 26}{...}
any other {helpb estout} options
{hline 70}
{marker des}
{title:Description}
{p 4 4 2}{cmd:esta} is a wrapper for {helpb estout}. It
produces a pretty-looking publication-style regression table
from stored estimates without much typing. The compiled table is
displayed in the Stata results window or, optionally, written
to a text file specified by {cmd:using}.
{p 4 4 2}{it:namelist} provides the names of the stored estimates
to be tabulated. You may use the {cmd:*} and {cmd:?} wildcards
in {it:namelist}. If {it:namelist} is omitted, {cmd:esta} tabulates the estimates
listed in global macro {cmd:$esto} ({cmd:$esto} is set by {cmd:esto};
see help {helpb esto}, if installed). If {it:namelist} is omitted and
{cmd:$esto} is empty, {cmd:esta} tabulates the current estimates
(i.e. the model fit last).
{p 4 4 2}See help {helpb estimates} for information about
storing estimation results. An alternative to the {cmd:estimates store} command
is also provided by the
{helpb esto} package from the SSC Archive (type
{net "describe http://fmwww.bc.edu/repec/bocode/e/esto":{bind:ssc describe esto}}).
{p 4 4 2}Note that {cmd:esta} requires {helpb estout} to be installed on your
system. Type
. {net "describe http://fmwww.bc.edu/repec/bocode/e/estout":{bind:ssc describe estout}}
{p 4 4 2}Additionally, {cmd:esta}'s {cmd:beta} option requires
{helpb estadd}. Type
. {net "describe http://fmwww.bc.edu/repec/bocode/e/estadd":{bind:ssc describe estadd}}
{marker opt}
{title:Options}
{marker main}
{dlgtab:Main}
{p 4 8 2}
{cmd:b(}{it:{help esta##fmt:fmt}}{cmd:)} sets the numerical display format
for the point estimates. The default format is {cmd:a3}. (See
{help esta##fmt:Numerical formats} below for details on available
formats.)
{p 4 8 2}
{cmd:beta}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]
requests that standardized beta coefficients be displayed in place of the
raw point estimates and, optionally, sets the display format (the default is to
print three decimal places). Note that {cmd:beta} causes the intercept
be dropped from the table (unless {cmd:constant} is specified). The
{cmd:beta} option requires
{helpb estadd} to be installed on your system (see
{net "describe http://fmwww.bc.edu/repec/bocode/e/estadd":{bind:ssc describe estadd}}).
{p 4 8 2}
{cmd:main(}{it:name} [{it:{help esta##fmt:fmt}}]{cmd:)}
requests that the statistics stored in {cmd:e(}{it:name}{cmd:)}
be displayed in place of the point estimates
and, optionally, sets the display format (the default is to use
the display format for point estimates). For example,
{cmd:e(}{it:name}{cmd:)} may contain statistics added by {cmd:estadd}
(see help {helpb estadd}, if installed).
{p 4 8 2}
{cmd:t(}{it:{help esta##fmt:fmt}}{cmd:)} sets the display format
for t-statistics. The default is to display two decimal places.
{p 4 8 2}
{cmd:abs} causes absolute values of t-statistics to be
reported.
{p 4 8 2}
{cmd:not} suppresses the printing of t-statistics.
{p 4 8 2}
{cmd:se}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]
requests that standard errors be displayed in place of t-statistics
and, optionally, sets the display format (the default is to use
the display format for point estimates).
{p 4 8 2}
{cmd:p}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]
requests that p-values be displayed in place of t-statistics
and, optionally, sets the display format (the default is to
print three decimal places)
{p 4 8 2}
{cmd:ci}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]
requests that confidence intervals be displayed in place of t-statistics
and, optionally, sets the display format (the default is to use
the display format for point estimates). {cmd:level(}{it:#}{cmd:)}
assigns the confidence level, in percent. The default is {cmd:level(95)}
or as set by {helpb set level}.
{p 4 8 2}
{cmd:aux(}{it:name} [{it:{help esta##fmt:fmt}}]{cmd:)}
requests that the statistics stored in {cmd:e(}{it:name}{cmd:)}
be displayed in place of t-statistics
and, optionally, sets the display format (the default is to use
the display format for point estimates). For example,
{cmd:e(}{it:name}{cmd:)} may contain statistics added by {cmd:estadd}
(see help {helpb estadd}, if installed).
{p 4 8 2}
{cmd:noconstant} causes the intercept be dropped from the
table. Specify {cmd:constant} to include the constant in situations where
it is dropped by default.
{marker stars}
{dlgtab:Significance stars}
{p 4 8 2}
{cmd:star} causes stars denoting the significance of the
coefficients be printed next to the point estimates: {cmd:*} for p<.05,
{cmd:**} for p<.01, and {cmd:***} for p<.001. Printing the stars is
the default. Type {cmd:nostar} to suppress the stars.
{p 4 8 2}
{cmd:staraux} causes the significance stars be printed next to the
t-statistics (or standard errors, etc.) instead of the point estimates.
{p 4 8 2}
{cmd:starlevels(}{it:symbol} {it:level} [{it:...}]{cmd:)} overrides the default symbols and thresholds
for "significance stars". For instance,
{bind:{cmd:starlevels(+ 0.10 * 0.05)}}
sets the following thresholds: {cmd:+} for p<.10 and {cmd:*} for
p<.05. Note that the thresholds must lie in the (0,1] interval and must be
specified in descending order.
{marker stat}
{dlgtab:Summary statistics}
{p 4 8 2}
{cmd:r2}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}],
{cmd:ar2}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}], and
{cmd:pr2}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]
include the R-squared, the adjusted R-squared, and the
pseudo-R-squared in the table footer and, optionally,
set the corresponding display formats (the default is to display three decimal places).
{p 4 8 2}
{cmd:aic}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}] and
{cmd:bic}[{cmd:(}{it:{help esta##fmt:fmt}}{cmd:)}]
include Akaike's and Schwarz's information criterion
in the table footer and, optionally,
set the corresponding display formats (the default is to use
the display format for point estimates).
{p 4 8 2}
{cmd:scalars(}{it:list}{cmd:)} may be used to add other
{cmd:e()}-scalars to the table footer (type {cmd:ereturn list}
to display a list of available {cmd:e()}-scalars after fitting a model;
see help {helpb ereturn}). For example,
{cmd:scalars(df_m)} would report the model degrees of freedom for
each model. {it:list} may be a simple list of names of
{cmd:e()}-scalars, e.g.
{com}. esta, scalars(ll_0 ll chi2){txt}
{p 8 8 2}or, alternatively, a list of quoted name-label pairs, e.g.
{com}. esta, scalars({bind:"ll Log lik."} {bind:"chi2 Chi-squared"}){txt}
{p 4 8 2}
{cmd:sfmt(}{it:{help esta##fmt:fmt}} [{it:...}]{cmd:)}
sets the display format(s) for the statistics specified in
{cmd:scalars()} (the default is to use
the display format for point estimates). If {cmd:sfmt()}
contains less elements than {cmd:scalars()}, the last specified format
is used for the remaining scalars. That is, specify only one format
if the same format be used for all scalars.
{p 4 8 2}
{cmd:noobs} suppresses displaying information on the
number of observations. The
default is to report the number of observations of each model in
the table footer.
{p 4 8 2}
{cmd:obslast} displays the number of observations in the last
row of the table footer. The default is to use the
first row.
{marker layout}
{dlgtab:Layout}
{p 4 8 2}
{cmd:wide} causes point estimates and t-statistics (or standard errors,
etc.) be printed beside one another instead of beneath one another.
{p 4 8 2}
{cmd:parentheses} encloses t-statistics (or standard errors,
etc.) in parentheses. This is the
default. Specify {cmd:noparentheses} to suppress the parentheses.
{p 4 8 2}
{cmd:brackets} uses square brackets, [], instead of
parentheses. Note that brackets are the default for confidence
intervals.
{p 4 8 2}
{cmd:gaps} adds empty rows (or, more generally, additional vertical space)
between coefficients to increase
readability (empty rows are also inserted between the table's
header, body, and footer, unless {cmd:lines} is activated). This is
the default unless {cmd:wide} or {cmd:not} is specified. Type {cmd:nogaps}
to suppress the extra spacing. {cmd:gaps} is currently not
supported in the {cmd:rtf} mode.
{p 4 8 2}
{cmd:lines} adds horizontal lines to the table
separating the table's header, body, and footer. This is the default. Specify
{cmd:nolines} to suppress the lines. Lines are always
suppressed in the {cmd:tab} and {cmd:csv} modes and are currently not
supported in the {cmd:rtf} mode.
{p 4 8 2}
{cmd:compress} reduces the amount of horizontal spacing (so that more models
fit on screen without line breaking). The option has no
effect in the {cmd:tab}, {cmd:csv}, and {cmd:rtf} modes. Furthermore, note that in the
TeX and HTML modes the {cmd:compress} option only changes the arrangement
the table's code, but not the look of the compiled end-product.
{p 4 8 2}
{cmd:plain} produces a minimally formatted table. It is a shortcut to
specifying {cmd:nostar}, {cmd:nodepvars}, {cmd:nonumbers},
{cmd:noparentheses}, {cmd:nogaps}, {cmd:nolines} and {cmd:nonotes}
and setting all formats to {cmd:%9.0g}. Note that the
disabled options can be switched on again. For example,
{com}. esta, plain star{txt}
{p 8 8 2}would produce a plain table including significance
stars.
{marker label}
{dlgtab:Labeling}
{p 4 8 2}
{cmd:label} specifies that variable labels be used instead of variable
names (and estimates titles be used instead of estimates names).
Furthermore, {cmd:label} prints "Constant" instead of "_cons".
{p 4 8 2}
{cmd:title(}{it:string}{cmd:)} may be used to provide a title for the table.
If specified, {it:string} is printed at the top of the table. Note
that specifying a title causes the table to be set up as a floating object
in LaTeX mode. You may want to set a label for referencing in this
case. For example, if you type {cmd:title(blah\label{tab1})}, then
"\ref{tab1}" could be used in the LaTeX document to point to the
table.
{p 4 8 2}
{cmd:mtitles(}{it:list}{cmd:)}
specifies a list of model titles to appear above the models' columns
in the table header. Enclose titles in double quotes if they
contain spaces, e.g. {cmd:mtitles({bind:"Model 1"} {bind:"Model 2"})}. The
default is to print the name (or label) of the (first)
dependent variable of a model as the model's title.
{p 4 8 2}
{cmd:nomtitles}
suppresses printing of model titles.
{p 4 8 2}
{cmd:depvars} prints the name (or label) of the (first)
dependent variable of a model as the model's title in the table
header. This is the
default. Specify {cmd:nodepvars} to use the names (or titles) of the stored estimates
instead of the variables.
{p 4 8 2}
{cmd:numbers}
includes a row containing consecutive model numbers in the table
header. This is the
default. Specify {cmd:nonumbers} to suppress printing the model
numbers.
{p 4 8 2}
{cmd:coeflabels(}{it:name} {it:label} [...]{cmd:)}
specifies labels for the coefficients. Specify names and labels in
pairs and, if necessary, enclose labels in double quotes,
e.g., {cmd:coeflabels(mpg Milage rep78 {bind:"Repair Record"})}.
{p 4 8 2}
{cmd:notes} prints notes at the end of the table explaining
the significance symbols and
the type of displayed statistics. This is the
default. Specify {cmd:nonotes} to suppress the notes.
{p 4 8 2}
{cmd:addnotes(}{it:list}{cmd:)} may be used to add further lines of
text at the bottom of the table. Lines containing blanks must be
enclosed in double quotes, e.g. {cmd:addnotes({bind:"Line 1"} {bind:"Line 2"})}.
{marker format}
{dlgtab:Document format}
{p 4 8 2}{cmd:fixed}, {cmd:tab}, {cmd:csv}, {cmd:rtf}, {cmd:html}, {cmd:tex}, and
{cmd:booktabs} choose the table's basic output format. The default
format is {cmd:fixed}. However, if the {it:filename} specified by
{cmd:using} has a ".csv" suffix, the {cmd:csv} format is the default.
Likewise, {cmd:rtf} is the default for ".rtf", {cmd:html} for
".htm" or ".html", and {cmd:tex} for ".tex".
{p 8 8 2}
{cmd:fixed} produces a fixed-format ASCII table. This is suitable, for example,
if the table be displayed in the Stata Results window.
{p 8 8 2}{cmd:tab} produces a tab-delimited ASCII table.
{p 8 8 2}{cmd:csv} produces an ASCII table for use with Microsoft Excel.
Delimiter is a semicolon (although {ul:C}omma
{ul:S}eparated {ul:V}alue format would suggest using a comma). In order
to prevent Excel from interpreting the contents of the table cells,
they are enclosed double quotes preceded by an equal sign (i.e. ="...").
However, if the {cmd:plain} option is specified, the table cells are
enclosed in double quotes without the leading equal sign.
The first method is appropriate if you want to preserve the table's
formatting. The second method is appropriate
if you want to use the table's contents for further computations in Excel.
{p 8 8 2}{cmd:rtf} produces a Rich Text Format table for use with
word processors. Note that the {cmd:rtf} mode still is rather
experimental. It has only been tested with Microsoft Word 2002 on Windows
XP.
{p 8 8 2}{cmd:html} produces a simple HTML formatted table.
{p 8 8 2}{cmd:tex} produces a LaTeX formatted table.
{p 8 8 2}{cmd:booktabs} produces a LaTeX formatted table
for use with LaTeX's {it:booktabs} package.
{p 4 8 2}{cmd:fragment} causes the table's opening and closing
specifications to be suppressed. This is relevant primarily in LaTeX and
HTML mode.
{p 4 8 2}{cmd:page} adds opening and closing code to define a whole
LaTeX or HTML document. The default is to produce a raw table that
can then be included into an existing LaTeX or HTML document.
{p 4 8 2}{cmd:alignment(}{it:string}{cmd:)} may be used to specify
the alignment of the models' columns in LaTeX, HTML, or RTF mode.
{p 8 8 2}In LaTeX mode {it:string}
should be a LaTeX column specifier. The default is
to center the columns. To produce right-aligned columns, for example,
type {cmd:alignment(r)}. If the table contains multiple columns per
model/equation, the alignment specification should define all
columns. For example, if the
{cmd:wide} option is specified, you could type {cmd:alignment(cr)}
to, say, center the point estimates and right-align the
t-statistics. Note that more sophisticated column definitions are
often needed to produce appealing results. In particular,
LaTeX's {it:dcolumn} package proves useful to align columns
on the decimal point.
{p 8 8 2}In HTML mode {it:string}
should be a HTML alignment specifier. The default is to omit
alignment specification, which results in left aligned columns. To
center the columns in HTML, for example, specify
{cmd:alignment(center)}. Other than in LaTeX mode, the same alignment
is used for all columns if the table contains multiple columns per
model/equation in the HTML mode.
{p 8 8 2}In RTF mode {it:string}
should be one of {cmd:l}, {cmd:c}, {cmd:r}, and {cmd:j}. The default is
to center the columns. To produce right-aligned columns, for example,
type {cmd:alignment(r)}. The same alignment
is used for all columns if the table contains multiple columns per
model/equation in the RTF mode.
{p 8 8 2}Note that {cmd:alignment()} does not change the alignment
of the variable names/labels in the left stub of the table. They are always
left-aligned.
{p 4 8 2}{cmd:width(}{it:string}{cmd:)} sets the overall width of the
table in LaTeX, HTML, or RTF mode. {it:string}
should be LaTeX or HTML literal or a positive number
to be interpreted as percentage in RTF mode. For example, specify
{cmd:width(\hsize)} in LaTeX, {cmd:width(100%)} in HTML, or
{cmd:width(100)} in RTF mode to span the
whole page. The table columns will spread regularly over the
specified width.
{marker output}
{dlgtab:Output}
{p 4 8 2}
{cmd:replace} permits {cmd:esta} to overwrite an existing file.
{p 4 8 2}
{cmd:append} specifies that the output be appended to an existing file. It
may be used even if the file does not yet exist.
{p 4 8 2}
{cmd:type} specifies that the assembled table be printed in the
results window and the log file. This is the default unless {cmd:using}
is specified.
{p 4 8 2}
{cmd:noisily} displays the executed {helpb estout} command.
{marker advanced}
{dlgtab:Advanced}
{p 4 8 2}
{cmd:drop(}{it:droplist}{cmd:)} identifies the coefficients to be dropped from
the table. A {it:droplist} comprises one or more
specifications, separated by white space. A specification can be either a
parameter name (e.g. {cmd:price}), an equation name followed by a colon
(e.g. {cmd:mean:}), or a full name (e.g. {cmd:mean:price}). You may use the
{cmd:*} and {cmd:?} wildcards in equation names and parameter names. Be
sure to refer to the matched equation names,
and not to the original equation names in the models, when using
the {cmd:equations()} option to match equations.
{p 4 8 2}
{cmd:keep(}{it:keeplist}{cmd:)} selects the coefficients to be included in the
table. {it:keeplist} is specified analogous to {it:droplist} in
{cmd:drop()} (see above).
{p 4 8 2}
{cmd:order(}{it:orderlist}{cmd:)} changes the order of the coefficients
and equations within the table. {it:orderlist} is specified analogous to
{it:droplist} in {cmd:drop()} (see above). Coefficients and equations
that do not appear in {it:orderlist} are placed last (in their original order).
{p 4 8 2}
{cmd:equations(}{it:eqmatchlist}{cmd:)} specifies how the models' equations are
to be matched. This option is passed to the internal call of
{cmd:estimates table}. See help {helpb estimates} on how to specify this
option. The most common usage is {cmd:equations(1)} to match all the first equations
in the models.
{p 4 8 2}
{cmd:eform} displays the regression table in
exponentiated form. The exponent of a coefficient is displayed in lieu of the
untransformed coefficient; standard errors and confidence intervals are
transformed as well. Note that the intercept is dropped in
eform-mode, unless {cmd:constant} is specified.
{p 4 8 2}
{cmd:margin} indicates that the
marginal effects or elasticities be reported instead of the raw
coefficients. A prerequisite for this option to work correctly is
that {cmd:mfx} has been applied to a model prior to storing its
results (see help {helpb mfx}). Note that the standard errors,
etc. are transformed as well. Furthermore, the intercept is
dropped, unless {cmd:constant} is specified.
{p 4 8 2}
{cmd:unstack} specifies that the individual equations from multiple-equation
models (e.g. {cmd:mlogit}, {cmd:reg3}, {cmd:heckman}) be placed in
separate columns. The default is to place the equations below one another in a
single column.
{p 4 8 2}
{it:estout_options} are any other {cmd:estout} options
(see help {helpb estout}). Note that
{cmd:estout} options take precedence over {cmd:esta} options. For
example,
{p 8 20 2}{cmd:cells()}{space 5}disables {cmd:b()}, {cmd:beta()}, {cmd:main()},
{cmd:t()}, {cmd:abs}, {cmd:not},
{cmd:se()}, {cmd:p()}, {cmd:ci()}, {cmd:aux()},
{cmd:star}, {cmd:staraux}, {cmd:parentheses}, and {cmd:brackets},
{p 8 20 2}{cmd:stats()}{space 5}disables {cmd:r2()}, {cmd:ar2()}, {cmd:pr2()},
{cmd:aic()}, {cmd:bic()}, {cmd:scalars()}, {cmd:sfmt()}, {cmd:noobs},
and {cmd:obslast}.
{marker fmt}
{dlgtab:Numerical formats}
{p 4 4 2}Numerical display formats may be specified in {cmd:esta}
as follows:
{p 5 8 2}1. Official Stata's display formats: You may specify
formats such as, e.g., {cmd:%9.0g} or {cmd:%8.2f}. See help {help format}
for a list of available formats.
{p 5 8 2}2. Fixed format: You may specify an integer
value such as {cmd:0}, {cmd:1}, {cmd:2}, etc. to evoke a display
format with a fixed number of decimal
places. For example, {cmd:t(3)} would display t-statistics
with three decimal places.
{p 5 8 2}3. Automatic format: You may specify {cmd:a1}, {cmd:a2}, ...,
or {cmd:a9} to cause {cmd:esta} choose a
reasonable display format for each number
depending on the number's value. The {it:#} in
{cmd:a}{it:#} determines the minimum precision
according to the following rules:
{p 10 12 2}o Absolute numbers smaller than 1 are displayed with {it:#} significant
decimal places (i.e. with {it:#} decimal places ignoring any leading
zeros after the decimal point). For example, {cmd:0.00123456} is
displayed as {cmd:0.00123} if the format is {cmd:a3}.
{p 10 12 2}o Absolute numbers greater than 1 are displayed with as
many digits required to retain at least one decimal place and are displayed with
a minimum of ({it:#} + 1) digits. For example, if
the format is {cmd:a3}, {cmd:1.23456} is displayed as {cmd:1.235},
{cmd:12.3456} is displayed as {cmd:12.35},
and {cmd:1234.56} is displayed as {cmd:1234.6}.
{p 10 12 2}o In any case, integers are displayed with zero decimal
places. Furthermore, note that very large or very small absolute numbers are displayed
in exponential format.
{marker exa}
{title:Examples}
{p 4 4 2}The following examples are intended to illustrate the basic
usage of {cmd:esta}. They only scratch the surface. The procedure is
to first fit and store some models and then apply {cmd:esta} to these
stored estimates:
{com}. sysuse auto
{txt}(1978 Automobile Data)
{com}. quietly regress price weight mpg
{txt}
{com}. estimates store model1
{txt}
{com}. quietly regress price weight mpg foreign
{txt}
{com}. estimates store model2
{txt}
{com}. esta *, ar2
{res}--------------------------------------------
(1) (2)
price price
--------------------------------------------
weight 1.747** 3.465***
(2.72) (5.49)
mpg -49.51 21.85
(-0.57) (0.29)
foreign 3673.1***
(5.37)
_cons 1946.1 -5853.7
(0.54) (-1.73)
--------------------------------------------
N 74 74
adj. R-sq 0.273 0.478
--------------------------------------------
t-statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
{txt}
{p 4 4 2}The same table using labels:
{com}. esta *, ar2 label
{res}----------------------------------------------------
(1) (2)
Price Price
----------------------------------------------------
Weight (lbs.) 1.747** 3.465***
(2.72) (5.49)
Mileage (mpg) -49.51 21.85
(-0.57) (0.29)
Car type 3673.1***
(5.37)
Constant 1946.1 -5853.7
(0.54) (-1.73)
----------------------------------------------------
Observations 74 74
Adjusted R-squared 0.273 0.478
----------------------------------------------------
t-statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
{txt}
{p 4 4 2}Plain table:
{com}. esta *, ar2 plain
{res} model1 model2
weight 1.746559 3.464706
2.723238 5.493003
mpg -49.51222 21.8536
-.5746808 .2944391
foreign 3673.06
5.370142
_cons 1946.069 -5853.696
.541018 -1.733408
N 74 74
adj. R-sq .2734846 .4781119
{txt}
{p 4 4 2}Using standard errors in brackets and suppress significance
stars:
{com}. esta *, se nostar brackets
{res}--------------------------------------
(1) (2)
price price
--------------------------------------
weight 1.747 3.465
[0.641] [0.631]
mpg -49.51 21.85
[86.16] [74.22]
foreign 3673.1
[684.0]
_cons 1946.1 -5853.7
[3597.0] [3377.0]
--------------------------------------
N 74 74
--------------------------------------
Standard errors in brackets
{txt}
{p 4 4 2}Printing beta coefficients (requires {helpb estadd}):
{com}. esta *, beta
{res}--------------------------------------------
(1) (2)
price price
--------------------------------------------
weight 0.460** 0.913***
(2.72) (5.49)
mpg -0.097 0.043
(-0.57) (0.29)
foreign 0.573***
(5.37)
--------------------------------------------
N 74 74
--------------------------------------------
Standardized beta coefficients; t-statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001{txt}
{marker ret}
{title:Returned results}
{p 4 4 2}{cmd:esta} returns in macro {cmd:r(estout)} a copy of the executed
{helpb estout} command (typing {cmd:`r(estout)'} after {cmd:esta}
reproduces the table).
{marker aut}
{title:Author}
{p 4 4 2} Ben Jann, ETH Zurich, jann@soz.gess.ethz.ch
{marker als}
{title:Also see}
Manual: {hi:[R] estimates}
{p 4 13 2}Online: help for
{helpb estimates}, {help estcom}; {helpb estout}, {helpb estadd}, {helpb esto} (if installed)1234567v 3
d esta
d Author: Ben Jann, ETH Zurich, jann@soz.gess.ethz.ch
d
d Distribution-Date: 29nov2006
f esta.ado
f esta.hlp123version https://git-lfs.github.com/spec/v1oid sha256:5f57ab35bcb33c357e6d233bc26c4b0758688ce4d9037666b01f01221485da83size 44512v 3
p esta123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298/************************************************************************//* x_gmm.ado *//*GMM ESTIMATION FOR X-SECTIONAL DATA WITH LOCATION-BASED DEPENDENCE *//*for STATA 6.0 *//* by Jean-Pierre Dube *//* Northwestern University *//* July 10, 1999 *//* *//* reference: *//* *//* Conley, Timothy G.[1996]. "Econometric Modelling of Cross *//* Sectional Dependence." Northwestern University Working Paper. *//* *//************************************************************************//************************************************************************//* To invoke this command type: *//* >>x_gmm coordlist cutofflist depvar regressorlist *//* instrumentlist, xreg() inst() coord() *//* *//* NOTE: (1) If you want a constant in the regression, specify one of *//* your input variables as a 1. (ie. include it in list of *//* regressors). *//* *//* (2) MUST specify positive value for xreg(), inst() and *//* coord() options. *//* *//* (3) xreg() denotes # regressors *//* inst() denotes # instruments *//* coord() denotes dimension of coordinates *//* *//* (4) Your list of instruments may contain some of the regressors *//* *//* (5) Your cutofflist must correspond to coordlist (same order) *//* *//* OUTPUT: *//* betagmm= 2 Step GMM estimator Allowing for Spatial *//* Correlation *//* cov_dep= variance-covariance matrix of betagmm *//* J=value of GMM criterion function test of *//* overidentifying conditions *//* *//* For Comparison: *//* b2SLS=2SLS estimates (assuming spatial independence) *//* cov2SLS=var-cov matrix of b2SLS *//************************************************************************/
program define x_gmm version 6.0#delimit ; /*sets `;' as end of line*/
/*FIRST I TAKE INFO. FROM COMMAND LINE AND ORGANIZE IT*/local varlist "req ex min(1)"; /*must specify at least one variable... all must be existing in memory*/local options "xreg(int -1) inst(int -1) COord(int -1)"; /* # regressors, # instruments, dimension of location coordinates*/
parse "`*'"; /*separate options and variables*/
if `xreg'<1{; if `xreg'==-1{; di in red "option xreg() required!!!"; exit 198}; di in red "xreg(`xreg') is invalid"; exit 198};
if `inst'<1{; if `inst'==-1{; di in red "option ins() required!!!"; exit 198}; di in red "inst(`inst') is invalid"; exit 198};
if `inst'<`xreg'{; di in red "underidentified system: `xreg' regressors and `inst' instruments!!!"; exit 198};
if `coord'<1{; if `coord'==-1{; di in red "option coord() required!!!"; exit 198}; di in red "coord(`coord') is invalid"; exit 198};
/*Separate input variables: coordinates, cutoffs, dependent, regressors, instruments*/
parse "`varlist'", parse(" "); local a=1;while `a'<=`coord'{; tempvar coord`a'; gen `coord`a''=``a''; /*get coordinates*/local a=`a'+1};
local aa=1;while `aa'<=`coord'{; tempvar cut`aa'; gen `cut`aa''=``a''; /*get cutoffs*/ local a=`a'+1;local aa=`aa'+1};
tempvar Y;gen `Y'=``a''; /*get dep variable*/local depend : word `a' of `varlist';
local a=`a'+1;
local b=1;while `b'<=`xreg'{; tempvar X`b'; local ind`b'="`b'"; gen `X`b''= ``a''; local ind`b' : word `a' of `varlist'; local a=`a'+1;local b=`b'+1}; /*get indep variable(s)*/
local c=1;while `c'<=`inst'{; tempvar Z`c'; gen `Z`c''=``a''; local a=`a'+1;local c=`c'+1}; /*get instrument(s)*/
/*NOW I DO 2-STEP GMM AND COMPUTE THE COV MATRIX*/quietly{; /*so that steps are not printed on screen*/
/*CREATE MATRICES A AND B FOR 2SLS*/ tempname A B Zk Zkk W B_N A_N invN ZZ ZZ_N invZZ; scalar `invN'=1/_N; if `inst'==1{; mat accum `ZZ'=`Z1', noconstant}; else{; mat accum `ZZ'=`Z1'-`Z`inst'', noconstant}; mat `ZZ_N'=`ZZ'*`invN'; mat `invZZ'=inv(`ZZ_N'); capture mat drop `B'; capture mat drop `A'; local d=1; while `d'<=`inst'{; if `inst'==1{; mat vecaccum `Zk'=`Z`d'' `X1', noconstant}; else{; mat vecaccum `Zk'=`Z`d'' `X1'-`X`xreg'', noconstant}; mat vecaccum `Zkk'=`Z`d'' `Y', noconstant; mat `B'=nullmat(`B') \ `Zk'; mat `A'=nullmat(`A') \ `Zkk'; local d=`d'+1}; mat `B_N'=`B'*`invN'; mat `A_N'=`A'*`invN';
/*REGULAR 2SLS PROCEDURE*/ tempname sigma BinvZZ BinvZZB invBZZB cov BZZA; tempvar Ehat sighat Esquare XE Xtemp; mat `BinvZZ'=`B_N''*`invZZ'; mat `BinvZZB'=`BinvZZ'*`B_N'; mat `BZZA'=`BinvZZ'*`A_N'; mat `invBZZB'=inv(`BinvZZB'); mat b2SLS=`invBZZB'*`BZZA'; /*2SLS estimator*/ gen `Xtemp'=0; gen `XE'=0; local e=1; while `e'<=`xreg'{; replace `Xtemp'=`X`e''; replace `XE'=`XE'+`Xtemp'*b2SLS[`e',1]; local e=`e'+1}; gen `Ehat'=`Y'-`XE'; gen `Esquare'=`Ehat'*`Ehat'; egen `sighat'=mean(`Esquare'); scalar `sigma'=`sighat'*`invN'; mat cov2SLS=`invBZZB'*`sigma'; /*standard 2SLS cov matrix*/
/*GMM CORRECTING FOR SERIAL DEPENDENCE*/ tempname BB BA invBB BAZUUZ ZUUZ1 ZUUZ2 ZUUZ ZUUZt fix; tempvar ZUUk X_tem u_tem uhat window; mat `BB'=`B''*`B'; mat `invBB'=inv(`BB'); mat `BA'=`B''*`A'; mat bgmm1=`invBB'*`BA'; gen `X_tem'=0; gen `u_tem'=0; local f=1; while `f'<=`xreg'{; replace `X_tem'=`X`f''; replace `u_tem'=`u_tem'+`X_tem'*bgmm1[`f',1]; local f=`f'+1}; gen `uhat'=`Y'-`u_tem'; mat `ZUUZ'=J(`inst',`inst',0); gen `ZUUk'=0; gen `window'=1; /*initializes mat.s/var.s to be used*/ local i=1; while `i'<=_N{; /*loop through all observations*/ local j=1; replace `window'=1; while `j'<=`coord'{; /*loop through coordinates*/ if `i'==1{; gen dis`j'=0}; replace dis`j'=abs(`coord`j''-`coord`j''[`i']); replace `window'=`window'*(1-dis`j'/`cut`j''); replace `window'=0 if dis`j'>=`cut`j''; local j=`j'+1}; /*create window*/ capture mat drop `ZUUZ2'; local k=1; while `k'<=`inst'{; replace `ZUUk'=`Z`k''[`i']*`uhat'*`uhat'[`i']*`window'; if `inst'==1{; mat vecaccum `ZUUZ1'=`ZUUk' `Z1', noconstant}; else{; mat vecaccum `ZUUZ1'=`ZUUk' `Z1'-`Z`inst'', noconstant}; mat `ZUUZ2'=nullmat(`ZUUZ2') \ `ZUUZ1'; local k=`k'+1}; mat `ZUUZt'=`ZUUZ2''; mat `ZUUZ1'=`ZUUZ2' +`ZUUZt'; scalar `fix'=.5; /*to correct for double-counting*/ mat `ZUUZ1'=`ZUUZ1'*`fix'; mat `ZUUZ'=`ZUUZ' +`ZUUZ1'; local i=`i'+1}; mat `ZUUZ'=`ZUUZ'*`invN';
/*STEP (2)*/ tempname What BW BWB invBWB BWA; tempvar Ehat2; mat `What'=`ZUUZ'; mat `What'=inv(`What'); mat `BW'=`B''*`What'; mat `BWB'=`BW'*`B'; mat `invBWB'=inv(`BWB'); mat `BWA'=`BW'*`A'; mat betagmm=`invBWB'*`BWA';
mat `BW'=`B_N''*`What';mat `BWB'=`BW'*`B_N';mat cov_dep=inv(`BWB'); /*corrected covariance matrix*/mat cov_dep=cov_dep*`invN';
/*Compute the GMM Criterion Statistics*/tempname m qq zubar zu;tempvar J Zuk u1 zubar;gen `Zuk'=0;replace `u_tem'=0;local ii=1;while `ii'<=`xreg'{; replace `X_tem'=`X`ii''; replace `u_tem'=`u_tem'+`X_tem'*betagmm[`ii',1];local ii=`ii'+1};gen `u1'=`Y'-`u_tem';mat `m'=J(`inst',1,0);capture mat drop `m';local jj=1;while `jj'<=`inst'{; replace `Zuk'=`Z`jj''*`u1'; egen zubar`jj'=mean(`Zuk'); scalar `zubar'=zubar`jj'[_N]; mat `zu'=(1); mat `zu'=`zu'*`zubar'; mat `m'=nullmat(`m') \ `zu';local jj=`jj'+1};mat `qq'=`m''*`What';mat J=`qq'*`m';gen `J'=J[1,1]*_N;
}; /*end quietly command*/
/*THIS PART CREATES AND PRINTS THE OUTPUT TABLE IN STATA*/local z=1;local v=`a';di _newline(2) _skip(5)"Results for 2-Step Spatial GMM";di _newline _col(20) " number of observations= " _N;di _newline _col(20) " crit. fn. test of overid. restrictions= " `J';di _newline "Dependent variable= `depend'";di _newline"variable" _col(13) "2SLS Est." _col(29) "2SLS SE" _col(40) "Spatial GMM Est." _col(58) "Spatial GMM SE";di "--------" _col(13) "-------------" _col(29) "---------" _col(40) "-------------" _col(58) "------------------";
while `z'<=`xreg'{; tempvar beta`z' beta1`z' se`z' see`z' se1`z' se2`z'; gen `beta`z''=b2SLS[`z',1]; gen `se`z''=cov2SLS[`z',`z']; gen `see`z''=sqrt(`se`z''); gen `beta1`z''=betagmm[`z',1]; gen `se1`z''=cov_dep[`z',`z']; gen `se2`z''=sqrt(`se1`z''); di "`ind`z''" _col(13) `beta`z'' _col(29) `see`z'' _col(40) `beta1`z'' _col(58) `se2`z'';local z=`z'+1};end;
exit;
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181/************************************************************************//* x_ols.ado *//*OLS ESTIMATION FOR X-SECTIONAL DATA WITH LOCATION-BASED DEPENDENCE *//*for STATA 6.0 *//* by Jean-Pierre Dube *//* Northwestern University *//* July 10, 1999 *//* *//* reference: *//* *//* Conley, Timothy G.[1996]. "Econometric Modelling of Cross *//* Sectional Dependence." Northwestern University Working Paper. *//* *//************************************************************************//************************************************************************//*To invoke this command type: *//* >>x_ols coordlist cutofflist depvar regressorlist, xreg() coord() *//* *//* (1)If you want a constant in the regression, specify one of the *//* input variables as a 1. (ie. include it in list of regressors). *//* *//* (2) You MUST specify the xreg() and coord() options. *//* *//* (3) xreg() denotes # regressors *//* coord() denotes dimension of coordinates *//* *//* (4) Your cutofflist must correspond to coordlist (same order) *//* *//* *//*OUTPUT: all the standard `reg' procedure matrices will be in memory. *//* There will also be a matrix cov_dep, the corrected variance- *//* covariance matrix. *//************************************************************************/
program define x_ols version 6.0#delimit ; /*sets `;' as end of line*/
/*FIRST I TAKE INFO. FROM COMMAND LINE AND ORGANIZE IT*/local varlist "req ex min(1)"; /*must specify at least one variable... all must be existing in memory*/local options "xreg(int -1) COord(int -1)"; /* # indep. var, dimension of location coordinates*/
parse "`*'"; /*separate options and variables*/
if `xreg'<1{; if `xreg'==-1{; di in red "option xreg() required!!!"; exit 198}; di in red "xreg(`xreg') is invalid"; exit 198};
if `coord'<1{; if `coord'==-1{; di in red "option coord() required!!!"; exit 198}; di in red "coord(`coord') is invalid"; exit 198};
/*Separate input variables: coordinates, cutoffs, dependent, regressors*/
parse "`varlist'", parse(" ");
local a=1;while `a'<=`coord'{; tempvar coord`a'; gen `coord`a''=``a''; /*get coordinates*/local a=`a'+1};
local aa=1;while `aa'<=`coord'{; tempvar cut`aa'; gen `cut`aa''=``a''; /*get cutoffs*/ local a=`a'+1;local aa=`aa'+1};
tempvar Y;gen `Y'=``a''; /*get dep variable*/local depend : word `a' of `varlist';
local a=`a'+1;
local b=1;while `b'<=`xreg'{; tempvar X`b'; local ind`b' : word `a' of `varlist'; gen `X`b''= ``a''; local a=`a'+1;local b=`b'+1}; /*get indep var(s)...rest of list*/
/*NOW I RUN THE REGRESSION AND COMPUTE THE COV MATRIX*/
quietly{; /*so that steps are not printed on screen*/
/*(1) RUN REGRESSION*/ tempname XX XX_N invXX invN; scalar `invN'=1/_N; if `xreg'==1 {; reg `Y' `X1', noconstant robust; mat accum `XX'=`X1',noconstant; mat `XX_N'=`XX'*`invN'; mat `invXX'=inv(`XX_N')}; /* creates (X'X/N)^(-1)*/ else{; reg `Y' `X1'-`X`xreg'', noconstant; mat accum `XX'=`X1'-`X`xreg'',noconstant; mat `XX_N'=`XX'*`invN'; mat `invXX'=inv(`XX_N')}; /* creates (X'X/N)^(-1)*/ predict epsilon,residuals; /* OLS residuals*/
/*(2) COMPUTE CORRECTED COVARIANCE MATRIX*/ tempname XUUX XUUX1 XUUX2 XUUXt; tempvar XUUk; mat `XUUX'=J(`xreg',`xreg',0); gen `XUUk'=0; gen window=1; /*initializes mat.s/var.s to be used*/ local i=1; while `i'<=_N{; /*loop through all observations*/ local d=1; replace window=1; while `d'<=`coord'{; /*loop through coordinates*/ if `i'==1{; gen dis`d'=0}; replace dis`d'=abs(`coord`d''-`coord`d''[`i']); replace window=window*(1-dis`d'/`cut`d''); replace window=0 if dis`d'>=`cut`d''; local d=`d'+1}; /*create window*/ capture mat drop `XUUX2'; local k=1; while `k'<=`xreg'{; replace `XUUk'=`X`k''[`i']*epsilon*epsilon[`i']*window; mat vecaccum `XUUX1'=`XUUk' `X1'-`X`xreg'', noconstant; mat `XUUX2'=nullmat(`XUUX2') \ `XUUX1'; local k=`k'+1}; mat `XUUXt'=`XUUX2''; mat `XUUX1'=`XUUX2'+`XUUXt'; scalar fix=.5; /*to correct for double-counting*/ mat `XUUX1'=`XUUX1'*fix; mat `XUUX'=`XUUX'+`XUUX1'; local i=`i'+1}; mat `XUUX'=`XUUX'*`invN';
}; /*end quietly command*/
tempname V VV;mat `V'=`invXX'*`XUUX';mat `VV'=`V'*`invXX';
matrix cov_dep=`VV'*`invN'; /*corrected covariance matrix*/
/*THIS PART CREATES AND PRINTS THE OUTPUT TABLE IN STATA*/local z=1;local v=`a';di _newline(2) _skip(5)"Results for Cross Sectional OLS corrected for Spatial Dependence";di _newline _col(35) " number of observations= " _result(1);di " Dependent Variable= " "`depend'";di _newline"variable" _col(13) "ols estimates" _col(29) "White s.e." _col(42) "s.e. corrected for spatial dependence";di "--------" _col(13) "-------------" _col(29) "----------" _col(42) "-------------------------------------";
while `z'<=`xreg'{; tempvar se1`z' se2`z'; local beta`z'=_b[`X`z'']; local se`z'=_se[`X`z'']; gen `se1`z''=cov_dep[`z',`z']; gen `se2`z''=sqrt(`se1`z''); di "`ind`z''" _col(13) `beta`z'' _col(29) `se`z'' _col(42) `se2`z'';local z=`z'+1};
end;exit;
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250/************************************************************************//* xgmlt.ado *//* ESTIMATION OF A LOGIT MODEL FOR X-SECTIONAL DATA *//* WITH LOCATION-BASED DEPENDENCE *//*for STATA 6.0 *//* by Robert Vigfusson (email r-vigfusson@nwu.edu) *//* Northwestern University *//* October 11, 1999 *//* based on code for x_gmm.ado written by Jean-Pierre Dube */ /* *//* reference: *//* *//* Conley, Timothy G.[1999]. "GMM Estimation with Cross *//* Sectional Dependence." J. of Econometrics 92:1, 1-45. *//* *//************************************************************************//************************************************************************/
* WARNING: This program is offered without any guarantee. * If you find errors, please contact r-vigfusson@nwu.edu.
/* To invoke this command type: *//* >>xgmlt coordlist cutofflist depvar regressorlist, xreg() coord() *//* *//* NOTE: (1) If you want a constant in the regression, specify one of *//* your input variables as a 1. (ie. include it in list of *//* regressors). *//* *//* (2) MUST specify positive value for xreg() and coord() options. */ *//* (3) xreg() denotes # regressors *//* *//* coord() denotes dimension of coordinates *//* *//* *//* (5) Your cutofflist must correspond to coordlist (same order) *//* cutofflist is the values of LM. Zero weight is put on terms *//* more than LM units apart in that dimmension in the calculation *//* of the covariance term *//* *//* OUTPUT: *//* betalgt= Maximum Likelihood Logit estimator *//* cov_nd= variance-covariance matrix of betalgt *//* without correction for spatial correlation *//* cov_dep= variance-covariance matrix of betalgt *//* without correction for spatial correlation */ *//************************************************************************/
program define xgmltversion 6.0syntax varlist(min=1) [, xreg(int -1) COord(int -1)]/* everything is required. */#delimit ; /*sets `;' as end of line*/
/* The following IF statments check to make sure everything is set up correctly. */
if `xreg'<1{; if `xreg'==-1{; di in red "option xreg() required!!!"; exit 198}; di in red "xreg(`xreg') is invalid"; exit 198};
if `coord'<1{; if `coord'==-1{; di in red "option coord() required!!!"; exit 198}; di in red "coord(`coord') is invalid"; exit 198};
/*Separate input variables: coordinates, cutoffs, dependent, regressors */
parse "`varlist'", parse(" "); local a=1;while `a'<=`coord'{; tempvar coord`a'; gen `coord`a''=``a''; /*get coordinates*/local a=`a'+1};
local aa=1;while `aa'<=`coord'{; tempvar cut`aa'; gen `cut`aa''=``a''; /*get cutoffs*/ local a=`a'+1;local aa=`aa'+1};
tempvar Y;gen `Y'=``a''; /*get dep variable*/local depend : word `a' of `varlist';
local a=`a'+1;
local b=1;while `b'<=`xreg'{; tempvar X`b'; local ind`b'="`b'"; gen `X`b''= ``a''; local ind`b' : word `a' of `varlist'; local a=`a'+1;local b=`b'+1}; /*get indep variable(s)*/
/*ESTIMATE THE LOGIT Model*/quietly{
if `xreg'==1{; logit `Y' `X1',noconstant};else{; logit `Y' `X1'-`X`xreg'' , noconstant};
/*save the parameter estimates and the variance covariance matrix */matrix betalgt = e(b);matrix cov_nd = e(V);
/* Create the residual term */tempvar phat uhat;predict `phat'; /* Phat is exp(XB)/(1+exp(XB)) */gen `uhat' = `Y' - `phat'; /* The residual */
};
/*Create the Variance Covariance matrix that corrects for SPATIAL DEPENDENCE*/tempname XUUX XUUk window XUUX1 XUUX2 XUUXt fix ; /* Declare a set of variables */matrix `XUUX' = J(`xreg',`xreg',0); /* Intializes the matrix */
quietly{
gen `XUUk'=0;gen `window'=1; /*initializes mat.s/var.s to be used*/local i=1;
while `i'<=_N{; /*loop through all observations*/ local j=1; replace `window'=1; while `j'<=`coord'{; /*loop through coordinates*/ if `i'==1{; tempvar dis`j'; gen `dis`j''=0};
replace `dis`j''=abs(`coord`j''-`coord`j''[`i']); replace `window'=`window'*(1-`dis`j''/`cut`j''); replace `window'=0 if `dis`j''>=`cut`j''; local j=`j'+1}; /*create window*/
/* End of j loop */
capture mat drop `XUUX2'; local k=1; while `k'<=`xreg'{; replace `XUUk'=`X`k''[`i']*`uhat'*`uhat'[`i']*`window'; if `xreg'==1{; mat vecaccum `XUUX1'=`XUUk' `X1', noconstant}; else{; mat vecaccum `XUUX1'=`XUUk' `X1'-`X`xreg'', noconstant}; mat `XUUX2'=nullmat(`XUUX2') \ `XUUX1'; local k=`k'+1}; /* End of k loop */
mat `XUUXt'=`XUUX2''; mat `XUUX1'=`XUUX2' +`XUUXt'; scalar `fix'=.5; /*to correct for double-counting*/ mat `XUUX1'=`XUUX1'*`fix'; mat `XUUX'=`XUUX' +`XUUX1'; local i=`i'+1}; /* End of i loop */
matrix `XUUX'=`XUUX'/_N;
/* We just calculated the Variance Covariance matrix and it is stored in *//* in the local variable XUUX. */ /* The next step is to calculate dg and construct the var-covar matrix for the parameters *//* for the parameter estimates. */
/* Compute dg *//* g = uhat*X so dg = d(uhat)/db * X *//* d(uhat)/db(j) = -1*(phat)*(1-phat)*X(j) */
/* use phat calculated above using predict */ tempvar sqdphat dg ;gen `sqdphat' = sqrt(`phat'*(1-`phat')); /* I take the square root to make following calculations easier */ local k=1;
while `k'<=`xreg'{; tempvar STF`k'; gen `STF`k''=`X`k''*`sqdphat'; local k=`k'+1};
/* End of While loop */ if `xreg'==1{; mat accum `dg'=``STF1', noconstant}; else{; mat accum `dg'=`STF1'-`STF`xreg'', noconstant};
matrix `dg' = `dg'/_N; /* Create the var-covariance matrix. */ mat cov_dep = inv(`dg'*inv(`XUUX')*`dg'')/_N; /*corrected covariance matrix*/
/*end of the quietly section */};
/*THIS PART CREATES AND PRINTS THE OUTPUT TABLE IN STATA*/local z=1;local v=`a';di _newline(2) _skip(5)"Results for Logit with Spatial Dependence ";di _newline _col(20) " number of observations= " _N;di _newline "Dependent variable= `depend'";di _newline"variable" _col(13) "Coef Est." _col(29) "Standard SE" _col(45) "Spatial SE";di "--------" _col(13) "-------------" _col(29) "---------" _col(45) "------------------";
while `z'<=`xreg'{; tempvar beta`z' beta1`z' se`z' see`z' se1`z' se2`z'; gen `beta`z''=betalgt[1,`z']; gen `se`z''=cov_nd[`z',`z']; gen `see`z''=sqrt(`se`z''); gen `se1`z''=cov_dep[`z',`z']; gen `se2`z''=sqrt(`se1`z''); di "`ind`z''" _col(13) `beta`z'' _col(29) `see`z'' _col(45) `se2`z'';local z=`z'+1};end;
exit;
123version https://git-lfs.github.com/spec/v1oid sha256:cc3b657a8b8fcd4b2f91688ad06cf78835d63fc5d124ed9610fcdafa5ca82803size 9123version https://git-lfs.github.com/spec/v1oid sha256:48f930d111c6e48b500be12e9bfd419946f1a9677e66a231062e1fe280a2b2fasize 1935706123version https://git-lfs.github.com/spec/v1oid sha256:d35012f448c0c3d0e9b247c3d04a341d975a358c220a41151c41c326823870dasize 183362123version https://git-lfs.github.com/spec/v1oid sha256:5137d8361687a4094f0a7af646e326ac2f0440ced94a81e149fa825e9c3c21bdsize 263094123version https://git-lfs.github.com/spec/v1oid sha256:c0de53840b39bf66e433f22bf6c7ab54014dafabe12d9963299e284e61a09687size 465360123version https://git-lfs.github.com/spec/v1oid sha256:6c6633e467079d0abe581adf561a20126ea74236aafcb40cc559040a962ace5esize 281021123version https://git-lfs.github.com/spec/v1oid sha256:f4afff3e229d480833f04c68a997ac0f4cfb7fa0556404df0ecf92c2851f9ee8size 562789123version https://git-lfs.github.com/spec/v1oid sha256:b71a4ba384617b3a79bdeaa4a3da172dcfb1a6f655bb01b2935a4f89d79c25absize 6353075123version https://git-lfs.github.com/spec/v1oid sha256:c7671695efe88df0d479ba480798c8b3fc7b8d8ba5bb55f7a43d665b0ff980f4size 8647142123version https://git-lfs.github.com/spec/v1oid sha256:6ce991759ae6b57dc63629a0c9eb179dbdaafec43c74a6a1da3f49758a81ed86size 259675123version https://git-lfs.github.com/spec/v1oid sha256:814b8e21770969e6ffa1a715f9eff21ca1eac0ae7baae853767748cfe6a7bd34size 115647123version https://git-lfs.github.com/spec/v1oid sha256:08b5c781db72d0e68542c0546ac8ee11393c53a8013d24fffa014c27aefe7af1size 52126123version https://git-lfs.github.com/spec/v1oid sha256:63be127fbb1c41fcd59e0f6aaabded974610c058d007d044570669a83351c016size 31355123version https://git-lfs.github.com/spec/v1oid sha256:f8ecdc155b6217f1eacd88598ad849fd7beae94f7d82e139f526156ab5a56d6csize 53101123version https://git-lfs.github.com/spec/v1oid sha256:0d46e0f4d537a29387110ab48a2eda847c0977763618199d5bcb5db23d0ad450size 113981123version https://git-lfs.github.com/spec/v1oid sha256:2f800bc6b569dfee6e85f9069909ed61df0e73fa6c36ca9c5889fb2672e4f95bsize 248943123version https://git-lfs.github.com/spec/v1oid sha256:4c78a9fbeb5894205b9e01d29730de246010842559e03973457c1323040df538size 129197123version https://git-lfs.github.com/spec/v1oid sha256:d4ecc5c76658ce37ad74117e23072333fc9866caeb38cdec38b3f45b0b3bc5a9size 150869123version https://git-lfs.github.com/spec/v1oid sha256:53548ed5b29e6b796d24484d27adb0dc98da93beecca841d5108ff5a8ebc5c92size 142328123version https://git-lfs.github.com/spec/v1oid sha256:c6a3cb121cfaf0c33b9afab0c62663f0cf303bdee1371bab8f87f3cdaba4afcfsize 10240123version https://git-lfs.github.com/spec/v1oid sha256:85814fed33c0646876ccc7d66161147a9f6ee2907d8ef4917c6eaf3916a1fefcsize 34816123version https://git-lfs.github.com/spec/v1oid sha256:376fdf72643e8e965dd80e47d158fa0c35b964a403494911db99be02d7fa748asize 1106343123version https://git-lfs.github.com/spec/v1oid sha256:7239ee7b9e967eb2a45d98f066204f40e107cbb6648e77a566c6901c2220f607size 1510028123version https://git-lfs.github.com/spec/v1oid sha256:c42d54a8f19fb3a35cbb21c03dfeb72dd6797ac4e95832fa7ea969fb8beae4f9size 155481123version https://git-lfs.github.com/spec/v1oid sha256:5b919256a722191ba00defcc2b67bfe8600dfed81d02435fc8bf867ece7cb1dbsize 82027123version https://git-lfs.github.com/spec/v1oid sha256:17e29b550b897378b558fab1db1258e738409fb5f16732b0cd67c3cc35c8c624size 30566123version https://git-lfs.github.com/spec/v1oid sha256:cf7c5cda5986f1699aafad90a97a3f7e5f97b840ea636341023fe408f5cbef3csize 3036123version https://git-lfs.github.com/spec/v1oid sha256:656a86acb25256c81bcc24bf93d4f8b72f5ba3a29339e6cdc33eaeda8c610833size 4516123version https://git-lfs.github.com/spec/v1oid sha256:c83650d10fe848da879709fc67aa5e4a14dcebbeaa85f6e9dbbb485fa9024303size 2809946123version https://git-lfs.github.com/spec/v1oid sha256:452ff873795d2e3d2e1e9b93c1df721ba61a5f14d5e33f91ad2ac07fd2d73333size 2656348.gitattributes+1
82/paper.pdfAdded+3
82/replication_package/DATASET_ANCIENT_CITIES.dtaAdded+3
82/replication_package/DATASET_ARCHAEOLOGY.dtaAdded+3
82/replication_package/DATASET_COUNTRIES.dtaAdded+3
82/replication_package/DATASET_ETHNOATLAS.dtaAdded+3
82/replication_package/DO_FILES/Main.doAdded+39
82/replication_package/DO_FILES/Replication Ancient Settlements FINAL.doAdded+315
82/replication_package/DO_FILES/Replication Archaeological Results FINAL.doAdded+71
82/replication_package/DO_FILES/Replication Country Results FINAL.doAdded+679
82/replication_package/DO_FILES/Replication EthnoAtlas FINAL.doAdded+806
82/replication_package/ESTA/esta.adoAdded+842
82/replication_package/ESTA/esta.hlpAdded+824
82/replication_package/ESTA/esta.pkgAdded+7
82/replication_package/ESTA/readme.txtAdded+3
82/replication_package/ESTA/stata.tocAdded+2
82/replication_package/PACKAGES/x_gmm.adoAdded+298
82/replication_package/PACKAGES/x_ols.adoAdded+181
82/replication_package/PACKAGES/xgmlt.adoAdded+250
82/replication_package/README.docxAdded
82/should_reproduce.txtAdded+3
83/paper.pdfAdded+3
83/replication_package/README.pdfAdded+3
83/replication_package/data/Hydropower_USA_Developed_1953.csvAdded+3
83/replication_package/data/Hydropower_USA_Developed_1953.dtaAdded+3
83/replication_package/data/Hydropower_USA_Undeveloped_1953.csvAdded+3
83/replication_package/data/Hydropower_USA_Undeveloped_1953.dtaAdded+3
83/replication_package/data/NBER_gaz1990countydistance100miles.csvAdded+3
83/replication_package/data/NBER_gaz1990countydistance100miles.dtaAdded+3
83/replication_package/data/climate1950_2000.csvAdded+3
83/replication_package/data/climate1950_2000.dtaAdded+3
83/replication_package/data/counties_largeplants100mwff.csvAdded+3
83/replication_package/data/counties_largeplants100mwff.dtaAdded+3
83/replication_package/data/counties_tiger_2000.csvAdded+3
83/replication_package/data/counties_tiger_2000.dtaAdded+3
83/replication_package/data/county_distance_trlinesHv.csvAdded+3
83/replication_package/data/county_distance_trlinesHv.dtaAdded+3
83/replication_package/data/county_latlon_landarea.csvAdded+3
83/replication_package/data/county_latlon_landarea.dtaAdded+3
83/replication_package/data/deflator.xlsAdded+3
83/replication_package/data/deflator_historical.xlsAdded+3
83/replication_package/data/egrid2007_generators.csvAdded+3
83/replication_package/data/egrid2007_generators.dtaAdded+3
83/replication_package/data/egrid2007_plants_counties.csvAdded+3
83/replication_package/data/egrid2007_plants_counties.dtaAdded+3
83/replication_package/data/egrid_dams_sample.xlsxAdded+3
83/replication_package/data/eletricity_generation_usa.csvAdded+3
83/replication_package/data/eletricity_generation_usa.dtaAdded+3
83/replication_package/data/emp_c1990.csvAdded+3
83/replication_package/data/emp_c1990.dtaAdded+3