其他
esttab输出行业+地区+省份+年份虚拟变量Yes No 控制 是/否+++面板个体、时间、双固定结果输出命令汇总
stata结果输出:esttab输出行业+地区+省份+年份虚拟变量Yes No 控制 是/否++面板个体固定、时间固定、双固定结果输出命令汇总
use 数据.dta,clear
qui reg lntfp tt i.year i.area i.ind if so2==1,cluster(area)
est store m1
qui reg lntfp tt zcsy lf age owner sczy lnaj lnlabor lnzlb i.year i.area i.ind if ///
so2==1,cluster(area)
est store m2
qui xtreg lntfp tt i.year i.company if so2==1,cluster(area)
est store m3
qui xtreg lntfp tt zcsy lf age owner sczy lnaj lnlabor lnzlb i.year i.company if ///
so2==1,cluster(area)
est store m4
esttab m*, mtitle(m1 m2) b(%6.4f) se(%6.4f) nogap compress ///
star(* 0.1 ** 0.05 *** 0.01) ///
r2(%6.4f) scalar(N) replace ///
indicate("时间固定效应 =*.year" "地区固定效应 =*.area" "行业固定效应 =*.ind" "个体固定效应 =*.company")
结果为:
2、Stata面板个体固定、时间固定、双固定结果输出命令汇总
*# 结果输出汇总:
clear
set more off
use "E:\stata\data\FDI.dta", clear
xtset var1 year
*1、个体固定效应模型
*#方法1
xtreg lngdp lnfdi lnie lnex lnim lnci lngp,fe r
est store m1
*#方法2
reg lngdp lnfdi lnie lnex lnim lnci lngp i.var1, r
*2、【时点】固定效应变截距模型
reg lngdp lnfdi lnie lnex lnim lnci lngp i.year, r
est store m2
*3、个体时间双固定效应模型代码为:
*#方法1
xtreg lngdp lnfdi lnie lnex lnim lnci lngp i.year,fe r
est store m3
*#方法2
reg lngdp lnfdi lnie lnex lnim lnci lngp i.var1 i.year, r
esttab m1 m2 m3 , ///
title("面板数据计量分析之结果输出") replace ///
mtitles("个体" "时间" "个体时间") ///
b(%6.3f) t(%6.3f) ///
star( * 0.10 ** 0.05 *** 0.01 ) ///
addnotes("*** 1% ** 5% * 10%") staraux r2 nogap compress
个体固定效应、时间固定、双固定效应模型操作结果为:
1、个体固定效应模型代码为:
#方法1
xtreg lngdp lnfdi lnie lnex lnim lnci lngp,fe r
#方法2
reg lngdp lnfdi lnie lnex lnim lnci lngp i.id, r
结果为:
2、时间固定效应模型代码为:
【时点】固定效应变截距模型
reg lngdp lnfdi lnie lnex lnim lnci lngp i.year, r
3、个体时间双固定效应模型代码为:
#方法1
xtreg lngdp lnfdi lnie lnex lnim lnci lngp i.year,fe r
#方法2
reg lngdp lnfdi lnie lnex lnim lnci lngp i.state i.year, r
4、结果输出
. clear
. set more off
. use "E:\stata\data\FDI.dta", clear
. xtset var1 year
panel variable: var1 (strongly balanced)
time variable: year, 2005 to 2015
delta: 1 unit
. *1、个体固定效应模型
. *#方法1
. xtreg lngdp lnfdi lnie lnex lnim lnci lngp,fe r
Fixed-effects (within) regression Number of obs = 341
Group variable: var1 Number of groups = 31
R-sq: Obs per group:
within = 0.9154 min = 11
between = 0.4268 avg = 11.0
overall = 0.5069 max = 11
F(6,30) = 118.00
corr(u_i, Xb) = 0.1189 Prob > F = 0.0000
(Std. Err. adjusted for 31 clusters in var1)
------------------------------------------------------------------------------
| Robust
lngdp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lnfdi | .1620616 .066825 2.43 0.022 .0255868 .2985365
lnie | -.011579 .1955887 -0.06 0.953 -.4110244 .3878664
lnex | .1780455 .1565214 1.14 0.264 -.1416139 .4977049
lnim | .2169 .0619277 3.50 0.001 .0904269 .3433732
lnci | .2069592 .1360425 1.52 0.139 -.0708767 .4847951
lngp | .9621937 .1393597 6.90 0.000 .6775832 1.246804
_cons | -4.36752 1.03917 -4.20 0.000 -6.489789 -2.245252
-------------+----------------------------------------------------------------
sigma_u | .76794087
sigma_e | .13909251
rho | .96823615 (fraction of variance due to u_i)
------------------------------------------------------------------------------
. est store m1
. *2、【时点】固定效应变截距模型
. reg lngdp lnfdi lnie lnex lnim lnci lngp i.year, r
Linear regression Number of obs = 341
F(16, 324) = 240.20
Prob > F = 0.0000
R-squared = 0.9044
Root MSE = .34395
------------------------------------------------------------------------------
| Robust
lngdp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lnfdi | -.0950417 .0461325 -2.06 0.040 -.1857987 -.0042847
lnie | -.621826 .1563869 -3.98 0.000 -.929488 -.3141641
lnex | .5672768 .0998822 5.68 0.000 .3707772 .7637763
lnim | .336701 .0834118 4.04 0.000 .1726039 .5007981
lnci | -.2755211 .1139567 -2.42 0.016 -.4997095 -.0513327
lngp | -1.20302 .0771109 -15.60 0.000 -1.354721 -1.051318
|
year |
2006 | .1611404 .1017936 1.58 0.114 -.0391193 .3614002
2007 | .3659864 .0975256 3.75 0.000 .174123 .5578497
2008 | .6134635 .0978729 6.27 0.000 .420917 .80601
2009 | .9791186 .1005827 9.73 0.000 .781241 1.176996
2010 | 1.080576 .1030606 10.48 0.000 .8778236 1.283329
2011 | 1.266939 .1046316 12.11 0.000 1.061096 1.472782
2012 | 1.419002 .1053182 13.47 0.000 1.211808 1.626195
2013 | 1.511623 .1078047 14.02 0.000 1.299537 1.723708
2014 | 1.561977 .1080786 14.45 0.000 1.349353 1.774602
2015 | 1.765482 .111232 15.87 0.000 1.546653 1.98431
|
_cons | 14.22978 .7091521 20.07 0.000 12.83466 15.6249
------------------------------------------------------------------------------
. est store m2
. *3、个体时间双固定效应模型代码为:
. *#方法1
. xtreg lngdp lnfdi lnie lnex lnim lnci lngp i.year,fe r
Fixed-effects (within) regression Number of obs = 341
Group variable: var1 Number of groups = 31
R-sq: Obs per group:
within = 0.9853 min = 11
between = 0.8468 avg = 11.0
overall = 0.5721 max = 11
F(16,30) = 499.31
corr(u_i, Xb) = 0.4050 Prob > F = 0.0000
(Std. Err. adjusted for 31 clusters in var1)
------------------------------------------------------------------------------
| Robust
lngdp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
lnfdi | .0152438 .0263219 0.58 0.567 -.0385126 .0690002
lnie | -.0592966 .075265 -0.79 0.437 -.2130083 .094415
lnex | .1103377 .0485864 2.27 0.030 .0111111 .2095643
lnim | .0481628 .0351848 1.37 0.181 -.0236941 .1200197
lnci | .150422 .0662466 2.27 0.031 .0151285 .2857156
lngp | -.1767717 .1011458 -1.75 0.091 -.3833391 .0297956
|
year |
2006 | .1302531 .0127947 10.18 0.000 .1041229 .1563833
2007 | .299032 .0263906 11.33 0.000 .2451352 .3529288
2008 | .4678728 .0425085 11.01 0.000 .3810588 .5546868
2009 | .5989009 .0529545 11.31 0.000 .4907533 .7070484
2010 | .7459874 .0635466 11.74 0.000 .6162079 .8757669
2011 | .9167391 .0757519 12.10 0.000 .7620331 1.071445
2012 | 1.015613 .0830691 12.23 0.000 .8459637 1.185263
2013 | 1.101845 .0862763 12.77 0.000 .9256458 1.278045
2014 | 1.164955 .0878947 13.25 0.000 .9854505 1.34446
2015 | 1.242972 .0892019 13.93 0.000 1.060797 1.425146
|
_cons | 8.426454 .8562074 9.84 0.000 6.677845 10.17506
-------------+----------------------------------------------------------------
sigma_u | .78635225
sigma_e | .05896912
rho | .99440784 (fraction of variance due to u_i)
------------------------------------------------------------------------------
. est store m3
. esttab m1 m2 m3 , ///
> title("面板数据计量分析之结果输出") replace ///
> mtitles("个体" "时间" "个体时间") ///
> b(%6.3f) t(%6.3f) ///
> star( * 0.10 ** 0.05 *** 0.01 ) ///
> addnotes("*** 1% ** 5% * 10%") staraux r2 nogap compress
面板数据计量分析之结果输出
-------------------------------------------------
(1) (2) (3)
个体 时间 个体时间
-------------------------------------------------
lnfdi 0.162 -0.095 0.015
(2.425)** (-2.060)** (0.579)
lnie -0.012 -0.622 -0.059
(-0.059) (-3.976)*** (-0.788)
lnex 0.178 0.567 0.110
(1.138) (5.679)*** (2.271)**
lnim 0.217 0.337 0.048
(3.502)*** (4.037)*** (1.369)
lnci 0.207 -0.276 0.150
(1.521) (-2.418)** (2.271)**
lngp 0.962 -1.203 -0.177
(6.904)*** (-15.601)*** (-1.748)*
2005.year 0.000 0.000
(.) (.)
2006.year 0.161 0.130
(1.583) (10.180)***
2007.year 0.366 0.299
(3.753)*** (11.331)***
2008.year 0.613 0.468
(6.268)*** (11.007)***
2009.year 0.979 0.599
(9.734)*** (11.310)***
2010.year 1.081 0.746
(10.485)*** (11.739)***
2011.year 1.267 0.917
(12.109)*** (12.102)***
2012.year 1.419 1.016
(13.473)*** (12.226)***
2013.year 1.512 1.102
(14.022)*** (12.771)***
2014.year 1.562 1.165
(14.452)*** (13.254)***
2015.year 1.765 1.243
(15.872)*** (13.934)***
_cons -4.368 14.230 8.426
(-4.203)*** (20.066)*** (9.842)***
-------------------------------------------------
N 341 341 341
R-sq 0.915 0.904 0.985
-------------------------------------------------
t statistics in parentheses
*** 1% ** 5% * 10%
* p<0.10, ** p<0.05, *** p<0.01