Announcement

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

  • rdrobust and reg do not yield same results

    Hello Stata community,

    I'm trying to implement an RDD design and am following Cattaneo et al. (2019). Following their paper,

    Code:
    reg y x T c.x#i.T
    rdrobust y x, kernel(uniform) p(1)
    should yield the same coefficient for T - this works with test data but not with my actual data. Below you find my output. Any idea what the problem might be? I'm using STATA version 16.

    Code:
    . reg y x T c.x#i.T
    
          Source |       SS           df       MS      Number of obs   =     3,214
    -------------+----------------------------------   F(3, 3210)      =      1.84
           Model |  .440886445         3  .146962148   Prob > F        =    0.1382
        Residual |  256.816114     3,210   .08000502   R-squared       =    0.0017
    -------------+----------------------------------   Adj R-squared   =    0.0008
           Total |  257.257001     3,213  .080067538   Root MSE        =    .28285
    
    ------------------------------------------------------------------------------
               y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               x |   .0002407   .0012055     0.20   0.842     -.002123    .0026044
               T |  -.0313921   .0218523    -1.44   0.151     -.074238    .0114538
                 |
           T#c.x |
              1  |   .0003826   .0021991     0.17   0.862    -.0039291    .0046943
                 |
           _cons |   .0990177   .0135144     7.33   0.000     .0725199    .1255154
    ------------------------------------------------------------------------------
    
    .
    .
    . rdrobust y x, kernel(uniform) p(1) h(200) c(0) masspoints(adjust)
    
    Sharp RD estimates using local polynomial regression.
    
          Cutoff c = 0 | Left of c  Right of c            Number of obs =       3214
    -------------------+----------------------            BW type       =     Manual
         Number of obs |      1955        1259            Kernel        =    Uniform
    Eff. Number of obs |      1955        1259            VCE method    =         NN
        Order est. (p) |         1           1
        Order bias (q) |         2           2
           BW est. (h) |   200.000     200.000
           BW bias (b) |   200.000     200.000
             rho (h/b) |     1.000       1.000
    
    Outcome: y. Running variable: x.
    --------------------------------------------------------------------------------
                Method |   Coef.    Std. Err.    z     P>|z|    [95% Conf. Interval]
    -------------------+------------------------------------------------------------
          Conventional |  -.0438     .02038   -2.1488  0.032   -.083744     -.003849
                Robust |     -          -     -1.4766  0.140   -.108161      .015214
    --------------------------------------------------------------------------------
    
    sum y x T
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
               y |      3,214    .0877411    .2829621          0          1
               x |      3,214   -3.172993     10.0653        -19         17
               T |      3,214     .372122    .4834459          0          1
    Thank you in advance!

  • #2
    please use the -dataex- command to show a data example that reproduces the problem.

    Comment


    • #3
      Here is the data example:
      Code:
      id wave x T y yT
        111000 1 -16 0 1  0
       1299000 2  -3 0 0  0
       1300000 3  13 1 1 13
       1624000 3   9 1 0  9
       1818000 1 -17 0 0  0
       1993000 3  16 1 0 16
       2088000 1 -13 0 1  0
       2322000 3  13 1 0 13
       2767000 1 -18 0 0  0
       2931000 3  10 1 0 10
       3023000 1 -13 0 0  0
       3134000 3  13 1 0 13
       3450000 1 -15 0 0  0
       3491000 1 -14 0 0  0
       3902000 1 -18 0 0  0
       4189000 1 -15 0 0  0
       4273000 2   0 0 0  0
       4330000 1 -14 0 1  0
       4548000 1 -13 0 0  0
       4814000 3  15 1 0 15
       4835000 1  -9 0 0  0
       5559000 1 -13 0 1  0
       5678000 3  12 1 0 12
       5780000 2   1 1 0  1
       6008000 3   9 1 0  9
       6151000 2  -4 0 0  0
       6519000 1 -18 0 0  0
       6780000 1 -14 0 0  0
       7167000 2   4 1 0  4
       7256000 2  -2 0 0  0
       7586000 3   9 1 0  9
       7656000 1 -11 0 0  0
       7892000 1 -18 0 0  0
       8075000 1  -4 0 0  0
       8075000 2  -4 0 0  0
       8807000 1 -11 0 0  0
       8948000 2  -3 0 0  0
       9161000 1  -9 0 0  0
       9657000 1 -10 0 0  0
       9729000 2  -4 0 0  0
       9917000 3  15 1 0 15
       9980000 2  -3 0 0  0
      10208000 2  -6 0 0  0
      10564000 1 -16 0 0  0
      10578000 1 -16 0 0  0
      10665000 3  11 1 0 11
      10789000 2   2 1 0  2
      10809000 2   0 0 0  0
      10957000 1 -16 0 1  0
      11295000 3   6 1 0  6
      11585000 1  -6 0 0  0
      11714000 1 -14 0 0  0
      12027000 1 -17 0 0  0
      12101000 2   0 0 0  0
      12266000 3   7 1 0  7
      12490000 2   1 1 0  1
      13345000 1  -7 0 0  0
      13588000 2   6 1 0  6
      13588000 3   6 1 0  6
      13937000 2   1 1 0  1
      14066000 1 -16 0 0  0
      14660000 1 -13 0 0  0
      14685000 1 -12 0 0  0
      14722000 2  -3 0 0  0
      14898000 1 -15 0 0  0
      15310000 1 -15 0 0  0
      15350000 1 -16 0 0  0
      15595000 1 -11 0 0  0
      15701000 1 -15 0 0  0
      15975000 1 -10 0 0  0
      16373000 1  -4 0 0  0
      16373000 2  -4 0 0  0
      16441000 1  -8 0 0  0
      16512000 2   2 1 0  2
      16671000 1 -15 0 0  0
      16829000 2   1 1 0  1
      17018000 1  -6 0 0  0
      17154000 1 -16 0 0  0
      17261000 3   9 1 0  9
      17464000 1  -5 0 0  0
      17663000 1 -17 0 0  0
      18011000 1 -16 0 0  0
      18129000 3  11 1 0 11
      18494000 2  -3 0 0  0
      18850000 1 -16 0 0  0
      19562000 3  11 1 0 11
      19656000 2  -1 0 1  0
      19673000 1 -14 0 0  0
      20041000 2   0 0 0  0
      20226000 1 -11 0 0  0
      20277000 1 -10 0 0  0
      20839000 3  13 1 0 13
      20970000 1 -17 0 0  0
      21256000 3  14 1 0 14
      21446000 2   6 1 0  6
      21454000 1 -14 0 0  0
      21637000 2  -5 0 0  0
      21830000 1 -16 0 0  0
      21888000 3   9 1 0  9
      22234000 3  10 1 0 10
      Last edited by Lea Berg; 23 Aug 2022, 05:05.

      Comment


      • #4
        Code:
        . rdrobust y x, kernel(uniform) p(1) h(200)
        
        Sharp RD estimates using local polynomial regression.
        
              Cutoff c = 0 | Left of c  Right of c            Number of obs =        100
        -------------------+----------------------            BW type       =     Manual
             Number of obs |        65          35            Kernel        =    Uniform
        Eff. Number of obs |        65          35            VCE method    =         NN
            Order est. (p) |         1           1
            Order bias (q) |         2           2
               BW est. (h) |   200.000     200.000
               BW bias (b) |   200.000     200.000
                 rho (h/b) |     1.000       1.000
        
        Outcome: y. Running variable: x.
        --------------------------------------------------------------------------------
                    Method |   Coef.    Std. Err.    z     P>|z|    [95% Conf. Interval]
        -------------------+------------------------------------------------------------
              Conventional | -.07176     .08091   -0.8869  0.375   -.230346      .086818
                    Robust |     -          -     -0.4919  0.623   -.548734      .328566
        --------------------------------------------------------------------------------
        
        . reg y x T c.x#i.T, noheader
        ------------------------------------------------------------------------------
                   y | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                   x |   -.004389   .0054818    -0.80   0.425    -.0152703    .0064923
                   T |  -.0673279   .1181587    -0.57   0.570    -.3018711    .1672154
                     |
               T#c.x |
                  1  |   .0112835   .0115265     0.98   0.330    -.0115965    .0341635
                     |
               _cons |   .0406492   .0656291     0.62   0.537    -.0896236     .170922
        ------------------------------------------------------------------------------
        
        . count if T
          31
        
        . replace T = 1 if x == 0
        (4 real changes made)
        
        . count if T
          35
        
        . reg y x T c.x#i.T, noheader
        ------------------------------------------------------------------------------
                   y | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                   x |  -.0033402   .0061796    -0.54   0.590    -.0156066    .0089262
                   T |  -.0717637   .1091199    -0.66   0.512     -.288365    .1448377
                     |
               T#c.x |
                  1  |   .0093415   .0105589     0.88   0.379    -.0116178    .0303009
                     |
               _cons |    .054897   .0762257     0.72   0.473      -.09641    .2062039
        ------------------------------------------------------------------------------

        Comment


        • #5
          Thank you! Now it works

          Comment


          • #6
            Hello,
            I was wondering what the logic behind this solution is? Why is it appropriate to substitute T values based on x values?

            Comment


            • #7
              the treatment status variable, T, should be equal to 1 for observations with running variable, x, greater than or equal to the cutoff, 0.

              Comment


              • #8
                Originally posted by Margarita Petrusevich View Post
                Hello,
                I was wondering what the logic behind this solution is? Why is it appropriate to substitute T values based on x values?
                In addition, when you set the bandwidth large enough to include all observations then local linear regression becomes global linear regression.

                Comment

                Working...
                X