firm age calculation based on Compustat funda database
Posted: 06 September 2012 09:01 PM   [ Ignore ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

*define comp;

data firmage(keep = gvkey datadate fyear);
set comp.funda;
run;

proc sort data = firmage;
by gvkey fyear;
run;

data firmage2;
set firmage;
count +1;
by gvkey;
if first.gvkey then count = 1;
run;

Reference:
http://www.ats.ucla.edu/stat/sas/faq/enumerate.htm

 Signature 

Zenghui
A humble student of business

Profile
 
 
Posted: 07 September 2012 01:26 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Zenghui,

Thanks; this is a straightforward approach. Another way would be to take the first firm-year with non-missing prcc_f as the year of ‘birth’ (IPO-year). The first year in Funda is typically backfilled based on the IPO filing (so the first year in Funda is 2-3 years before the IPO).

Yet another way would be to use ‘ipodate’ in comp.company, but this field has quite some missing values. Jay Ritter has an IPO dataset on his website, including a dataset with founding years (http://bear.warrington.ufl.edu/ritter/FoundingDates.htm).

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 07 September 2012 07:08 AM   [ Ignore ]   [ # 2 ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

Joost,

Thanks for the comments, good to know there are such decent data set available on line.

smile

Best Regards,

 Signature 

Zenghui
A humble student of business

Profile
 
 
Posted: 27 February 2014 03:55 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Zenghui,

When using CRSP to determine firm age (firm year minus year of first stock price), it is probably better to use the info in crsp.stocknames (the stock price may be missing even if the firm is listed; for example otc/pink sheets).

Code (assuming crsp is a local library holding stocknames):

/*  Firm age: firmage */
proc sql;
 
create table c.m_firmage as select distinct a.*, b.st_dateb.end_date from c.l_compensation a left join crsp.stocknames b on 
 a
.permno b.permno and b.st_date <= a.datadate <= b.end_date;
quit;

data c.m_firmage (drop st_date end_date);
set c.m_firmage;
firmage=yrdif(st_datedatadate'ACT/ACT');
run

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile