如何在stata estout中引用滞后交互系数? (错误 "coefficient not found")
How to reference lagged interaction coefficient in stata estout? (error "coefficient not found")
我有一个(也许)关于 Stata 中 estout 的简单问题:
我有一个面板数据集,想通过estout导出回归表,但只保留一些系数。我遇到的问题是我不明白如何参考 1) 滞后和 2) 相互作用的系数。对于每种情况,esttab 都可以正常工作,但是当我同时尝试这两种情况时,系数“未找到”(Stata 错误项)。
示例:
clear
ssc install estout
input float(code year var1 var2 var3)
1 2000 1 2 3
1 2001 45 5555 8
1 2002 3 3 3
2 2000 11 8 9
2 2001 2 1 12
2 2002 3 4 11111
3 2000 4 77 1
3 2001 3 99 3
3 2002 111 9 20
end
xtset code year
eststo: xtpcse var1 l.c.var2##l.c.var3
esttab using example.rtf, keep(l.c.var2#l.c.var3) replace
没有交互中的滞后变量,keep() 命令中的“c.var2#c.var3”工作正常。如果没有交互,keep() 命令中的“l.var2”也能正常工作。结合起来,我收到一个错误...
这个问题看起来很简单,但我就是想不通。
观察回归输出中出现的系数名称:
eststo: xtpcse var1 l.c.var2##l.c.var3
Linear regression, correlated panels corrected standard errors (PCSEs)
Group variable: code Number of obs = 6
Time variable: year Number of groups = 3
Panels: correlated (balanced) Obs per group:
Autocorrelation: no autocorrelation min = 2
avg = 2
max = 2
Estimated covariances = 6 R-squared = 0.2801
Estimated autocorrelations = 0 Wald chi2(3) = 29.28
Estimated coefficients = 4 Prob > chi2 = 0.0000
---------------------------------------------------------------------------------
| Panel-corrected
var1 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
----------------+----------------------------------------------------------------
var2 |
L1. | .3047307 .7251617 0.42 0.674 -1.11656 1.726022
|
var3 |
L1. | -2.842736 1.995148 -1.42 0.154 -6.753154 1.067682
|
cL.var2#cL.var3 | -.0384245 .0907775 -0.42 0.672 -.2163452 .1394962
|
_cons | 40.83134 12.87304 3.17 0.002 15.60066 66.06203
---------------------------------------------------------------------------------
接着 esttab using example.rtf, keep(cL.var2#cL.var3) replace
对我有用。
我有一个(也许)关于 Stata 中 estout 的简单问题:
我有一个面板数据集,想通过estout导出回归表,但只保留一些系数。我遇到的问题是我不明白如何参考 1) 滞后和 2) 相互作用的系数。对于每种情况,esttab 都可以正常工作,但是当我同时尝试这两种情况时,系数“未找到”(Stata 错误项)。
示例:
clear
ssc install estout
input float(code year var1 var2 var3)
1 2000 1 2 3
1 2001 45 5555 8
1 2002 3 3 3
2 2000 11 8 9
2 2001 2 1 12
2 2002 3 4 11111
3 2000 4 77 1
3 2001 3 99 3
3 2002 111 9 20
end
xtset code year
eststo: xtpcse var1 l.c.var2##l.c.var3
esttab using example.rtf, keep(l.c.var2#l.c.var3) replace
没有交互中的滞后变量,keep() 命令中的“c.var2#c.var3”工作正常。如果没有交互,keep() 命令中的“l.var2”也能正常工作。结合起来,我收到一个错误...
这个问题看起来很简单,但我就是想不通。
观察回归输出中出现的系数名称:
eststo: xtpcse var1 l.c.var2##l.c.var3
Linear regression, correlated panels corrected standard errors (PCSEs)
Group variable: code Number of obs = 6
Time variable: year Number of groups = 3
Panels: correlated (balanced) Obs per group:
Autocorrelation: no autocorrelation min = 2
avg = 2
max = 2
Estimated covariances = 6 R-squared = 0.2801
Estimated autocorrelations = 0 Wald chi2(3) = 29.28
Estimated coefficients = 4 Prob > chi2 = 0.0000
---------------------------------------------------------------------------------
| Panel-corrected
var1 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
----------------+----------------------------------------------------------------
var2 |
L1. | .3047307 .7251617 0.42 0.674 -1.11656 1.726022
|
var3 |
L1. | -2.842736 1.995148 -1.42 0.154 -6.753154 1.067682
|
cL.var2#cL.var3 | -.0384245 .0907775 -0.42 0.672 -.2163452 .1394962
|
_cons | 40.83134 12.87304 3.17 0.002 15.60066 66.06203
---------------------------------------------------------------------------------
接着 esttab using example.rtf, keep(cL.var2#cL.var3) replace
对我有用。