knitr::opts_chunk$set(echo = TRUE)

Motivation {#motivation}

You can manually adjust all parameters in your R environment. Save this object and use it in all your Event Studies. This vignette gives you an overview on how to set the correct parameters in R.

Options {#options}

You are able to set some general options in the R option object. This enables you to setup your API credentials for all R sessions.

The options can be changed by the options function in R, e.g.

options(EventStudy.URL = "http://api.eventstudytools.com")

The options can be retained by the

getOption("EventStudy.tryAttempts")

Performing an Event Study (ARC, AVC, or AVyC) {#performing-an-event-study-arc-avc-or-avyc}

After you have set your parameters, you can easily perform your Event Study:

apiUrl <- "http://api.eventstudytools.com"
apiKey <- "Please insert your key here"

# Setup API Connection
estSetup <- EventStudyAPI$new(apiUrl)
estSetup$authentication(apiKey)

# Perform Event Study
estResults <- estSetup$performEventStudy(estParams     = volatilityEstParams, 
                                         dataFiles     = c("request_file" = "01_RequestFile.csv",
                                                           "firm_data"    = "02_firmData.csv",
                                                           "market_data"  = "03_marketData.csv"),
                                         downloadFiles = T, # download result files
                                         checkFiles    = T) # check input files                     

When you set your url or api key by EventStudy.URL and EventStudy.KEY then just leave input parameters in .$new() and .$authentication() empty. A default key and url can be set by:

options(EventStudy.KEY = apiKey)

General Event Study Parameters {#general-event-study-parameters}

There are several parameters applicable to all types of Event Studies, including Return, Volatility, and Volume Event Studies. Each Event Study type requires initializing its own R6 object before performing the analysis:

For the remainder of this section, we will focus on a Return Event Study object. However, the parameters discussed in this section can also be applied to the other two objects.

returnEstParams <- ARCApplicationInput$new()

Return File Type {#return-file-type}

The return type defines the type of the result file. Possible options are

The R API just works with CSV files.

Usage:

returnEstParams$setResultFileType("xlsx")

Return Type {#return-type}

Usage:

returnEstParams$setReturnType("simple")

Adjustment of Non-trading Days {#adjustment-of-non-trading-days}

Usage:

returnEstParams$setNonTradingDays("earlier")

Abnormal Return Event Study {#abnormal-return-event-study}

For performing Return Event Studies you need to initialize an ARCApplicationInput R6 object.

returnEstParams <- ARCApplicationInput$new()

Benchmark Models {#benchmark-models}

A comparison of our models can be found on our website.

Usage:

returnEstParams$setBenchmarkModel("mm-sw")

Test Statistics {#test-statistics}

Per default all test statistics are activated. A detailed description can be found on our website.

Parametric Test Statistics:

Non-Parametric Test Statistics:

Usage:

returnEstParams$setTestStatistics(c("aarptlz", "aarrankz"))

Abnormal Volume Event Study {#abnormal-volume-event-study}

For performing Return Event Studies you need to initialize an AVCApplicationInput R6 object.

volumeEstParams <- AVCApplicationInput$new()

Benchmark Models {#benchmark-models-1}

Usage:

volumeEstParams$setBenchmarkModel("mm-sw")

Test Statistics {#test-statistics-1}

Per default all test statistics are activated. A detailed description can be found on our website.

Parametric Test Statistics:

Non-Parametric Test Statistics:

Usage:

volumeEstParams$setTestStatistics(c("aarptlz", "aarrankz"))

Abnormal Volatility Event Study {#abnormal-volatility-event-study}

For performing Return Event Studies you need to initialize an AVyCApplicationInput R6 object.

volatilityEstParams <- AVyCApplicationInput$new()

Benchmark Models {#benchmark-models-2}

Test Statistics {#test-statistics-2}

Per default all test statistics are activated. A detailed description can be found on our website.

Volatility Test Statistics:

Abnormal Return Test Statistics:

Usage:

volatilityEstParams$setTestStatistics(c("aarptlz", "aarrankz"))

How to Cite {#how-to-cite}

Please cite our work in your publication.



EventStudyTools/api-wrapper.r documentation built on April 16, 2023, 1:04 p.m.