Announcement

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

  • Regression discontinuity with fixed effects

    Hi,

    I am attempting to run a regression discontinuity analysis, including time and state fixed effects. I have been using the rdrobust command, where you can add covariates, but I am worried this does not constitute a fixed effects (acts just as a control variable).

    Does anyone know how I could incorporate specific fixed effects into this command? Or is there an alternative command that could be more useful?

    Many thanks!

  • #2
    you can use indicator variables as fixed effects,
    Code:
    use rdrobust_senate, clear
    
    tab class, gen(class)
    
    rdrobust vote margin, p(1) kernel(uniform) h(100) covs(class1 class2 class3)
    
    Covariate-adjusted sharp RD estimates using local polynomial regression.
    
          Cutoff c = 0 | Left of c  Right of c            Number of obs =       1297
    -------------------+----------------------            BW type       =     Manual
         Number of obs |       595         702            Kernel        =    Uniform
    Eff. Number of obs |       595         702            VCE method    =         NN
        Order est. (p) |         1           1
        Order bias (q) |         2           2
           BW est. (h) |   100.000     100.000
           BW bias (b) |   100.000     100.000
             rho (h/b) |     1.000       1.000
    
    Outcome: vote. Running variable: margin.
    --------------------------------------------------------------------------------
                Method |   Coef.    Std. Err.    z     P>|z|    [95% Conf. Interval]
    -------------------+------------------------------------------------------------
          Conventional |  6.0701     .87313   6.9521   0.000     4.3588      7.78141
                Robust |     -          -     4.3311   0.000     2.6902      7.13767
    --------------------------------------------------------------------------------
    Covariate-adjusted estimates. Additional covariates included: 2
    Variables dropped due to multicollinearity.
    
    gen d = margin > 0
    reg vote 1.d##c.margin class1 class2 class3
    
    note: class3 omitted because of collinearity.
    
          Source |       SS           df       MS      Number of obs   =     1,297
    -------------+----------------------------------   F(5, 1291)      =    369.35
           Model |  250506.214         5  50101.2428   Prob > F        =    0.0000
        Residual |  175118.237     1,291   135.64542   R-squared       =    0.5886
    -------------+----------------------------------   Adj R-squared   =    0.5870
           Total |  425624.452     1,296  328.413929   Root MSE        =    11.647
    
    ------------------------------------------------------------------------------
            vote | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             1.d |   6.070107   .9432802     6.44   0.000     4.219577    7.920637
          margin |   .2186884   .0277505     7.88   0.000     .1642474    .2731294
                 |
      d#c.margin |
              1  |   .1673234   .0316381     5.29   0.000     .1052557     .229391
                 |
          class1 |   1.077449   .7858645     1.37   0.171    -.4642627     2.61916
          class2 |   1.449798   .7941175     1.83   0.068    -.1081044      3.0077
          class3 |          0  (omitted)
           _cons |   44.10144   .8221482    53.64   0.000     42.48855    45.71434
    ------------------------------------------------------------------------------
    
    xtreg vote 1.d##c.margin ,fe i(class)
    
    Fixed-effects (within) regression               Number of obs     =      1,297
    Group variable: class                           Number of groups  =          3
    
    R-squared:                                      Obs per group:
         Within  = 0.5884                                         min =        416
         Between = 0.7533                                         avg =      432.3
         Overall = 0.5874                                         max =        453
    
                                                    F(3,1291)         =     615.30
    corr(u_i, Xb) = -0.0236                         Prob > F          =     0.0000
    
    ------------------------------------------------------------------------------
            vote | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             1.d |   6.070107   .9432802     6.44   0.000     4.219577    7.920637
          margin |   .2186884   .0277505     7.88   0.000     .1642474    .2731294
                 |
      d#c.margin |
              1  |   .1673234   .0316381     5.29   0.000     .1052557     .229391
                 |
           _cons |     44.922   .6988279    64.28   0.000     43.55104    46.29297
    -------------+----------------------------------------------------------------
         sigma_u |  .75293355
         sigma_e |  11.646691
             rho |  .00416195   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(2, 1291) = 1.83                     Prob > F = 0.1612

    Comment


    • #3
      Hi there @Øyvind Snilsberg,

      Thank you so much for your help! Can I just confirm which coefficient would apply for the discontinuity? Would it be the margin coefficient (0.218) or the d#c.margin1 (0.16732)?

      Many thanks!

      Comment


      • #4
        the RD estimate is the coefficient on d (6.07)

        Comment


        • #5
          Originally posted by Øyvind Snilsberg View Post
          the RD estimate is the coefficient on d (6.07)
          Hi Øyvind Snilsberg,
          I am wondering how to get the mean value of the outcome using rdrobust command (from SSC), which is the mean of vote in your code in #2. I don't see e(sample) is stored after running rdrobust, so I would appreciate if you have any idea to get what I am looking for.

          Thanks.

          Comment


          • #6
            Code:
            sum vote if inrange(margin,-e(h_l),e(h_r)) & !missing(vote,margin,class1,class2,class3)

            Comment


            • #7
              I have a somewhat similar question related to the original post but it has to do with fuzzy RD. I have been unable to get the same results between fuzzy RD with covariates and ivregress 2sls. Here is where I have posted my question in more detail. I referenced this question in my post. Any help with this question would be greatly appreciated.

              Comment


              • #8
                Originally posted by Øyvind Snilsberg View Post
                you can use indicator variables as fixed effects,
                Code:
                xtreg vote 1.d##c.margin ,fe i(class)
                HI @Øyvind Snilsberg

                I am a bit confused about the interaction term. Is the interaction of 1.d#c.margin necessary to apply a proper regression discontinuity design? Or would it also be correct to run

                xtreg vote 1.d c.margin ,fe i(class)

                and interpret the 1.d coefficient of as the RDD of interest?

                Thank you for your answer!

                Comment


                • #9
                  Originally posted by ilhas matthias View Post
                  Is the interaction of 1.d#c.margin necessary to apply a proper regression discontinuity design?
                  no, but it is necessary to replicate rdrobust, which applies different slopes on both sides of the cutoff.

                  Comment


                  • #10
                    Why would you use fixed effects in an RDD? Does that not imply that you don't think your assumptions for an RDD hold? ie. you think there might be a discontinuous change in some random other variable at the cutoff, so you are controlling for fixed effects to account for any other variable that could cause omitted variable bias?

                    Comment


                    • #11
                      *I mean control for fixed effects

                      Comment


                      • #12
                        @Øyvind Snilsberg

                        Comment

                        Working...
                        X