Announcement

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

  • Possible issue with diff in diff regression?

    Hello,

    I am trying to do a diff in diff approach where my regression code looks like this

    Code:
    mi estimate, esampvaryok: reg job_hours treatment time i.time#i.treatment, robust
    Treatment is defined as

    Code:
    gen treatment=0 if (expectation==2 & f.gift_received==2 & gift_total < 50000000) | (l.expectation==2 & gift_received==2 & gift_total < 50000000) 
    
    replace treatment=1 if (expectation==2 & f.gift_received==1 & gift_total < 50000000) | (l.expectation==2 & gift_received==1 & gift_total < 50000000)
    and time is a binary variable for the two time points.

    My output looks as follows

    Code:
    Multiple-imputation estimates                     Imputations     =          5
    Linear regression                                 Number of obs   =         55
                                                      Average RVI     =     0.1495
                                                      Largest FMI     =     0.3396
                                                      Complete DF     =         51
    DF adjustment:   Small sample                     DF:     min     =      19.29
                                                              avg     =      37.33
                                                              max     =      47.65
    Model F test:       Equal FMI                     F(   3,   38.8) =       1.62
    Within VCE type:       Robust                     Prob > F        =     0.1996
    
    --------------------------------------------------------------------------------
         job_hours |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
         treatment |  -7.653846   7.472867    -1.02   0.318    -23.27896    7.971272
              time |   -5.29398   3.226253    -1.64   0.108    -11.78518    1.197221
                   |
    time#treatment |
              0 1  |   3.972687   12.99843     0.31   0.762     -22.3997    30.34508
              1 0  |          0  (omitted)
              1 1  |          0  (omitted)
                   |
             _cons |   42.74783   2.208462    19.36   0.000     38.30658    47.18907
    --------------------------------------------------------------------------------
    However, I want the regression to look like this

    job_hours = b0 + b1 * (treated = 1) + b2 * (Time=1) + b3 * interaction+ e_it, where in the interaction both treated and time are = 1

    I am unsure how to continue, how would I change the regression to make this happen? mi estimate doesn't seem to allow for "if"

  • #2
    Did you look at your data and try to understand why the time#treatment interactions were omitted? I suspect that this is a data rather than a modeling issue.

    Comment


    • #3
      I am honestly not sure where this issue could arrive.

      time is defined as

      gen time=survey==2 since survey is either 1 or 2 for the two time periods. Besides that everything looks ok to me.

      _mi_id is just the multiple imputation number, expectation is a binary variable if the person expects to receive money in the future, and gift_received is a binary value if they have received some kind of gift in the past and gift_total is a monetary variable of the total amount of gifts received.

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input int id byte survey int _mi_id byte(expectation gift_received) float(gift_total time)
       27 2 57 1 2      0 1
       27 2 57 1 2      0 1
       27 2 57 1 2      0 1
       27 2 57 1 2      0 1
       27 2 57 1 2      0 1
       27 2 57 1 2      0 1
       36 1  1 2 1 570000 0
       36 1  1 2 1 570000 0
       36 1  1 2 1 570000 0
       36 1  1 2 1 570000 0
       36 1  1 2 1 570000 0
       36 1  1 2 1 570000 0
       36 2 58 2 2      0 1
       36 2 58 2 2      0 1
       36 2 58 2 2      0 1
       36 2 58 2 2      0 1
       36 2 58 2 2      0 1
       36 2 58 2 2      0 1
       67 1  2 2 1  40000 0
       67 1  2 2 1  40000 0
       67 1  2 2 1  40000 0
       67 1  2 2 1  40000 0
       67 1  2 2 1  40000 0
       67 1  2 2 1  40000 0
       67 2 59 2 1  20000 1
       67 2 59 2 1  20000 1
       67 2 59 2 1  20000 1
       67 2 59 2 1  20000 1
       67 2 59 2 1  20000 1
       67 2 59 2 1  20000 1
       86 1  3 2 1 100000 0
       86 1  3 2 1 100000 0
       86 1  3 2 1 100000 0
       86 1  3 2 1 100000 0
       86 1  3 2 1 100000 0
       86 1  3 2 1 100000 0
       86 2 60 2 2      0 1
       86 2 60 2 2      0 1
       86 2 60 2 2      0 1
       86 2 60 2 2      0 1
       86 2 60 2 2      0 1
       86 2 60 2 2      0 1
       92 1  4 2 2      0 0
       92 1  4 2 2      0 0
       92 1  4 2 2      0 0
       92 1  4 2 2      0 0
       92 1  4 2 2      0 0
       92 1  4 2 2      0 0
       92 2 61 2 2      0 1
       92 2 61 2 2      0 1
       92 2 61 2 2      0 1
       92 2 61 2 2      0 1
       92 2 61 2 2      0 1
       92 2 61 2 2      0 1
      128 1  5 2 2      0 0
      128 1  5 2 2      0 0
      128 1  5 2 2      0 0
      128 1  5 2 2      0 0
      128 1  5 2 2      0 0
      128 1  5 2 2      0 0
      128 2 62 2 2      0 1
      128 2 62 2 2      0 1
      128 2 62 2 2      0 1
      128 2 62 2 2      0 1
      128 2 62 2 2      0 1
      128 2 62 2 2      0 1
      130 1  6 1 1 160000 0
      130 1  6 1 1 160000 0
      130 1  6 1 1 160000 0
      130 1  6 1 1 160000 0
      130 1  6 1 1 160000 0
      130 1  6 1 1 160000 0
      178 1  7 2 1  30000 0
      178 1  7 2 1  30000 0
      178 1  7 2 1  30000 0
      178 1  7 2 1  30000 0
      178 1  7 2 1  30000 0
      178 1  7 2 1  30000 0
      303 1  8 1 2      0 0
      303 1  8 1 2      0 0
      303 1  8 1 2      0 0
      303 1  8 1 2      0 0
      303 1  8 1 2      0 0
      303 1  8 1 2      0 0
      455 1  9 2 2      0 0
      455 1  9 2 2      0 0
      455 1  9 2 2      0 0
      455 1  9 2 2      0 0
      455 1  9 2 2      0 0
      455 1  9 2 2      0 0
      484 1 10 2 1  75000 0
      484 1 10 2 1  75000 0
      484 1 10 2 1  75000 0
      484 1 10 2 1  75000 0
      484 1 10 2 1  75000 0
      484 1 10 2 1  75000 0
      484 2 63 2 2      0 1
      484 2 63 2 2      0 1
      484 2 63 2 2      0 1
      484 2 63 2 2      0 1
      end
      Last edited by Oscar Weinzettl; 08 Aug 2019, 14:48.

      Comment


      • #4
        push*

        Comment


        • #5
          It's still unclear how your data are structured and if your variable creation went as planned.

          Run more descriptives on your data to understand what proportion of observations fall in each of the four time#treatment groups.

          Comment

          Working...
          X