数据清理时的代码格式
*************CHNS CONSUMPTION DATA************
*auther: Jamin
*email : xxx@163.com
/*行业cpi、工业cpi:缺失值用前后两期的平均值替代*/
foreach var of varlist hhinc_cpi hhincpc_cpi indinc_cpi{
sum `var'
sort idind wave
by idind:replace `var'=(`var'[_n+1]+`var'[_n-1])/2 if `var'==.
}
数据分析的代码规范
*************CHNS CONSUMPTION DATA************
*auther: Jamin
*email : xxx@163.com
*********************************************************IV估计***********************************************
/*
note:核心变量
y:ln_Ave_Net_Income poverty_cn_total poverty_worldbank
x:house_certification
mechanism:nonfarmemployee
group:Ave_Area
control:
global hd "HD_Age HD_Edu HH_FemHead"
global family "Ave_Area HH_Pop HH_Altitude disaster01 Yield HH_Dai _Transfer"
global village "Dis_County Dis_Factory Market Bank Num_Pop Water_Supply Transport_Cost"
*/
/*父亲外出务工样本*/
reg chn migration if father==1
/*母亲外出务工样本*/
reg chn migration if mother==1
网友评论