Question about FixedEffectModels?

Dear all,

When I use FixedEffectModels with Vcov.cluster, I get the different p values from the results of Stata.

julia> using DataFrames, RDatasets, FixedEffectModels

julia> df = dataset("plm", "GrunFeld");

julia> ols = reg(df, @formula(Inv ~ Value + Capital), Vcov.cluster(:Firm))
                             Linear Model
======================================================================
Number of obs:                 200  Degrees of freedom:              3
R2:                          0.812  R2 Adjusted:                 0.811
F-Stat:                    51.5906  p-value:                     0.000
======================================================================
Inv         | Estimate Std.Error  t value Pr(>|t|) Lower 95% Upper 95%
----------------------------------------------------------------------
Value       | 0.115562 0.0158943  7.27065    0.000 0.0842173  0.146907
Capital     | 0.230678 0.0849671  2.71492    0.007 0.0631166   0.39824
(Intercept) | -42.7144   20.4252 -2.09126    0.038  -82.9945  -2.43425
======================================================================

In Stata, the result is

. webuse grunfeld,clear

. reg invest mvalue kstock, cl(company)

Linear regression                               Number of obs     =        200
                                                F(2, 9)           =      51.59
                                                Prob > F          =     0.0000
                                                R-squared         =     0.8124
                                                Root MSE          =     94.408

                               (Std. err. adjusted for 10 clusters in company)
------------------------------------------------------------------------------
             |               Robust
      invest | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
      mvalue |     0.1156     0.0159     7.27   0.000       0.0796      0.1515
      kstock |     0.2307     0.0850     2.71   0.024       0.0385      0.4229
       _cons |   -42.7144    20.4252    -2.09   0.066     -88.9194      3.4906
------------------------------------------------------------------------------


Why I get the different p values?

I find that the coefficient, standard error and t value are all the same, only P values are different.

In Julia, the degrees of freedom is 3, but in Stata, the degrees of freedom is 2.

This seems like a problem, please file an issue with FixedEffectModels. Here is the same code with reghdfe

reghdfe invest mvalue kstock, vce(cluster company) noabsorb
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =        200
Absorbing 1 HDFE group                            F(   2,      9) =      51.59
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.8124
                                                  Adj R-squared   =     0.8105
                                                  Within R-sq.    =     0.8124
Number of clusters (company) =         10         Root MSE        =    94.4084

                               (Std. err. adjusted for 10 clusters in company)
------------------------------------------------------------------------------
             |               Robust
      invest | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
      mvalue |   .1155622   .0158943     7.27   0.000     .0796067    .1515176
      kstock |   .2306785   .0849671     2.71   0.024     .0384695    .4228874
       _cons |  -42.71437    20.4252    -2.09   0.066    -88.91939    3.490649
------------------------------------------------------------------------------

The results of reghdfe are also different from Julia.

yes I was hoping they would be the same. But they are not.

I have filed an issue on github. Matthieu Gomez has solved the problem and replied to me. But I don’t know what he means.

So can I update FixedEffectModels to solve the problem?