Announcement

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

  • Why re-estimate for robust and cluster robust standard errors?



    I have a long time curiosity about why Stata does something. OLS and MLE have usually what are robust and cluster robust standard errors. These variance estimators, however, always are evaluated at the parameters estimates, meaning that the estimates of the parameters don't depend on the variance estimator, and thus are always the same. However, to get different variance estimates you have to re-estimate the model, and not simply replay the results with a difference vce(). Why?????

    For models where estimation is fast this is fine, but when you get into models where estimation takes a long time, like a mixed Logit for example, this is a huge huge huge cost. I never understood this to be honest.
    Alfonso Sanchez-Penalver

  • #2
    Alfonso: Are you saying that if I type something like

    Code:
    probit y x1 x2 ... xi, vce(cluster id)
    that Stata computes the probit estimates twice? I'd be very surprised by that. What makes you think so? I think it's doing pooled probit one time and then computing the standard variance matrix estimator using a closed form expression.

    I'm probably not understanding your claim.

    Comment


    • #3
      I think Alfonso wants to be able to

      Code:
      probit y x1 x2 [i]...[i] xi
      and follow that with

      Code:
      probit , vce(cluster id)
      That is, Alfonso wants to be able to get different standard errors without the need to re-estimate the model.


      Edit: It might not be known that all of Stata's estimation commands can be typed without a variable list to re-display previous results, optionally changing the display format and some other stuff.
      Last edited by daniel klein; 22 Sep 2020, 02:04.

      Comment


      • #4
        Thanks Daniel. I was being dense. You can tell I rarely do computationally demanding problems where doing the estimation a second time is a burden.

        Alfonso is correct: Stata should allow obtaining robust standard errors without reestimating the parameters.

        Comment


        • #5


          Yes daniel klein interpreted what I meant correctly. Even for the bootstrap variance, you save having to re-estimate the model with the original sample.
          Alfonso Sanchez-Penalver

          Comment


          • #6
            Alfonso might want to put this as a request on Wishlist for Stata 17. I do not see why this should not be working:

            Code:
            . sysuse auto, clear
            (1978 Automobile Data)
            
            . regress price mpg head, noheader
            ------------------------------------------------------------------------------
                   price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                     mpg |  -259.1057   58.42485    -4.43   0.000    -375.6015   -142.6098
                headroom |  -334.0215   399.5499    -0.84   0.406    -1130.701    462.6585
                   _cons |   12683.31   2074.497     6.11   0.000     8546.885    16819.74
            ------------------------------------------------------------------------------
            
            . regress, vce(robust)
            option vce() not allowed
            r(198);
            There is one tool that does what Alfonso wants, but it is very painful to use. If the time to recalculate the estimator is prohibitive, one might go for [P] _robust -- Robust variance estimates.

            Comment


            • #7
              I think this could be a nice addition to most estimation commands, something like a post estimation command:
              Code:
              sysuse auto, clear
              regress price mpg head
              estat vcov, robust
              so that it can adjust standard errors, and replay the model. I should remember that in the next session of "wishes and grumbles" with Stata

              Fernando

              Comment


              • #8
                FernandoRios that would be good if you just want to display them. When replaying the command with the vce() option as I suggested, you have to repost the variance to use either ereturn display or ml display, depending on which estimator they are using. This gives us the option to save the estimates in two different files, one with "regular" standard errors, and another with "robust" standard errors. Of course, if there is no longer the cost of having to re-estimate the model, then saving just one set of estimates and being able to display the other types of vces is fine.
                Alfonso Sanchez-Penalver

                Comment


                • #9
                  If it helps, suest already does this. You can pass your estimation results through suest to calculate the robust standard errors without re-estimating the model.

                  Code:
                  sysuse auto, clear
                  estimates clear
                  probit foreign weight trunk length turn
                  est sto model1
                  suest model1
                  probit foreign weight trunk length turn, robust
                  Res.:

                  Code:
                  . probit foreign weight trunk length turn
                  
                  Iteration 0:   log likelihood =  -45.03321  
                  Iteration 1:   log likelihood =   -26.3163  
                  Iteration 2:   log likelihood = -24.955158  
                  Iteration 3:   log likelihood = -24.919317  
                  Iteration 4:   log likelihood =  -24.91921  
                  Iteration 5:   log likelihood =  -24.91921  
                  
                  Probit regression                               Number of obs     =         74
                                                                  LR chi2(4)        =      40.23
                                                                  Prob > chi2       =     0.0000
                  Log likelihood =  -24.91921                     Pseudo R2         =     0.4466
                  
                  ------------------------------------------------------------------------------
                       foreign |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                        weight |  -.0013266   .0010179    -1.30   0.193    -.0033217    .0006685
                         trunk |   .0134306   .0657048     0.20   0.838    -.1153485    .1422097
                        length |   .0272321   .0347685     0.78   0.433     -.040913    .0953771
                          turn |  -.2467238   .0915113    -2.70   0.007    -.4260826   -.0673649
                         _cons |   7.393891    3.86039     1.92   0.055    -.1723351    14.96012
                  ------------------------------------------------------------------------------
                  
                  . 
                  . est sto model1
                  
                  . 
                  . suest model1
                  
                  Robust results for model1
                  
                                                                  Number of obs     =         74
                  
                  ------------------------------------------------------------------------------
                               |               Robust
                               |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                  foreign      |
                        weight |  -.0013266   .0009039    -1.47   0.142    -.0030981     .000445
                         trunk |   .0134306   .0582271     0.23   0.818    -.1006924    .1275537
                        length |   .0272321   .0296575     0.92   0.359    -.0308956    .0853597
                          turn |  -.2467238   .1142191    -2.16   0.031     -.470589   -.0228585
                         _cons |   7.393891   3.382927     2.19   0.029     .7634751    14.02431
                  ------------------------------------------------------------------------------
                  
                  . 
                  . probit foreign weight trunk length turn, robust
                  
                  Iteration 0:   log pseudolikelihood =  -45.03321  
                  Iteration 1:   log pseudolikelihood =   -26.3163  
                  Iteration 2:   log pseudolikelihood = -24.955158  
                  Iteration 3:   log pseudolikelihood = -24.919317  
                  Iteration 4:   log pseudolikelihood =  -24.91921  
                  Iteration 5:   log pseudolikelihood =  -24.91921  
                  
                  Probit regression                               Number of obs     =         74
                                                                  Wald chi2(4)      =      32.50
                                                                  Prob > chi2       =     0.0000
                  Log pseudolikelihood =  -24.91921               Pseudo R2         =     0.4466
                  
                  ------------------------------------------------------------------------------
                               |               Robust
                       foreign |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                        weight |  -.0013266   .0009039    -1.47   0.142    -.0030981     .000445
                         trunk |   .0134306   .0582271     0.23   0.818    -.1006924    .1275537
                        length |   .0272321   .0296575     0.92   0.359    -.0308956    .0853597
                          turn |  -.2467238   .1142191    -2.16   0.031     -.470589   -.0228585
                         _cons |   7.393891   3.382927     2.19   0.029     .7634751    14.02431
                  ------------------------------------------------------------------------------

                  Comment


                  • #10
                    THank you Andrew,
                    I had no idea of this "trick".
                    This should definitely go as part of Tips "tuesdays"

                    Comment


                    • #11


                      Thanks Andrew Musau this is useful, and really unexpected.
                      Alfonso Sanchez-Penalver

                      Comment

                      Working...
                      X