Announcement

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

  • Generate a binary treatment indicator for DiD

    I have to generate a binary treatment indicator for having a water supply system in a municipality in a given year.

    I have the following variables:
    - year
    - wateryear: the year in which a municipality introduced fresh water supply systems
    - kreisid: unique identifier for municipalities

  • #2

    Code:
    gen wanted = year >= wateryear if !missing(year, wateryear)
    may help.

    Comment

    Working...
    X