Categories
 Data (7)
 Learning Resources (8)
 Python (7)
 SAS (11)
 Stata (15)
 Uncategorized (2)

Recent Posts
 Stata commands to do Heckman two steps
 The calculation of average credit rating using ratings from three rating agencies
 Stata commands to test equality of mean and median
 Stata command to display combined Pearson and Spearman correlation matrix
 Stata command to convert string GVKEY to numerical GVKEY or vice versa
Recent Comments
Archives
Meta
Monthly Archives: August 2015
How to remove duplicate GVKEYDATADATE when using Compustat Annual (FUNDA) and Quarterly (FUNDQ)?
The annual data (FUNDA) is easy to deal with, you just need to apply the following conditions: indfmt==”INDL” & datafmt==”STD” & popsrc==”D” & consol==”C” If you have downloaded FUNDA and converted it to Stata format, the uniqueness of GVKEYDATADATE can … Continue reading
Posted in Learning Resources
4 Comments
If beginning year and ending year are known, how to fill in years in between?
Question: Suppose two companies A and B are connected in some years. Say, right now the data structure is the following: Company 1 Company 2 Starting Year Ending Year A B 2000 2006 A C 1998 2003 C D 1995 … Continue reading
Posted in SAS
Leave a comment
SAS macro to get analysts EPS consensus for a given fiscal period end (DATADATE) by a selected date (DATE)
I write this macro to compute analysts’ quarterly EPS consensus on a selected date (DATE) for a given fiscal quarter end (DATADATE). This macro can be easily modified for other types of estimates (e.g., annual EPS). This macro currently extracts unadjusted quarterly EPS estimates (current … Continue reading
Posted in SAS
Comments Off on SAS macro to get analysts EPS consensus for a given fiscal period end (DATADATE) by a selected date (DATE)
Link Audit Analytics, Compustat, CRSP and I/B/E/S
The following program is used to link each financial restatement in Audit Analytics to Compustat, CRSP, and I/B/E/S. The resultant dataset aa contains unique identifiers of Audit Analytics (res_notify_key), Compustat (gvkey), CRSP (permno), and I/B/E/S (ibtic). Please note this program … Continue reading
Posted in SAS
13 Comments
Regression with a large dummyvariable set (e.g., firm and year fixed effects) in Stata
I run a regression in Stata with a Compustat dataset that contains fyear and gvkey. I want to add firm and year fixed effects, so I type the following command: regress DV IV i.fyear i.gvkey But Stata returns the error … Continue reading
Posted in Stata
Leave a comment