Announcement

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

  • Diff-in-Diff Treatment group getting dropped due to collinearity

    Hi,

    I am trying to run a diff-in-diff to determine the impact of owning television on various outcomes. The data set is a panel and consists of 2 rounds.

    I have a treated dummy taking value 1 if the tv was owned in both the survey rounds and 0 otherwise
    Time dummy taking value 1 if the observation is in the second survey and otherwise
    did variable is an interaction term between the time dummy and treated dummy.

    I am running the following regression:

    Code:
    areg contraceptive_usage treated time_dummy did, absorb(id1)
    However, treated dummy gets omitted due to collinearity. I cannot understand how can it be corrected or is this normal for this study.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float id1 byte treated float(time_dummy did)
     1 . 0 .
     1 . 1 .
     2 0 0 0
     2 0 1 0
     3 0 0 0
     3 0 1 0
     4 0 0 0
     4 0 1 0
     5 1 0 0
     5 1 1 1
     6 0 0 0
     6 0 1 0
     7 0 0 0
     7 0 1 0
     8 0 0 0
     8 0 1 0
     9 0 0 0
     9 0 1 0
    10 0 0 0
    10 0 1 0
    11 0 0 0
    11 0 1 0
    12 0 0 0
    12 0 1 0
    13 1 0 0
    13 1 1 1
    14 0 0 0
    14 0 1 0
    15 1 0 0
    15 1 1 1
    16 0 0 0
    16 0 1 0
    17 0 0 0
    17 0 1 0
    18 0 0 0
    18 0 1 0
    19 0 0 0
    19 0 1 0
    20 0 0 0
    20 0 1 0
    21 0 0 0
    21 0 1 0
    22 0 0 0
    22 0 1 0
    23 0 0 0
    23 0 1 0
    24 0 0 0
    24 0 1 0
    25 0 0 0
    25 0 1 0
    26 0 0 0
    26 0 1 0
    27 0 0 0
    27 0 1 0
    28 1 0 0
    28 1 1 1
    29 0 0 0
    29 0 1 0
    30 0 0 0
    30 0 1 0
    31 1 0 0
    31 1 1 1
    32 1 0 0
    32 1 1 1
    33 0 0 0
    33 0 1 0
    34 1 0 0
    34 1 1 1
    35 1 0 0
    35 1 1 1
    36 0 0 0
    36 0 1 0
    37 0 0 0
    37 0 1 0
    38 0 0 0
    38 0 1 0
    39 0 0 0
    39 0 1 0
    40 0 0 0
    40 0 1 0
    41 0 0 0
    41 0 1 0
    42 0 0 0
    42 0 1 0
    43 0 0 0
    43 0 1 0
    44 0 0 0
    44 0 1 0
    45 0 0 0
    45 0 1 0
    46 1 0 0
    46 1 1 1
    47 0 0 0
    47 0 1 0
    48 1 0 0
    48 1 1 1
    49 0 0 0
    49 0 1 0
    50 0 0 0
    50 0 1 0
    end

  • #2
    In 2 by 2 DD you need X units and two time periods, one unit that's eventually treated and one unit that's never treated (there's more to this, but that's the simple story).

    Before this though, I see worse problem. You're doing too much work. All you need in this context is

    Code:
     
     areg contraceptive_usage i.treated##i.time_dummy
    no need to make your own interaction term.

    Comment


    • #3
      Jared Greathouse's suggested improvement for your code is spot on--and the sooner you get going with factor-variable notation in Stata, the better. It needs one modification: you need the -absorb(id1)- option.

      But I don't think he actually answered your question, which was what to do about the fact that your treated variable gets omitted. You will have the same "problem" again: the output will omit 1.treated. But it is not actually a problem (and wasn't a problem in your code either). In a classic DID design, by definition, the treated variable is the same in all observations for a given id1. That means that the treated variable is always colinear with the fixed (absorbed) effect--so it has to be dropped in order for the model to be identifiable. This is absolutely standard. Not only is it nothing to worry about, if it didn't happen, you would need to take that as a warning that there is something seriously wrong with the data!

      Comment


      • #4
        Jared Greathouse Thank you for pointing out the problem.
        Clyde Schechter Thank you Sir for the super helpful explanation!

        Comment


        • #5
          Clyde Schechter you're right, I got lost in the syntax-correcting, but you're right, I should've also added what you said, too.

          Comment

          Working...
          X