Lightweight R client for the
eventstudytools.com research apps:
run abnormal-return event studies (and the other research apps)
straight from R. Only two dependencies: curl and jsonlite.
Looking for the full-featured CRAN package with parameter objects, result parsers and RStudio addin? See
EventStudy. This package is its lean, dependency-light successor for scripted workflows.
# install.packages("remotes")
remotes::install_github("EventStudyTools/r-wrapper")Request your free API key at
eventstudytools.com/api-key.
Pass it to est_client() or set the EST_API_KEY environment variable.
library(eventstudytools)
client <- est_client("YOUR_API_KEY")
results <- est_run_study(
client,
est_arc_params(benchmark_model = "mm", return_type = "log"),
files = c(request_file = "01_RequestFile.csv",
firm_data = "02_FirmData.csv",
market_data = "03_MarketData.csv"),
dest_dir = "results"
)
results$local_path
caar <- read.csv2(results$local_path[results$basename == "caar_results.csv"])Try it immediately with the bundled sample data (20 US firms, S&P 500 benchmark):
results <- est_run_study(client, est_arc_params(), est_sample_files())est_run_study() wraps the protocol steps; you can also drive them
yourself:
token <- est_authenticate(client)
est_configure(client, token, est_arc_params())
est_upload(client, token, "request_file", "01_RequestFile.csv")
est_upload(client, token, "firm_data", "02_FirmData.csv")
est_upload(client, token, "market_data", "03_MarketData.csv")
est_commit(client, token)
results <- est_process(client, token)
results <- est_download(client, results, "results")Semicolon-separated CSV files without header rows, dates as
dd.mm.yyyy.
Request file (one row per event): Event ID; Firm ID; Market ID; Event date; Grouping variable; Event window start; Event window end; Estimation window end; Estimation window length.
Firm data: Firm ID; Date; Closing price — Market data:
Market ID; Date; Index value.
| Parameter | Values | Default |
|---|---|---|
benchmark_model |
mm, mm-sw, mam, cpmam, ff3fm, ffm4fm, ff5fm, garch, egarch, capm |
mm |
return_type |
log, simple |
log |
non_trading_days |
later, earlier, keep, skip |
later |
result_file_type |
csv, xls, xlsx, ods |
csv |
test_statistics |
see est_test_statistics() |
six workhorse statistics |
est_avc_params() (abnormal volume), est_avyc_params() (abnormal
volatility), est_cata_params() (news analytics;
text_data + keywords_data), est_edi_params() (event date
identification; text_data).
MIT