
use "styledrift final.dta"

*描述性统计
logout,save (D:\临时文件) excel replace dec(3): tabstat 原始超额回报率 capm季度alpha 三因子季度alpha 四因子季度alpha 五因子季度alpha 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄,stat(N  min p25 p50  p75  max mean sd)  format(%9.3f) c(s)
*均值T检验
bys newdate : egen 欧式距离_m = median(欧式距离)
gen 欧式距离分组=1 if 欧式距离 >=欧式距离_m
replace 欧式距离分组=0 if 欧式距离分组==.
logout,save (D:\临时文件) excel replace dec(3): ttable3  原始超额回报率 capm季度alpha 三因子季度alpha 四因子季度alpha 五因子季度alpha  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄, by( 欧式距离分组 )   format(%6.3f)


*均值T检验的标准差
logout,save (D:\临时文件) excel replace dec(3): tabstat 原始超额回报率 capm季度alpha 三因子季度alpha 四因子季度alpha 五因子季度alpha  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄 if 欧式距离分组==1,stat(N  min p25 p50  p75  max mean sd)  format(%9.3f) c(s)
logout,save (D:\临时文件) excel replace dec(3): tabstat 原始超额回报率 capm季度alpha 三因子季度alpha 四因子季度alpha 五因子季度alpha  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄 if 欧式距离分组==0,stat(N  min p25 p50  p75  max mean sd)  format(%9.3f) c(s)

*基础回归 表2
xtset 证券代码 newdate
xtreg 原始超额回报率 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a1 
xtreg capm季度alpha 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a2 
xtreg 三因子季度alpha 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a3
xtreg 四因子季度alpha 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a4
xtreg 五因子季度alpha 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a5
reg2docx  a1 a2 a3 a4 a5 using 结果.docx, replace b t(%7.2f)    scalars(N r2(%9.3f) r2_a(%9.3f))

*稳健性回归panelA 表3
xtreg 原始超额回报率 曼哈顿距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a1 
xtreg capm季度alpha 曼哈顿距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a2 
xtreg 三因子季度alpha 曼哈顿距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a3
xtreg 四因子季度alpha 曼哈顿距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a4
xtreg 五因子季度alpha 曼哈顿距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a5
reg2docx  a1 a2 a3 a4 a5 using 结果.docx, replace b t(%7.2f)    scalars(N r2(%9.3f) r2_a(%9.3f))
  

*稳健性回归panelB 表3
xtreg 超越基准收益 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a1 
xtreg 基准调整capm季度alpha 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a2 
xtreg 基准调整三因子季度alpha 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a3 
xtreg 基准调整四因子季度alpha 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a4
xtreg 基准调整五因子季度alpha 欧式距离  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a5
reg2docx  a1 a2 a3 a4 a5 using 结果.docx, replace b t(%7.2f)    scalars(N r2(%9.3f) r2_a(%9.3f))

*申万行业分类 表4
xtreg 原始超额回报率 欧式距离申万1  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a1 
xtreg capm季度alpha 欧式距离申万1  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a2 
xtreg 三因子季度alpha 欧式距离申万1  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a3
xtreg 四因子季度alpha 欧式距离申万1  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a4
xtreg 五因子季度alpha 欧式距离申万1  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
est store a5
reg2docx  a1 a2 a3 a4 a5 using 结果.docx, replace b t(%7.2f)    scalars(N r2(%9.3f) r2_a(%9.3f))

*图2
gen tmp = runiform()
sort tmp
psmatch2 treat 基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄,  logit ate neighbor(1) common caliper(.05) ties
twoway (kdensity _ps if _treat==1, legend(label(1 "Treat")))     (kdensity _ps if _treat==0, legend(label(2 "Control"))), xtitle(Pscore) title("Before Matching") scheme(tufte) legend(col(2)  pos(6)) 
twoway (kdensity _ps if (_treat==1), legend(label(1 "Treat")))     (kdensity _ps if (_treat==0&_wei!=.), legend(label(2 "Control"))),  xtitle("Pscore") title("After Matching") scheme(tufte) legend(col(2)  pos(6)) 
preserve
drop if _support==0


*图3
gen period = newdate1 -246
gen pe_4 = (period==-4& treat  ==1)
gen pe_3 = (period==-3& treat  ==1)
gen pe_2 = (period==-2& treat  ==1)
gen pe_1 = (period==-1& treat  ==1)
gen current = (period==0& treat  ==1)
gen post_1 = (period==1& treat ==1)
gen post_2 = (period==2& treat  ==1)
gen post_3 = (period==3& treat  ==1)
gen post_4 = (period==4& treat  ==1)
xtreg  超额收益 pe_* current post_*  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码) 
estimates store result
coefplot result,keep(pe_* current post_*) vertical recast( connect) yline( 0) xline( 5, lp(dash)) ytitle("超额收益") scheme(tufte)

* did 表5
xtreg 欧式距离 did time treat  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,fe r cluster(证券代码)
est store a1
reg 原始超额回报率 did time treat  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  
est store a2
reg capm季度alpha did time treat  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  
est store a3
reg 三因子季度alpha did time treat  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  
est store a4
reg 四因子季度alpha did time treat  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  
est store a5
reg 五因子季度alpha did time treat  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  
est store a6
reg2docx  a1 a2 a3 a4 a5 a6 using 结果.docx, replace b t(%7.2f)    scalars(N r2(%9.3f) r2_a(%9.3f))
restore


*基金分析能力 表6
xtreg 原始超额回报率 c.欧式距离##i.投资能力  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a1 
xtreg capm季度alpha c.欧式距离##i.投资能力  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a2 
xtreg 三因子季度alpha c.欧式距离##i.投资能力  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a3
xtreg 四因子季度alpha c.欧式距离##i.投资能力  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a4
xtreg 五因子季度alpha c.欧式距离##i.投资能力  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a5
reg2docx  a1 a2 a3 a4 a5 using 结果.docx, replace b t(%7.2f)    scalars(N r2(%9.3f) r2_a(%9.3f))

*监管对高能力基金风格漂移的影响 表7
reg 原始超额回报率 c.distance1##i.投资能力##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a1
reg capm季度alpha c.distance1##i.投资能力##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a2 
reg 三因子季度alpha c.distance1##i.投资能力##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a3
reg 四因子季度alpha c.distance1##i.投资能力##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a4
reg 五因子季度alpha c.distance1##i.投资能力##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a5
reg2docx  a1 a2 a3 a4 a5 using 结果.docx, replace b t(%7.2f)    scalars(N r2(%9.3f) r2_a(%9.3f))

*基金追热点 表8

xtreg 原始超额回报率 c.欧式距离##c.追热点  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a1 
xtreg capm季度alpha c.欧式距离##c.追热点  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a2 
xtreg 三因子季度alpha c.欧式距离##c.追热点  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a3
xtreg 四因子季度alpha c.欧式距离##c.追热点  基金规模 负债 分红率 管理费占总费用的比例 基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a4
xtreg 五因子季度alpha c.欧式距离##c.追热点  基金规模 负债 分红率 管理费占总费用的比例  基金年龄 投资集中度 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  i.newdate,fe r cluster(证券代码)
est store a5
reg2docx  a1 a2 a3 a4 a5 using 结果.docx, replace b t(%7.2f)    scalars(N r2(%9.3f) r2_a(%9.3f))


政策对追热点基金的影响 表9
reg 原始超额回报率 c.distance2## c.追热点##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a1
reg capm季度alpha c.distance2## c.追热点##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a2 
reg 三因子季度alpha c.distance2## c.追热点##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a3
reg 四因子季度alpha c.distance2## c.追热点##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a4
reg 五因子季度alpha c.distance2## c.追热点##i.time  基金规模  基金年龄 投资集中度 负债 分红率 管理费占总费用的比例 经理变更1  性别 学历 证券从业经历年 任职经历时间 经理年龄  ,r 
est store a5
reg2docx  a1 a2 a3 a4 a5 using 结果.docx, replace b t(%7.2f)    scalars(N r2(%9.3f) r2_a(%9.3f))


