Generating a variable for “firm age” in COMPUSTAT.
Posted: 09 March 2015 02:04 PM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2015-03-09

Hi everyone,

I’m having trouble with generating a firm age variable using compustat (in SAS). I’m rather new to this data source, so if anyone has coding suggestions, I’d greatly appreciate it! smile

Courtney

Profile
 
 
Posted: 09 March 2015 02:51 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Courtney,

If you only want to use Compustat, you can consider the first firm-year with non-missing prcc_f as the ‘ipo-year’, and measure firm age as the number of years passed since.

If your sample is matched agains CRSP, then you could use somthing like this (requires a dataset with permno and datadate); it is a bit more precise (uses a date instead of a year):

proc sql;
 
create table dsout as 
 
select a.*, yrdif(b.st_datea.datadate'ACT/ACT') as firmage
 from dsin a left join crsp
.stocknames b 
 on a
.permno b.permno and b.NAMEDT <= a.datadate<= b.NAMEENDDT;
quit

Hope this helps,

Joost

 

 Signature 

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

Profile