Announcement

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

  • How to make stata keep only the first issuance?

    I have a dummy variable called FLAG where 1 is when a company issues a green bond and 0 when it doesn't. I'm trying to study the abnormal return of issuances separately. I would like to present the abnormal return of the first issuance and then of subsequent issuances to show that there is a difference. Knowing that my dataset has so many companies and each one of them issues a different number of green bonds (0,1,2,3,.....8). Is there a command I can use to make stata keep the first issuance for each company separately and then store all the subsequent together or even better, if possible, make stata store each issuance even subsequent ones in a separate manner?

    Thank you all.

  • #2
    Maher:
    I'd go:
    Code:
    . bysort firmid (timevar): g wanted=_n
    Then you can -sort- the dataset according to your needs.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X