Announcement

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

  • HC2 HC3 standard errors with clusters

    Dear all
    I have one question regarding robust standard errors with the command regress.
    Does it make sense to combine HC2 or HC3 robust standard errors with clusters? I know it is possible to request them with regress using the old syntax
    Code:
    webuse dui, clear
    gen clt=ceil(runiform()*10)
    regress citations fines i.taxes i.csize i.college , hc3 cluster(cit)
    But with the more up-to-date syntax, requesting HC3 clustered standard errors does not seem possible.
    Code:
    ** Something like this does not work
    regress citations fines i.taxes i.csize i.college , vce(cluster clt, hc3)
    Thank you in advance
    Fernando



  • #2
    Dear Subscribers,

    Does anyone have an answer to Fernando's question? I have the same question.

    Thanks, John Ham

    Comment


    • #3
      Hi John
      this was a question I asked when I was working on a particular command, and new far less about standard errors
      short answer
      in Stata 18 doing this is possible it’s one of the few features
      with earlier versions you need to program it. And is not that easy.
      there is a recent paper on how to obtain standard errors with clusters (don’t have the reference on hand right now) that tells you how to do it
      hth

      Comment


      • #4
        Fernando and John (welcome to this forum, John):
        while Fernando's second code gives back:
        Code:
        option hc3 not allowed
        r(198);
        I notice that, with or without -hc3-, the results of the first regression do not change:
        Code:
        . webuse dui, clear
        (Fictional data on monthly drunk driving citations)
        
        . 
        . gen clt=ceil(runiform()*10)
        
        . 
        . regress citations fines i.taxes i.csize i.college , hc3 cluster(cit)
        
        Linear regression                               Number of obs     =        500
                                                        F(5, 50)          =      62.82
                                                        Prob > F          =     0.0000
                                                        R-squared         =     0.7183
                                                        Root MSE          =     5.2293
        
                                     (Std. err. adjusted for 51 clusters in citations)
        ------------------------------------------------------------------------------
                     |               Robust
           citations | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
               fines |  -7.690437   .5098768   -15.08   0.000    -8.714555   -6.666319
                     |
               taxes |
                Tax  |  -4.493918    .584169    -7.69   0.000    -5.667255    -3.32058
                     |
               csize |
             Medium  |   5.492308   .5543663     9.91   0.000      4.37883    6.605785
              Large  |   11.23563   .7562745    14.86   0.000      9.71661    12.75465
                     |
             college |
            College  |   5.828441   .6550647     8.90   0.000     4.512704    7.144177
               _cons |   94.21955     5.2879    17.82   0.000     83.59849    104.8406
        ------------------------------------------------------------------------------
        
        . regress citations fines i.taxes i.csize i.college , cluster(cit)
        
        Linear regression                               Number of obs     =        500
                                                        F(5, 50)          =      62.82
                                                        Prob > F          =     0.0000
                                                        R-squared         =     0.7183
                                                        Root MSE          =     5.2293
        
                                     (Std. err. adjusted for 51 clusters in citations)
        ------------------------------------------------------------------------------
                     |               Robust
           citations | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
               fines |  -7.690437   .5098768   -15.08   0.000    -8.714555   -6.666319
                     |
               taxes |
                Tax  |  -4.493918    .584169    -7.69   0.000    -5.667255    -3.32058
                     |
               csize |
             Medium  |   5.492308   .5543663     9.91   0.000      4.37883    6.605785
              Large  |   11.23563   .7562745    14.86   0.000      9.71661    12.75465
                     |
             college |
            College  |   5.828441   .6550647     8.90   0.000     4.512704    7.144177
               _cons |   94.21955     5.2879    17.82   0.000     83.59849    104.8406
        ------------------------------------------------------------------------------
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Originally posted by John Ham View Post
          Does anyone have an answer to Fernando's question? I have the same question.
          Have you seen this thread? In particular, take a look at Enrique Pinzon's post there, and see whether it helps.

          Comment

          Working...
          X