Announcement

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

  • -ivreghdfe- and -ivreg2- outputs different (after using dof and small options)

    Would anyone know why I don't get exact standard errors when running -ivreg2- command with -, small- option & -ivreghdfe- command with -, dof(none)- option? According to the link below, the output of -ivreghdfe- and -ivreg2- should coincide when using these options.
    https://github.com/sergiocorreia/ivreghdfe/issues/16

    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . ivreg2 price (weight=length) i.turn headroom, cluster(turn) small
    
    IV (2SLS) estimation
    --------------------
    
    Estimates efficient for homoskedasticity only
    Statistics robust to heteroskedasticity and clustering on turn
    
    Number of clusters (turn) =         18                Number of obs =       74
                                                          F( 19,    17) =     4.62
                                                          Prob > F      =   0.0013
    Total (centered) SS     =  635065396.1                Centered R2   =   0.6202
    Total (uncentered) SS   =   3447834321                Uncentered R2 =   0.9300
    Residual SS             =  241186914.4                Root MSE      =     2113
    
    ------------------------------------------------------------------------------
                 |               Robust
           price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          weight |   4.509739   .8817875     5.11   0.000      2.64933    6.370148
                 |
            turn |
             32  |    4877.48    1054.52     4.63   0.000     2652.637    7102.323
             33  |   5213.019   1126.867     4.63   0.000     2835.538    7590.499
             34  |   5087.309   906.7419     5.61   0.000     3174.251    7000.367
             35  |   4214.549   849.7413     4.96   0.000     2421.752    6007.347
             36  |   5181.819   850.9116     6.09   0.000     3386.553    6977.085
             37  |   4764.247   447.3317    10.65   0.000      3820.46    5708.034
             38  |   5682.881    377.091    15.07   0.000     4887.289    6478.474
             39  |   1884.571    525.563     3.59   0.002       775.73    2993.412
             40  |   354.0945   211.4594     1.67   0.112    -92.04575    800.2347
             41  |   1614.824   315.6847     5.12   0.000     948.7876     2280.86
             42  |  -875.8628    297.734    -2.94   0.009    -1504.027    -247.699
             43  |    661.132    351.431     1.88   0.077    -80.32257    1402.587
             44  |   128.3899   546.5868     0.23   0.817    -1024.807    1281.587
             45  |   1254.095   716.2294     1.75   0.098    -257.0171    2765.207
             46  |  -1000.848   430.9085    -2.32   0.033    -1909.986   -91.71103
             48  |  -620.5562   1108.191    -0.56   0.583    -2958.635    1717.523
             51  |  -493.1664   1463.767    -0.34   0.740    -3581.445    2595.113
                 |
        headroom |  -292.5445   330.1702    -0.89   0.388    -989.1427    404.0537
           _cons |  -8813.063   2837.232    -3.11   0.006     -14799.1   -2827.027
    ------------------------------------------------------------------------------
    Underidentification test (Kleibergen-Paap rk LM statistic):              6.323
                                                       Chi-sq(1) P-val =    0.0119
    ------------------------------------------------------------------------------
    Weak identification test (Cragg-Donald Wald F statistic):               56.021
                             (Kleibergen-Paap rk Wald F statistic):         53.560
    Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                             15% maximal IV size              8.96
                                             20% maximal IV size              6.66
                                             25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
    ------------------------------------------------------------------------------
    Warning: estimated covariance matrix of moment conditions not of full rank.
             overidentification statistic not reported, and standard errors and
             model tests should be interpreted with caution.
    Possible causes:
             number of clusters insufficient to calculate robust covariance matrix
             singleton dummy variable (dummy with one 1 and N-1 0s or vice versa)
    partial option may address problem.
    ------------------------------------------------------------------------------
    Instrumented:         weight
    Included instruments: 32.turn 33.turn 34.turn 35.turn 36.turn 37.turn 38.turn
                          39.turn 40.turn 41.turn 42.turn 43.turn 44.turn 45.turn
                          46.turn 48.turn 51.turn headroom
    Excluded instruments: length
    ------------------------------------------------------------------------------
    
    . ivreghdfe price (weight=length) headroom, absorb(turn) cluster(turn) dof(none) 
    (dropped 4 singleton observations)
    (MWFE estimator converged in 1 iterations)
    
    IV (2SLS) estimation
    --------------------
    
    Estimates efficient for homoskedasticity only
    Statistics robust to heteroskedasticity and clustering on turn
    
    Number of clusters (turn) =         14                Number of obs =       70
                                                          F(  2,    13) =    13.60
                                                          Prob > F      =   0.0006
    Total (centered) SS     =  436283540.4                Centered R2   =   0.4472
    Total (uncentered) SS   =  436283540.4                Uncentered R2 =   0.4472
    Residual SS             =  241186914.4                Root MSE      =     2113
    
    ------------------------------------------------------------------------------
                 |               Robust
           price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          weight |   4.509739   .8645848     5.22   0.000     2.641917    6.377561
        headroom |  -292.5445   323.7289    -0.90   0.383    -991.9184    406.8293
    ------------------------------------------------------------------------------
    Underidentification test (Kleibergen-Paap rk LM statistic):              6.323
                                                       Chi-sq(1) P-val =    0.0119
    ------------------------------------------------------------------------------
    Weak identification test (Cragg-Donald Wald F statistic):               56.021
                             (Kleibergen-Paap rk Wald F statistic):         55.712
    Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                             15% maximal IV size              8.96
                                             20% maximal IV size              6.66
                                             25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
    ------------------------------------------------------------------------------
    Hansen J statistic (overidentification test of all instruments):         0.000
                                                     (equation exactly identified)
    ------------------------------------------------------------------------------
    Instrumented:         weight
    Included instruments: headroom
    Excluded instruments: length
    Partialled-out:       _cons
                          nb: total SS, model F and R2s are after partialling-out;
                              any small-sample adjustments include partialled-out
                              variables in regressor count K
    ------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
            turn |        14           0          14     |
    -----------------------------------------------------+

  • #2
    Given that your Room Mean Squared Errors and Sum of Squared Residuals are the same across the two regressions, the difference has to come from degrees of freedom adjustment.

    In general the option -small- does make degrees of freedom adjustments in native Stata commands. The option -dof(none)- suggests that it does not make such adjustments.

    If it is of any help, here the results where I know what the option -small- does

    Code:
    . sysuse auto, clear
    (1978 automobile data)
    
    . ivregress 2sls price (weight=length) i.turn headroom, cluster(turn) small
    
    Instrumental variables 2SLS regression            Number of obs   =         74
                                                      F( 19,    17)   =      43.87
                                                      Prob > F        =     0.0000
                                                      R-squared       =     0.6202
                                                      Adj R-squared   =     0.4866
                                                      Root MSE        =     2113.4
    
                                      (Std. err. adjusted for 18 clusters in turn)
    ------------------------------------------------------------------------------
                 |               Robust
           price | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          weight |   4.509739   .8817875     5.11   0.000      2.64933    6.370148
                 |
            turn |
             32  |    4877.48    1054.52     4.63   0.000     2652.637    7102.323
             33  |   5213.019   1126.867     4.63   0.000     2835.538    7590.499
             34  |   5087.309   906.7419     5.61   0.000     3174.251    7000.367
             35  |   4214.549   849.7413     4.96   0.000     2421.752    6007.347
             36  |   5181.819   850.9116     6.09   0.000     3386.553    6977.085
             37  |   4764.247   447.3317    10.65   0.000      3820.46    5708.034
             38  |   5682.881    377.091    15.07   0.000     4887.289    6478.474
             39  |   1884.571    525.563     3.59   0.002       775.73    2993.412
             40  |   354.0945   211.4594     1.67   0.112    -92.04575    800.2347
             41  |   1614.824   315.6847     5.12   0.000     948.7876     2280.86
             42  |  -875.8628    297.734    -2.94   0.009    -1504.027    -247.699
             43  |    661.132    351.431     1.88   0.077    -80.32257    1402.587
             44  |   128.3899   546.5868     0.23   0.817    -1024.807    1281.587
             45  |   1254.095   716.2294     1.75   0.098    -257.0171    2765.207
             46  |  -1000.848   430.9085    -2.32   0.033    -1909.986   -91.71103
             48  |  -620.5562   1108.191    -0.56   0.583    -2958.635    1717.523
             51  |  -493.1664   1463.767    -0.34   0.740    -3581.445    2595.113
                 |
        headroom |  -292.5445   330.1702    -0.89   0.388    -989.1427    404.0537
           _cons |  -8813.063   2837.232    -3.11   0.006     -14799.1   -2827.027
    ------------------------------------------------------------------------------
    Instrumented: weight
     Instruments: 32.turn 33.turn 34.turn 35.turn 36.turn 37.turn 38.turn
                  39.turn 40.turn 41.turn 42.turn 43.turn 44.turn 45.turn
                  46.turn 48.turn 51.turn headroom length

    Comment


    • #3
      One more comment is that when we are dealing with (cluster) robust variances, there are two possible small sample adjustments, and it is hard to figure out from the help file what they mean because they treat the two as one and the same.

      1. The factor by which we multiply the (cluster) robust variance, I think Stata uses G/(G-1) where G is the number of clusters.

      2. The distribution that we use to calculate probabilities, t vs z, and the degrees of freedom in the t distribution if we use the t distribution.

      Overall there is a zoo of small sample adjustments in Stata, and is hard to know which is used when.

      Comment

      Working...
      X