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

Recent Posts
 The calculation of average credit rating using ratings from three rating agencies
 Stata commands to test equality of mean and median
 Handy Stata command to display combined Pearson and Spearman correlation matrix
 Stata command to convert string GVKEY to numerical GVKEY or vice versa
 Stata command to calculate the area under ROC curve
Recent Comments
 Naser on Use Python to download TXTformat SEC filings on EDGAR (Part II)
 Jill Adona on Use Python to extract Intelligence Indexing fields in Factiva articles
 Kai Chen on Use Python to download TXTformat SEC filings on EDGAR (Part II)
 Vr on Use Python to download TXTformat SEC filings on EDGAR (Part II)
 stu on Use Python to download TXTformat SEC filings on EDGAR (Part II)
Archives
Meta
Category Archives: SAS
Calculate idiosyncratic stock return volatility
I have noted two slightly different definitions of idiosyncratic stock return volatility in: Campbell, J. Y. and Taksler, G. B. (2003), Equity Volatility and Corporate Bond Yields. The Journal of Finance, 58: 2321–2350. doi:10.1046/j.15406261.2003.00607.x Rajgopal, S. and Venkatachalam, M. (2011), … Continue reading
Posted in SAS
3 Comments
Download FR Y9C data from WRDS
WRDS currently populates FR Y9C data quarter by quarter in individual datasets, like BHCF200803, BHCF200806, BHCF200809 and so on. WRDS has not stacked those individual datasets to formulate a single timeseries dataset like COMPUSTAT. There are two ways to overcome … Continue reading
Posted in Data, SAS
2 Comments
The impact of WRDS transition to the new WRDS Cloud server
WRDS has quietly started the transition from the old server to the new Cloud server. This move makes a lot of support documentation on the WRDS website outdated and misleading. That is why I think WRDS should direct its resources on continuously … Continue reading
Posted in Learning Resources, SAS
1 Comment
Rollingwindow computation in SAS and Stata
SASers often find proc expand plus transformout very useful for rollingwindow (or movingwindow) computation. Stataers may wonder if there is a counter party in Stata. The answer is “yes”. The command in Stata is rolling. See the manual below: http://www.stata.com/manuals13/tsrolling.pdf The … Continue reading
Posted in Learning Resources, SAS, Stata
Leave a comment
SAS macro for event study and beta
There are two macros on the List of WRDS Research Macros: EVTSTUDY and BETA, which may be often used. I like the first one, written by Denys Glushkov. Denys’ codes are always elegant. I don’t like the second one because … Continue reading
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
Calculate delta (payperformance sensitivity), vega (risktaking incentives), and firmspecific wealth (inside equity) for executives on Execucomp
Several papers use measures of delta (payperformance sensitivity), vega (risktaking incentives), and firmspecific wealth (inside equity) for executives on Execucomp. For example, 1. Core, J., Guay, W., 2002. Estimate the value of employee stock option portfolios and their sensitivities to price … Continue reading
Posted in SAS
23 Comments
Look into CRSP/Compustat link table
The link history table (CCMXPF_LNKHIST) is the primary table used for WRDS CCM web queries. In this post, I explain this table in detail. Background We know that a company may issue multiple securities, one of which is considered primary … Continue reading
Posted in Learning Resources, SAS
16 Comments