|
|
|
|
|
|
|
|
|
|
|
|
|
|
capture log close |
|
|
clear |
|
|
set matsize 3000 |
|
|
set more off |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use "Data/censo_ag_wreform.dta", clear |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
label variable ln_agprod_pricew_crops "Agricultural Productivity (ln($/ha))" |
|
|
label variable CashCrop_Share "Share of Property for Cash Crops" |
|
|
label variable StapleCrop_Share "Share of Property for Staple Crops" |
|
|
label variable norm_dist "Distance to Reform Threshold (ha)" |
|
|
label variable own_amt "Former Owner's Cumulative Landholdings (ha)" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local polynomial_level 1 |
|
|
local bandwidth_choice "mserd" |
|
|
local kernel_choice "tri" |
|
|
local cluster_level "Expropretario_ISTA" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
capture drop S16* |
|
|
merge 1:1 agg_id using "./Data/censo_ag_investments.dta", gen(cap_merge) |
|
|
|
|
|
|
|
|
global tflist "" |
|
|
global modseq=0 |
|
|
global modid = 1 |
|
|
|
|
|
foreach dep_var of varlist S16A* { |
|
|
dis "`dep_var'" |
|
|
clear matrix |
|
|
|
|
|
global modseq=$modseq+1 |
|
|
tempfile tf$modseq |
|
|
|
|
|
capture rdrobust `dep_var' norm_dist, c(0) p(`polynomial_level') bwselect(`bandwidth_choice') kernel(`kernel_choice') vce(cluster `cluster_level') |
|
|
|
|
|
capture parmest, label idn($modseq) idstr("`dep_var'") saving(`tf$modseq',replace) flist(tflist) |
|
|
} |
|
|
|
|
|
preserve |
|
|
dsconcat $tflist |
|
|
sort idnum |
|
|
outsheet using "./Output/Temp/CapitalStocks.csv", replace comma |
|
|
restore |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
capture drop S15* |
|
|
merge 1:1 agg_id using "./Data/censo_ag_inputs.dta", gen(S15B_merge) |
|
|
|
|
|
global tflist "" |
|
|
global modseq=0 |
|
|
global modid = 1 |
|
|
|
|
|
|
|
|
foreach dep_var of varlist S15B* { |
|
|
dis "`dep_var'" |
|
|
clear matrix |
|
|
|
|
|
global modseq=$modseq+1 |
|
|
tempfile tf$modseq |
|
|
|
|
|
capture rdrobust `dep_var' norm_dist, c(0) p(`polynomial_level') bwselect(`bandwidth_choice') kernel(`kernel_choice') vce(cluster `cluster_level') |
|
|
|
|
|
capture parmest, label idn($modseq) idstr("`dep_var'") saving(`tf$modseq',replace) flist(tflist) |
|
|
} |
|
|
|
|
|
preserve |
|
|
dsconcat $tflist |
|
|
sort idnum |
|
|
outsheet using "./Output/Temp/InputUse.csv", replace comma |
|
|
restore |
|
|
drop S15B* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
merge 1:1 agg_id using "./Data/censo_ag_minorcrops.dta", gen(S5B_merge) |
|
|
|
|
|
|
|
|
|
|
|
global tflist "" |
|
|
global modseq=0 |
|
|
global modid = 1 |
|
|
|
|
|
foreach dep_var of varlist S5B* { |
|
|
dis "`dep_var'" |
|
|
clear matrix |
|
|
|
|
|
global modseq=$modseq+1 |
|
|
tempfile tf$modseq |
|
|
|
|
|
capture rdrobust `dep_var' norm_dist, c(0) p(`polynomial_level') bwselect(`bandwidth_choice') kernel(`kernel_choice') vce(cluster `cluster_level') |
|
|
|
|
|
capture parmest, label idn($modseq) idstr("`dep_var'") saving(`tf$modseq',replace) flist(tflist) |
|
|
} |
|
|
|
|
|
preserve |
|
|
dsconcat $tflist |
|
|
sort idnum |
|
|
outsheet using "./Output/Temp/MinorCropProduction.csv", replace comma |
|
|
restore |
|
|
|
|
|
|
|
|
|
|
|
merge 1:1 agg_id using "./Data/censo_ag_minorfruits.dta", gen(S8B_merge) |
|
|
|
|
|
|
|
|
|
|
|
global tflist "" |
|
|
global modseq=0 |
|
|
global modid = 1 |
|
|
|
|
|
foreach dep_var of varlist S8B* { |
|
|
dis "`dep_var'" |
|
|
clear matrix |
|
|
|
|
|
global modseq=$modseq+1 |
|
|
tempfile tf$modseq |
|
|
|
|
|
capture rdrobust `dep_var' norm_dist, c(0) p(`polynomial_level') bwselect(`bandwidth_choice') kernel(`kernel_choice') vce(cluster `cluster_level') |
|
|
|
|
|
capture parmest, label idn($modseq) idstr("`dep_var'") saving(`tf$modseq',replace) flist(tflist) |
|
|
} |
|
|
|
|
|
preserve |
|
|
dsconcat $tflist |
|
|
sort idnum |
|
|
outsheet using "./Output/Temp/MinorFruitProduction.csv", replace comma |
|
|
restore |
|
|
|