[关闭]
@liuyuxi 2021-08-18T13:10:16.000000Z 字数 3258 阅读 14

论文code笔记

stata


#

  1. *主要变量描述性统计--《CEO复合型职业经历、企业风险承担与企业价值》
  2. tabstat Risk1 Risk2 CEO_CERI CEO_POS-CEO_OVE Firmage Size Debt ROE TOP1 Cap Growth Ind Board Duality CEOAge CEOShare GDP,stat(count mean sd median min max)col(stat)
  3. *表1,treat为识别上市企业与非上市企业的虚拟变量--祝树金,汤超:《企业上市对出口产品质量升级的影响》
  4. tabstat quality $yy , stats(mean sd p25 p50 p75) col(s) format(%12.4f) //Note:注意col(s)与col(stat)
  5. ttable3 quality $yy, by(treat) f(%12.4f) //Note:注意ttable3
  6. (应是将两张表拼接在了一起)
  1. **回归结果输出--《CEO复合型职业经历、企业风险承担与企业价值》
  2. esttab th1 th2 th3 th4 th5 th6, scalar(r2_a N) compress star(* 0.1 ** 0.05 *** 0.01) b(%6.4f) t(%6.4f) mtitles title(“hehe”) ,using thr2.rtf,replace
  3. esttab eg1 eg2 eg3 eg4 eg5 eg6, scalar(r2_a N) compress star(* 0.1 ** 0.05 *** 0.01) b(%6.4f) t(%6.4f) mtitles title(“hehe”) ,using eg2.rtf,replace
  4. esttab fx1 fx2 fx3 fx4 fx5 fx12 fx22 fx32 fx42 fx52, scalar(r2_a N) compress star(* 0.1 ** 0.05 *** 0.01) b(%6.4f) t(%6.4f) mtitles title(“hehe”) ,using fx.rtf,replace //Note:注意using 的位置;另外,esttab选项中的b(4) p(4) ar2(4)
  5. *感想:这些代码都是将许多结果放在一起输出,感觉表格第一行的分组应该都是作者后续添加的吧。
  6. **王若兰,刘灿雷:《市场竞争、利润分享与企业间工资不平等》;
  7. 4(输出6个回归结果)
  8. esttab d* using table-4.rtf, b(4) p(4) star(* 0.10 ** 0.05 *** 0.01) ar2(4) nogaps drop(*.year) compress replace
  9. 6 分位数回归结果(9个回归结果)
  10. esttab e* using table-5.rtf, b(4) p(4) star(* 0.10 ** 0.05 *** 0.01) ar2(4) nogaps drop(*.year) compress replace
  11. 感觉分位数标号与底下的各种信息应该是后面添上的。
  12. 712个结果分两个表列出应该是将两个结果合并在一起形成的。
  13. esttab f* using table-7.rtf, b(4) p(4) star(* 0.10 ** 0.05 *** 0.01) ar2(4) nogaps drop(*.year) compress replace
  14. **周茂:《外资管制放松如何影响企业非产成品存货调整》(此文处理严谨)
  15. 2
  16. esttab m1 m2 m3 m4 m5, scalar(r2 N) compress star(* 0.1 ** 0.05 *** 0.01) b(%6.4f) t(%6.4f) order(fdi_regpost02 ) nogap, using table2.rtf,replace
  17. 也是只输出了核心解释变量,也是将using放在最后面。但最值得注意的是m3-m5,分别加入post与处理前2000年的三个变量fdi*post02等。
  18. 4
  19. esttab m1 m2 m3 m4 m5 m6, scalar(r2 N) compress star(* 0.1 ** 0.05 *** 0.01) b(%6.4f) t(%6.4f) order( fdi_regpost02 ) nogap, using table4.rtf,replace
  20. 5确实是3张输出表格粘在一起,值得借鉴。同样是将using放在最后面。
  21. **《服务型对外直接投资与企业产出》输出8个回归结果(文章与code较细)
  22. outreg2 [ r1 r2 r3 r4 r5 r6 r7 r8] using basic, tstat word replace dec(4)
  1. **王若兰,刘灿雷:《市场竞争、利润分享与企业间工资不平等》(根据图、表提供对应代码)
  2. *演变趋势对比图(实心连线图)
  3. use Figure-1-b.dta,clear
  4. twoway(scatter mhhi year if Treat==1,c(l) legend(pos(12)))(scatter mhhi year if Treat==0,c(l) xline(2002))
  5. use Figure-1-b.dta,clear
  6. twoway(scatter mhhi year if Treat==1,c(l) legend(pos(12)))(scatter mhhi year if Treat==0,c(l) xline(2002)) //Note:注意c(l)
  7. *图中插入一两条直线
  8. use Figure-2.dta,clear
  9. kdensity Beta,xline(0) xline(0.8862)
  10. count if Beta<0.8862 //Note:注意count if
  11. 《外资管制放松如何影响企业非产成品存货调整》
  12. 1 处理组与对照组 变化趋势图
  13. use 数据1.dta , clear
  14. collapse (mean) non_fin_inven, by(fdi_reg year) //注意collapse使用
  15. twoway (connected non_fin_inven year if fdi_reg==1, lpattern(dash) )(connected ///
  16. non_fin_inven year if fdi_reg==0, lpattern(solid) ), ytitle("非产成品存货", orientation(rvertical)) ///
  17. xline(2002) legend(label(1 "处理组的非产成品存货")label(2 "控制组的非产成品存货")) ///
  18. xlabel(1998(2)2008,angle(0)) graphregion(color(white)) plotregion(color(white)) ///
  19. ylabel(,angle(0))
  20. 2
  21. import excel using 数据3.xlsx, firstrow clear
  22. destring year, replace
  23. twoway (scatter y year if year>=1999 & year<=2002, connect(direct) lcolor(black) mcolor(black) msymbol(Oh)) ///
  24. (scatter y year if year>=2002 & year<=2007, connect(direct) lcolor(black) mcolor(black) msymbol(O)) ///
  25. (line yl year, lpattern(dash) lcolor(gs5)) ///
  26. (line yh year, lpattern(shortdash) lcolor(gs5)), ylabel(-0.05 "-0.05" -0.03 "-0.03" -0.01 "-0.01" 0.01 "0.01" 0.03 "0.03" 0.05 "0.05" 0.07 "0.07" 0.09 "0.09", angle(0)) ///
  27. xlabel(1998 (1) 2008) yline(0, lcolor(black)) ytitle("系数", orientation(rvertical)) xtitle(年份) legend(off) graphregion(color(white)) plotregion(color(white))
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注