Hi,

Sounds like an exciting adventure!

First appearance would be the first year that the firm is included in Compustat Fundamental Annual. The fiscal year is in the variable ‘fyear’. So, for a given firm, take the minimum value of fyear, and that is the first year they are in Compustat. To compute firm age for any year, take the fiscal year (fyear) minus the minimum value of fyear.

Monthly returns are ‘RET’ in crsp.msf. The variable ‘datadate’ in Compustat is the last day (approx) of the fiscal year. Subtract 12 months and add 1 day to get the first day of the fiscal year. Then, retrieve all RET from MSF where MSF’s date is within that range: should be 12 monthly returns.

Crsp.msix has a few options with respect to measuring market return: either value weighted or equal weighted, or dividend adjusted or not. It probably doesn’t matter

Market adjusted return means subtract the market return from the firms return. For example, if the firm’s return in a month is 2%, and the market return is 1.5%, then the market-adjusted return for that firm-month is 0.5%. There are two ways of getting to a yearly return: (1) compute monthly abnormal return and compound it, (2) compound firm return and compound market return and take the difference. Different people believe different things as to what is the ‘right’ way.

I am a big fan of Stata for the statistical packages, not for data management. I would recommend learning SAS to create variables like these.

Best,

Joost