There are two ways to run your analyses in SAS with EventStudyTools: call the research API directly from your SAS session with the %est_arc macro, or download the legacy standalone SAS program and run the calculation locally. The API route is recommended: it handles any number of firms, all benchmark models, and the full set of test statistics.
The SAS API wrapper: %est_arc
The official SAS wrapper packages the API workflow into a single macro. %est_arc uploads your three input files, runs the calculation on the EventStudyTools server, and downloads the result files. It is written in pure Base SAS (PROC HTTP and the JSON libname engine), requires SAS 9.4M4 or newer, and also works on SAS Viya. No additional packages are needed.
Installation
Download est_arc.sas from the GitHub repository and include it in your program:
%include "/path/to/est_arc.sas";
API key
The API requires a key. Academic users can request a free API key, valid for one month, on our API access page using their university email address. General (non-academic) key access is currently paused.
Quickstart
%est_arc(
apikey=YOUR_API_KEY,
requestfile=/data/01_RequestFile.csv,
firmdata=/data/02_FirmData.csv,
marketdata=/data/03_MarketData.csv,
destdir=/data/results
);
proc import datafile="/data/results/caar_results.csv"
out=caar dbms=dlm replace;
delimiter=';';
getnames=yes;
run;
The three input files are semicolon-separated CSV files without header rows: a request file that defines the events and windows, a firm data file with closing prices, and a market data file with index values. Sample data (20 US firms against the S&P 500 benchmark) and a runnable example program are included in the repository's examples folder.
Useful macro parameters:
app=selects the research app:arc(abnormal returns, the default),avc(abnormal volume), oravyc(abnormal volatility)benchmarkmodel=chooses the expected-return model, for examplemm(market model, the default),ff3fm, orgarchteststatistics=takes a space-separated list of test statistic codes; six workhorse statistics are requested by defaultresultfiletype=sets the result format:csv,xls,xlsx, orods
The full parameter reference is in the repository README. Details on the underlying API protocol, the input file formats, and the available result files are documented on the API page.
Standalone SAS program (download and run)
If you prefer to run the estimation entirely on your own machine, a standalone SAS program is available. It estimates a market model over the estimation window and computes abnormal returns and accompanying statistics for a single firm. These short steps serve as directions for running it:
- Download the program file
- Download sample RequestFile, FirmData, and MarketData files from the wrapper repository, or prepare your own files in the same format
- Place the files in a single folder on your hard drive
- Open the program file in the SAS editor
- Adjust the places in the code indicated where one inputs the three data files, so they point to the folder containing the files
- Run the program
Notes:
- Running the program in HTML output mode creates accompanying charts
- The program is operable for one firm at a time. Repeating the market regression and statistics for several firms is easy for anyone with basic SAS experience, but for larger samples the
%est_arcmacro above is the better route: it processes an arbitrary number of firms in a single call