Announcement

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

  • Creating Variable - years since an event

    Hi there,

    I have a panel dataset and wish to do a regression analysis that involves a variable, "Years since the Financial Crisis" (which refers to the most recent financial crisis of 2007).

    I am looking for advice on how to code this.

    Should I simply code all years as 0 up to and including 2007, and then 1 for 2008, 2 for 2009 etc? Or is there a better method?

    Thanks in advance!

  • #2
    In turn you need to say more about your rationale for any such variable.

    But something like

    Code:
    gen wanted1  = year - 2007
    or

    Code:
    gen wanted2 = max(0, year - 2007)
    might suit. Compare the comments at https://stackoverflow.com/questions/...since-an-event

    Comment

    Working...
    X