Announcement

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

  • reghdfe with wild bootstrap

    Dear all,

    I am currently running estimations in a difference-in-differences setting along the lines of

    Code:
    reghdfe y i.a##i.b c d e, absorb(municipality) cluster(municipality)
    The coefficient estimate I am interested in is
    Code:
    1.a#1.b
    (DID estimator)

    Since the number of cluster (municipality) is around 40, sometimes less, I would like to estimate standard errors via wild bootstrapping.

    However, after going through various posts and articles, I am still having difficulties understanding how to properly to do so. Could one of you point me to the right direction?

    Thank you.
    Last edited by Clotilde Mahe; 24 Jan 2019, 07:36.

  • #2
    Hi Clotilde,

    Were you able to figure out this issue? I have a very similar situation that I am trying to figure out in either R or Stata.

    Thanks,
    Anshuman

    Comment


    • #3
      Just a clarification - the original post has one fixed effect. In that situation 'boottest' works well after reghdfe.

      But I have multiple fixed effects and boottest cannot handle that. This is the problem I am trying to figure out.

      Thanks again

      Comment


      • #4
        I am also trying to figure out how to bootstrap in a reghdfe regression (or similar alternative that allows for absorbing multiple fixed effects).

        Comment


        • #5
          Same here for the wild cluster restricted bootstrap of Roodman et al. (2018)

          Comment


          • #6
            If you are to hope to have an resolution of "the issue", you should try to explain what this issue is. For what I see the current version of the user written -boottest- can handle the current version of the -reghdfe-. Here:

            Code:
            . sysuse auto
            (1978 automobile data)
            
            . reg price mpg i.rep
            
                  Source |       SS           df       MS      Number of obs   =        69
            -------------+----------------------------------   F(5, 63)        =      4.39
                   Model |   149020603         5  29804120.7   Prob > F        =    0.0017
                Residual |   427776355        63  6790100.88   R-squared       =    0.2584
            -------------+----------------------------------   Adj R-squared   =    0.1995
                   Total |   576796959        68  8482308.22   Root MSE        =    2605.8
            
            ------------------------------------------------------------------------------
                   price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
            -------------+----------------------------------------------------------------
                     mpg |  -280.2615   61.57666    -4.55   0.000    -403.3126   -157.2103
                         |
                   rep78 |
                      2  |   877.6347   2063.285     0.43   0.672     -3245.51     5000.78
                      3  |   1425.657   1905.438     0.75   0.457    -2382.057    5233.371
                      4  |   1693.841   1942.669     0.87   0.387    -2188.274    5575.956
                      5  |   3131.982   2041.049     1.53   0.130    -946.7282    7210.693
                         |
                   _cons |   10449.99   2251.041     4.64   0.000     5951.646    14948.34
            ------------------------------------------------------------------------------
            
            . boottest mpg=0
            
            Wild bootstrap-t, null imposed, 999 replications, Wald test, Rademacher weights:
              mpg=0
            
                                       t(63) =    -4.5514
                                    Prob>|t| =     0.0000
            
            95% confidence set for null hypothesis expression: [−414.5, −168]
            
            . areg price mpg, absorb(rep)
            
            Linear regression, absorbing indicators          Number of obs     =        69
            Absorbed variable: rep78                         No. of categories =         5
                                                             F(1, 63)          =     20.72
                                                             Prob > F          =    0.0000
                                                             R-squared         =    0.2584
                                                             Adj R-squared     =    0.1995
                                                             Root MSE          = 2605.7822
            
            ------------------------------------------------------------------------------
                   price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
            -------------+----------------------------------------------------------------
                     mpg |  -280.2615   61.57666    -4.55   0.000    -403.3126   -157.2103
                   _cons |   12112.77   1347.968     8.99   0.000      9419.07    14806.47
            ------------------------------------------------------------------------------
            F test of absorbed indicators: F(4, 63) = 1.072               Prob > F = 0.378
            
            . boottest mpg=0
            
            Wild bootstrap-t, null imposed, 999 replications, Wald test, Rademacher weights:
              mpg=0
            
                                       t(63) =    -4.5514
                                    Prob>|t| =     0.0000
            
            95% confidence set for null hypothesis expression: [−414.5, −162.8]
            
            . reghdfe price mpg, absorb(rep)
            (MWFE estimator converged in 1 iterations)
            
            HDFE Linear regression                            Number of obs   =         69
            Absorbing 1 HDFE group                            F(   1,     63) =      20.72
                                                              Prob > F        =     0.0000
                                                              R-squared       =     0.2584
                                                              Adj R-squared   =     0.1995
                                                              Within R-sq.    =     0.2475
                                                              Root MSE        =  2605.7822
            
            ------------------------------------------------------------------------------
                   price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
            -------------+----------------------------------------------------------------
                     mpg |  -280.2615   61.57666    -4.55   0.000    -403.3126   -157.2103
                   _cons |   12112.77   1347.968     8.99   0.000      9419.07    14806.47
            ------------------------------------------------------------------------------
            
            Absorbed degrees of freedom:
            -----------------------------------------------------+
             Absorbed FE | Categories  - Redundant  = Num. Coefs |
            -------------+---------------------------------------|
                   rep78 |         5           0           5     |
            -----------------------------------------------------+
            
            . boottest mpg=0
            
            Wild bootstrap-t, null imposed, 999 replications, Wald test, Rademacher weights:
              mpg=0
            
                                       t(63) =    -4.5514
                                    Prob>|t| =     0.0000
            
            95% confidence set for null hypothesis expression: [−407.7, −163.3]
            
            . 

            Comment


            • #7
              Hi Joro,

              As Anshuman said, the problem only emerges when you have two fixed effects in reghdfe, not when you have only one. "The issue" is that this doesn't estimate, and returns the error "doesn't work."

              Code:
              . sysuse auto
              (1978 Automobile Data)
              
              . reghdfe price mpg, absorb(rep foreign)
              (MWFE estimator converged in 3 iterations)
              
              HDFE Linear regression                            Number of obs   =         69
              Absorbing 2 HDFE groups                           F(   1,     62) =      22.37
                                                                Prob > F        =     0.0000
                                                                R-squared       =     0.2758
                                                                Adj R-squared   =     0.2057
                                                                Within R-sq.    =     0.2651
                                                                Root MSE        =  2595.6201
              
              ------------------------------------------------------------------------------
                     price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       mpg |  -299.6068   63.34525    -4.73   0.000    -426.2322   -172.9815
                     _cons |   12524.63   1384.339     9.05   0.000     9757.376    15291.88
              ------------------------------------------------------------------------------
              
              Absorbed degrees of freedom:
              -----------------------------------------------------+
               Absorbed FE | Categories  - Redundant  = Num. Coefs |
              -------------+---------------------------------------|
                     rep78 |         5           0           5     |
                   foreign |         2           1           1     |
              -----------------------------------------------------+
              
              . boottest mpg
              Doesn't work after reghdfe with more than one set of absorbed fixed effects or with absorbed interaction terms.
              r(198);
              Mitch Downey, Grad student, UCSD Economics

              Comment

              Working...
              X