为解决面板数据residuals不独立的问题,我想要使用two way clustering计算回归系数的标准差,但同时使用固定效应模型进行回归。xtreg命令只允许一维clustering,请问大家有什么命令可以实现固定效应模型下的二维clustering吗?另外,我考虑过直接在OLS中加入firm dummies,但是由于有大约5000家公司,stata不允许加入这么多的虚拟变量。
下面伍德里奇的解释:“The problem also arises if you try to obtain standard errors of the cross section fixed effects when clustering at the cross section level. In effect, you are trying to compute a standard error for a sample average without putting any restrictions on the time series correlation. As time series people will tell you, this is impossible. Regrettably, this discussion did not make it into the second edition of my MIT Press book, "Econometric Analysis of Cross Section and Panel Data." It is in the slides that I use for the course. The two-way clustering is doing the same thing, and also trying to obtain a standard error for the time effects by allowing any correlation in the cross section dimension. The only reason you get numbers at all is because of the other covariates in the equation.
For a simple demonstration of the problem, use the command
reg srisk i.date, cluster(date)
and you will see standard errors essentially zero.
The only mystery is why the standard error on biz is not reported. You could try deviating the data from the cross sectional averages for each time period so that time effects are no longer needed in the cluster2 command. I'm not terribly optimistic, though. I suspect there is some special feature of the variation in biz that is causing the problem. JW”