反事实分析的程序(STATA)
(2012-10-22 21:18:46)
标签:
杂谈 |
反事实分析的程序(STATA)
Machado-Mata decomposition(counterfactual decomposition)
程序的一部分,需要的请联系我yjh_academic@163.com
* this step does steps 1-4 in Machado-Mata decomposition *=========================================================== * MERGE RUSSIAN AND UKRAINIAN FILES *=========================================================== clear all set more off set mem 50M set matsize 200 cd C:\Research\Sabirianova\PrivatePublic\NewCode set more off set seed 1234567893 cd Workfiles use pubwage_workfile, clear keep if s==1 keep lnwage id *own owncat privatize newprivat edu male exp exp2 ten ten2 fulltime otr1dig firmsize tercat year keep if lnwage~=. *======================================================== * create dummy variables for firm size local counter1=1 foreach var in 1 10 50 100 500 1000 99 { gen frmsz_`counter1'=(firmsize==`var') local counter1=`counter1'+1 } * create dummy variables for otr1dig foreach var in 1 2 3 4 5 6 7 8 9 10 11 { gen otr1dig_`var'=(otr1dig==`var') } replace otr1dig_10=1 if otr1dig_8==1 drop otr1dig_8 foreach var in 1 2 3 4 5 { gen tercat_`var'=(tercat==`var') } gen SOE=(owncat==1) gen NEW=(owncat==3) gen PRZ=(owncat==2) compress save tempMM.dta, replace *=================================================================================== * GENERATE SAMPLE OF A GIVEN SIZE * BY RESAMPLING ACTUAL DATA *=================================================================================== local *==================================================================================== * CREATE/ESTIMATE QUANTILE COEFFICIENTS *==================================================================== * COMBINE RESAMPLED DATA SETS WITH * THE SET OF QQ COEFFICIENTS *==================================================================== * local bsize=10 /* size of
前一篇:[转载]关于面板数据的统计分析