Announcement

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

  • Identify 100 biggest companies within a firmyear

    Dear all,

    We are trying to generate a new dummy variable (biggest_comp_d) indicating whether a company belongs to the group of 100 biggest companies within one firmyear (fyear), based on total assets (at). So basically this variable is based on company cusip code (cusip), firm year (fyear), top 100 assets total (at) and generate a dummy (biggest_comp_d) which gives a company value 1 when it belongs to that group of biggest 100 in a certain year.

    Please let us know when something is unclear,

    Thanks in advance!

    Jonathan

  • #2
    With no missings that looks like

    Code:
    bysort fyear (at) : gen wanted = (_N - _n) < 100

    Comment


    • #3
      This might also be done with egen using the rank function.

      Comment

      Working...
      X