Announcement

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

  • Compustat execucomp data processing

    Hi everyone,

    I am currently using Stata to process Compustat ExecuComp data to work on my thesis. I have encounter a problem with number of observations (number of CEO-year) and number of firms. After processing, I have found about 28,138 observations but I would like to know how many firms are there is the 28,138 observations since there might be one CEO for a firm for different years. How should I actually code to know how many firms are there?

    The data downloaded from WRDS had different ID number for each executive/company combination, but how do I code to categorise them to number of firms?

    Thanks a lot.

    Click image for larger version

Name:	pic2.png
Views:	1
Size:	198.4 KB
ID:	1504808




  • #2
    Hi Wendy,

    you can count the number of firms with the distinct command:
    Code:
    distinct(coname)
    However, this will ignore missing values, and I see your first 5 observations have missing data for the company name. You might want to look first why that data is missing.

    You can also create a firm id with encode:
    Code:
    encode coname, gen(firm_id)
    This will give the firms a number from 1 to the total amount of firms, while retaining the company name as a value label.
    Last edited by Wouter Wakker; 25 Jun 2019, 09:20.

    Comment

    Working...
    X