Announcement

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

  • All standard errors missing

    Hi everyone,

    I am using the following specification:
    Code:
     reghdfe     y_hat female_cw i.age  if random==0, absorb(kontor_handel#i.year) vce(cluster sign)
    but when Stata shows me the table, there are no standard errors and hence no p-values.

    Could someone please explain to me why is that?
    kontor_handel#i.year is office by year fixed effects.
    Last edited by Neg Kha; 20 Nov 2022, 04:52.

  • #2
    I doubt that anyone can explain this except in broad terms. You don't explain the structure of your data, or show an example, or show any output from the command. But odds are that you fitted a model that has no degrees of freedom left to allow such diagnostics to be calculated.

    The name y_hat could well mean that you are supplying the model prediction from some previous model as the outcome for this one, so that the variation of the data around that is not visible for this command to assess.

    Comment


    • #3
      Perhaps similar to what #2 is suggesting, my first instinct is that your dependent variable y_hat is probably an exact linear combination of at least some of the variables in your current model (perhaps the prediction from a model where the regressors were female_cw and/or i.age), so that there are no non-zero residuals in your current regression.

      Consider, for instance:
      Code:
      clear
      set obs 1000
      
      set seed 12345
      
      gen x1 = runiform()
      gen x2 = runiform()
      gen x3 = runiform()
      
      gen y = 5*x1 - 2*x2
      
      regress y x1 x2 x3
      which gives:
      Code:
            Source |       SS           df       MS      Number of obs   =     1,000
      -------------+----------------------------------   F(3, 996)       =         .
             Model |  2353.70294         3  784.567646   Prob > F        =         .
          Residual |           0       996           0   R-squared       =    1.0000
      -------------+----------------------------------   Adj R-squared   =    1.0000
             Total |  2353.70294       999    2.356059   Root MSE        =         0
      
      ------------------------------------------------------------------------------
                 y | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
                x1 |          5          .        .       .            .           .
                x2 |         -2          .        .       .            .           .
                x3 |   1.37e-09          .        .       .            .           .
             _cons |  -1.63e-09          .        .       .            .           .
      ------------------------------------------------------------------------------
      or take this example:
      Code:
      clear
      set obs 1000
      
      set seed 12345
      
      gen x1 = runiform()
      gen x2 = runiform()
      gen x3 = runiform()
      gen u = runiform()
      gen y = 5*x1 - 2*x2 + u
      
      qui regress y x1 x2
      predict y_hat
      
      regress y_hat x1 x2 x3
      which produces:
      Code:
      . regress y_hat x1 x2 x3
      
            Source |       SS           df       MS      Number of obs   =     1,000
      -------------+----------------------------------   F(3, 996)       =         .
             Model |   2389.7036         3  796.567867   Prob > F        =         .
          Residual |           0       996           0   R-squared       =    1.0000
      -------------+----------------------------------   Adj R-squared   =    1.0000
             Total |   2389.7036       999   2.3920957   Root MSE        =         0
      
      ------------------------------------------------------------------------------
             y_hat | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
                x1 |    5.04563          .        .       .            .           .
                x2 |   -1.99396          .        .       .            .           .
                x3 |   7.30e-09          .        .       .            .           .
             _cons |   .4729168          .        .       .            .           .
      ------------------------------------------------------------------------------
      Last edited by Hemanshu Kumar; 20 Nov 2022, 05:45.

      Comment

      Working...
      X