Announcement

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

  • #16
    Edib: It's easy to find the original Driscoll-Kraay article using a Google search. Here is one about the Stata command, which provides references and background.

    Hoechle

    And yes you can include interaction terms. Remember the difference between a model and an estimation method. Any estimation method that does not allow things like interactions is suspect. The xtscc command is just the usual fixed effects estimator but it computes standard errors valid for large T, small N.

    Comment


    • #17
      Apart from xtscc suggested by Jeff (which the latest version does support factor variables), you can implement Driscoll-Kraay standard errors using ivreghdfe from SSC. For this command, you specify a bandwidth instead of number of lags and it can handle multiple fixed effects.

      Code:
      webuse grunfeld, clear
      xtscc invest c.mvalue##c.kstock i.company,lag(3)
      ivreghdfe invest c.mvalue##c.kstock,absorb(company) dkraay(4)
      Res.:

      Code:
      . xtscc invest c.mvalue##c.kstock i.company,lag(3)
      
      Regression with Driscoll-Kraay standard errors   Number of obs     =       200
      Method: Pooled OLS                               Number of groups  =        10
      Group variable (i): company                      F( 12,    19)     =   2666.17
      maximum lag: 3                                   Prob > F          =    0.0000
                                                       R-squared         =    0.9624
                                                       Root MSE          =   43.3711
      
      -----------------------------------------------------------------------------------
                        |             Drisc/Kraay
                 invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      ------------------+----------------------------------------------------------------
                 mvalue |   .0698811   .0149061     4.69   0.000     .0386822    .1010799
                 kstock |    .071638   .0177299     4.04   0.001     .0345289     .108747
                        |
      c.mvalue#c.kstock |   .0000617   7.50e-06     8.22   0.000      .000046    .0000774
                        |
                company |
                     1  |          0  (empty)
                     2  |   144.3973   47.88201     3.02   0.007     44.17907    244.6155
                     3  |  -181.5888   29.03872    -6.25   0.000    -242.3675     -120.81
                     4  |  -47.43332   41.63246    -1.14   0.269    -134.5711    39.70442
                     5  |  -67.83132   40.62528    -1.67   0.111     -152.861    17.19836
                     6  |  -55.84243   41.86106    -1.33   0.198    -143.4586    31.77378
                     7  |  -59.26622   43.50259    -1.36   0.189    -150.3182    31.78574
                     8  |  -85.18981   38.07084    -2.24   0.037     -164.873    -5.50663
                     9  |  -80.07188   42.24912    -1.90   0.073    -168.5003    8.356551
                    10  |  -73.23958   45.72802    -1.60   0.126    -168.9494    22.47027
                        |
                  _cons |   70.91667   46.46336     1.53   0.143    -26.33226    168.1656
      -----------------------------------------------------------------------------------
      
      
      . ivreghdfe invest c.mvalue##c.kstock,absorb(company) dkraay(4)
      (MWFE estimator converged in 1 iterations)
      
      OLS estimation
      --------------
      
      Estimates efficient for homoskedasticity only
      Statistics robust to heteroskedasticity and clustering on year
      and kernel-robust to common correlated disturbances (Driscoll-Kraay)
        kernel=Bartlett; bandwidth=4
        time variable (t):  year
        group variable (i): company
      
      Number of clusters (year) =         20                Number of obs =      200
                                                            F(  3,    19) =   433.67
                                                            Prob > F      =   0.0000
      Total (centered) SS     =  2244352.228                Centered R2   =   0.8433
      Total (uncentered) SS   =  2244352.228                Uncentered R2 =   0.8433
      Residual SS             =  351756.5497                Root MSE      =    43.37
      
      -----------------------------------------------------------------------------------
                        |               Robust
                 invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      ------------------+----------------------------------------------------------------
                 mvalue |   .0698811   .0149061     4.69   0.000     .0386822    .1010799
                 kstock |    .071638   .0177299     4.04   0.001     .0345289     .108747
                        |
      c.mvalue#c.kstock |   .0000617   7.50e-06     8.22   0.000      .000046    .0000774
      -----------------------------------------------------------------------------------
      Included instruments: mvalue kstock c.mvalue#c.kstock
      Partialled-out:       _cons
                            nb: total SS, model F and R2s are after partialling-out;
                                any small-sample adjustments include partialled-out
                                variables in regressor count K
      ------------------------------------------------------------------------------
      
      Absorbed degrees of freedom:
      -----------------------------------------------------+
       Absorbed FE | Categories  - Redundant  = Num. Coefs |
      -------------+---------------------------------------|
           company |        10           0          10     |
      -----------------------------------------------------+
      
      .

      Comment


      • #18
        Thanks Andrew! I need to update my install of xtscc.

        Comment


        • #19
          Dear All,
          Thank you very much. I will do as instructed.

          Regards,

          Comment


          • #20
            Originally posted by Edib Smolo View Post

            Dear Prof. Wooldridge,
            Thank you very much for your kind response. I will explore this option as well. I tried previously suggested options, but I will explore this one suggested by you as well. Thank you very much. I would appreciate, however, if you could direct me to articles that use this method so that I can learn about it and explain it. Perhaps, you can share that paper of your with me. I would appreciate your help. I can also share my email with you if you are OK with that.

            Finally, I am not sure if I understood your correctly, can I use the interaction term or not? If I understood your correctly, I cannot use factor notation, but can I use the interaction term if I create if before estimation using -gen- command? I am interested to see the effect of FDI on economic growth first and then to see how institutions (interacting with FDI) are affecting this FDI-Growth nexus.

            Looking forward to hearing from you soon.

            Regards,

            Edib Smolo
            You can use factor notation.Here is the example
            Code:
            webuse grunfeld
            xtscc invest mvalue kstock c.mvalue#c.kstock i.year, lag(4)
            
            Regression with Driscoll-Kraay standard errors   Number of obs     =       200
            Method: Pooled OLS                               Number of groups  =        10
            Group variable (i): company                      F( 22,    19)     =      5.23
            maximum lag: 4                                   Prob > F          =    0.0003
                                                             R-squared         =    0.8522
                                                             Root MSE          =   88.4074
            
            -----------------------------------------------------------------------------------
                              |             Drisc/Kraay
                       invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            ------------------+----------------------------------------------------------------
                       mvalue |      0.094      0.011     8.46   0.000        0.071       0.117
                       kstock |      0.012      0.025     0.47   0.641       -0.041       0.065
                              |
            c.mvalue#c.kstock |      0.000      0.000     8.61   0.000        0.000       0.000
                              |
                         year |
                        1935  |      0.000  (empty)
                        1936  |     -8.503      3.751    -2.27   0.035      -16.354      -0.652
                        1937  |    -19.788      5.853    -3.38   0.003      -32.038      -7.538
                        1938  |    -16.966      1.499   -11.32   0.000      -20.102     -13.829
                        1939  |    -39.669      2.571   -15.43   0.000      -45.051     -34.287
                        1940  |    -12.294      3.015    -4.08   0.001      -18.604      -5.985
                        1941  |     16.536      2.643     6.26   0.000       11.005      22.068
                        1942  |     19.219      2.966     6.48   0.000       13.012      25.426
                        1943  |      2.215      2.948     0.75   0.462       -3.955       8.386
                        1944  |      3.864      2.985     1.29   0.211       -2.383      10.111
                        1945  |     -6.288      3.334    -1.89   0.075      -13.266       0.691
                        1946  |     20.153      3.571     5.64   0.000       12.678      27.628
                        1947  |     25.375      5.645     4.50   0.000       13.561      37.189
                        1948  |     31.331      6.975     4.49   0.000       16.731      45.930
                        1949  |      8.553      7.952     1.08   0.296       -8.091      25.196
                        1950  |     10.742      8.208     1.31   0.206       -6.439      27.922
                        1951  |     23.270      7.908     2.94   0.008        6.719      39.822
                        1952  |     30.947      9.540     3.24   0.004       10.980      50.914
                        1953  |     28.956     11.577     2.50   0.022        4.725      53.188
                        1954  |     16.770     14.439     1.16   0.260      -13.450      46.990
                              |
                        _cons |      3.877      7.004     0.55   0.586      -10.781      18.536
            -----------------------------------------------------------------------------------
            Best regards.

            Raymond Zhang
            Stata 17.0,MP

            Comment


            • #21
              Originally posted by Jeff Wooldridge View Post
              Edib: I'll add a few things. First, T = 20 is not "large T." Just because T > N doesn't mean methods that assume large T are appropriate. In fact, you have small N and small T. It's true that "large T" methods are more appropriate than "large N" methods, but you must exercise caution. Almost all panel data methods are justified by asymptotic approximations, and they are likely to be poor in your case if they are based on large T and absolutely terrible if based on large N.

              I would avoid in GLS method as those are justified only when one can trust asymptotics. Plus, it is not obvious you can include country and year fixed effects.

              I would still with two-way fixed effects. You cannot cluster with N = 5 but you can try the Driscoll-Kraay standard errors based on large T. You need to install the user-written command -xtscc-. I've used it with T around 25, and that's probably pushing it. In your case, I would use one lag, maybe two, in the Newey-West truncation.

              Generically, you have to create the time dummies and add them. I don't believe factor notation is supported.

              Code:
              xtset id
              xtscc y x1 ... xK d2 ... d20, fe lag(1)
              Dear Prof. Wooldridge,

              Could you please check your private message? Thanks a lot!

              Comment


              • #22
                Dear Edib Smolo

                I am facing the same situation as you.
                Have you found any papers backing up your use of xtscc for small N? I also read "Robust Standard Errors for Panel Regressions with Cross-Sectional Dependence", but I could not found any justifying really small N like 5.
                I just registered here because of this problem. Hope you can share your experience with me.
                Thank you.

                Best regards,
                Last edited by Sarah Lee; 24 May 2023, 18:36.

                Comment

                Working...
                X