固定效应模型和随机模型都可以
示例以固定效益模型为例
- use 数据.dta, clear
- * 定义控制变量
- global CV Size Lev Growth ROE TOP1 Cap Inde Board Duality Age Share
-
- * 面板固定效应模型
- xtset Stkcd Year
- xi:xtreg Y X $CV i.Year if group==1, fe
- est store r1
- xi:xtreg Y X $CV i.Year if group==0, fe
- est store r2
- * 使用esttab命令输出结果
- esttab r1 r2, b(3) t(3) nogap replace star(* 0.1 ** 0.05 *** 0.01) scalar(r2_w) indicate("Year=*Year*") mtitle("group==1" "group==0")