在第一差异回归中包括特定于小组的趋势

时间:2014-03-10 18:02:55

标签: stata

我想知道在面板ID和时间变量上进行聚类时,是否有一种方法可以在第一次差异回归中包含特定于面板或仅变化的趋势。

以下是Stata的一个例子:

. webuse nlswork
(National Longitudinal Survey.  Young Women 14-26 years of age in 1968)

. ivreg2 S1.(ln_wage tenure) , cluster(idcode year)

OLS estimation
--------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on idcode and year

Number of clusters (idcode) =     3660                Number of obs =    10528
Number of clusters (year) =          8                F(  1,     7) =     2.81
                                                      Prob > F      =   0.1378
Total (centered) SS     =  1004.098948                Centered R2   =   0.0007
Total (uncentered) SS   =  1035.845686                Uncentered R2 =   0.0314
Residual SS             =   1003.36326                Root MSE      =    .3087

------------------------------------------------------------------------------
             |               Robust
   S.ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      tenure |
         S1. |   .0076418   .0042666     1.79   0.073    -.0007206    .0160043
             |
       _cons |   .0501738   .0070986     7.07   0.000     .0362608    .0640868
------------------------------------------------------------------------------
Included instruments: S.tenure
------------------------------------------------------------------------------

. ivreg2 S1.(ln_wage tenure i.c_city), cluster(idcode year)
factor variables not allowed
r(101);

在上面的说明中,常数对应于共同的时间趋势。将因子变量置于季节性差异操作符错误之外。

据我所知,差分算子在因子变量或相互作用方面表现不佳,但我觉得必须有一些黑客才能解决这个问题。

ivreg2有点像红鲱鱼。我不是在进行IV估计,我只是想使用双向聚类。

1 个答案:

答案 0 :(得分:0)

如果您执行xi: ivreg2 S1.(ln_wage tenure) i.ind_code , cluster(idcode year)

,则会获得与@Metrics相同的解决方案