Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fixed effect and clustering SE

    Let's say I have data where respondents are clustered within neighborhoods. If I were to run this linear model:

    Code:
    reg y x1 x2 i.nhood, vce(robust)
    And then this model:

    Code:
    reg y x1 x2 i.nhood, vce(cluster nhood)
    Would they give me different answers, and would one be preferable over the other?

  • #2
    Dakota:
    while the sample estimates of the coefficients are the same, the first code takes heteroskedsticity of the epsilon (residual) distribution only into accont, whereas the second to the same with serial correlation of the epsilon.
    Code:
    . use "C:\Program Files\Stata18\ado\base\a\auto.dta"
    (1978 automobile data)
    
    . regress price mpg i.foreign, vce(robust)
    
    Linear regression                               Number of obs     =         74
                                                    F(2, 71)          =      12.72
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.2838
                                                    Root MSE          =     2530.9
    
    ------------------------------------------------------------------------------
                 |               Robust
           price | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             mpg |  -294.1955   60.33645    -4.88   0.000     -414.503   -173.8881
                 |
         foreign |
        Foreign  |   1767.292   607.7385     2.91   0.005     555.4961    2979.088
           _cons |   11905.42   1362.547     8.74   0.000     9188.573    14622.26
    ------------------------------------------------------------------------------
    
    
    . regress price mpg i.foreign, vce(cluster foreign)
    
    Linear regression                               Number of obs     =         74
                                                    F(0, 1)           =          .
                                                    Prob > F          =          .
                                                    R-squared         =     0.2838
                                                    Root MSE          =     2530.9
    
                                    (Std. err. adjusted for 2 clusters in foreign)
    ------------------------------------------------------------------------------
                 |               Robust
           price | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             mpg |  -294.1955   39.50161    -7.45   0.085    -796.1111    207.7201
                 |
         foreign |
        Foreign  |   1767.292   195.3672     9.05   0.070     -715.084    4249.668
           _cons |   11905.42   783.1955    15.20   0.042     1953.973    21856.86
    ------------------------------------------------------------------------------
    
    .
    Thas said, a cautionary tale about clustered standard errors is necessary: Cameron_Miller_Cluster_Robust_October152013.pdf (ucdavis.edu)
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment

    Working...
    X