Categories
 Data (8)
 Learning Resources (8)
 Python (8)
 SAS (14)
 Stata (23)
 Uncategorized (1)

Recent Posts
Recent Comments
 Alex Luong on Export a SAS dataset to Stata with all variable names converted to lowercase
 X Huan on Calculate market value of equity: use CRSP or Compustat?
 Kai Chen on Use Python to extract URLs to HTMLformat SEC filings on EDGAR
 Kai Chen on EDGAR index files in Stata dataset (from 1993 Q1 to March 2, 2017)
 bruno on EDGAR index files in Stata dataset (from 1993 Q1 to March 2, 2017)
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, we just need to apply the following conditions: indfmt==”INDL” & datafmt==”STD” & popsrc==”D” & consol==”C” If we have converted FUNDA to Stata format, the uniqueness of GVKEYDATADATE can be verified using … Continue reading
Posted in Data, Stata
14 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
3 Comments
SAS macro to get analysts EPS consensus for a given fiscal period end (DATADATE) by a selected date (DATE)
Update: contains error! will update later. 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 … 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
14 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