Announcement

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

  • Generate a list of unique firms

    Hi, I have a panel data and would like to generate a list of unique firms (e.g. gvkey), preferable exporting this list to excel or word. Is there any way to achieve this? I usually use distinct gvkey to know the number of unique firms.

    Thanks!


  • #2
    use the -duplicates- command; you may want to temporarily delete all other variables first and then
    Code:
    duplicates drop gvkey
    see
    Code:
    help duplicates

    Comment


    • #3
      Perhaps the following approach will also accomplish what you seek.
      Code:
      egen onekey = tag(gvkey)
      export excel gvkey using filename if onekey

      Comment

      Working...
      X