Announcement

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

  • Retaining Values by Group

    Hi, I have the following data set. For each firm (control or treated) I have two observations, one for the pre-event period and one for the post. For each particular filedate, I want to retain at least one treated firm and as many control firms there can be. But as you can see, for some periods, there are no control firms while for others there are no treatment firms. Is there a way to do this?

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte firmid float filedate byte(treat post)
    1 16791 0 0
    1 16791 0 1
    2 16791 0 0
    2 16791 0 1
    3 16844 1 0
    3 16844 1 1
    4 17254 0 0
    4 17254 0 1
    5 17254 1 0
    5 17254 1 1
    end
    format %td filedate
Working...
X