Announcement

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

  • Dummy variable in panel study

    Hey all,

    I have a question regarding a panel study I conduct for my master thesis:

    Distress is a dummy variable (=1 if firm's Zscore falls below 1.8 during the sampling period, = 0 otherwise)

    What is the most efficient way to let stata generate this variable? It should look like this:
    Firm Year Zscore Distress
    1 2010 3 0
    1 2011 3 0
    1 2012 4 0
    2 2010 5 1
    2 2011 1 1
    2 2012 4 1
    3 2010 4 0
    So if Zscore falls below 1.8 .The Distress dummy should equal 1 for all observations of the firm.




  • #2
    Code:
    bys Firm: egen wanted = max(Zscore<1.8)
    See https://www.stata.com/support/faqs/d...ble-recording/

    Comment


    • #3
      Wow that was fast. Thank you very much!

      Comment

      Working...
      X