Learn R Programming

EventStudy (version 0.37)

ResultParser: Parses request and results files returned from our Event Study API interface.

Description

This result file parser works currently only with csv files. Please read the vignette for further details (coming soon). We will restructure our result reports soon. So, this function may change dramatically. This object can be used for plotting your results.

Arguments

Format

R6Class object.

Methods

new(dir)

This method is used to create object of this class with dir as the directory of result files.

parseReport(path = "analysis_report.csv")

This method parses the analysis report file (analysis_report.csv).

parseAR(path = "ar_results.csv")

This method parses the abnormal return file (ar_results.csv). Furthermore, it triggers parseReport and join firm and index name.

parseCAR(path = "car_results.csv")

This method parses the cumulative abnormal return file (ar_results.csv). Furthermore, it triggers parseReport and join firm and index name.

Methods


Method new()

Usage

ResultParser$new()


Method parseRequestFile()

Usage

ResultParser$parseRequestFile(path = "01_RequestFile.csv")


Method parseReport()

Usage

ResultParser$parseReport(path = "analysis_report.csv")


Method parseAR()

Usage

ResultParser$parseAR(path = "ar_results.csv", analysisType = "AR")


Method parseCAR()

Usage

ResultParser$parseCAR(path = "car_results.csv", analysisType = "CAR")


Method parseAAR()

Usage

ResultParser$parseAAR(
  path = "aar_results.csv",
  groups = NULL,
  analysisType = "AAR"
)


Method parseCAAR()

Usage

ResultParser$parseCAAR(
  path = "caar_results.csv",
  groups = NULL,
  analysisType = "AAR"
)


Method calcAARCI()

Usage

ResultParser$calcAARCI(
  statistic = "Patell Z",
  p = 0.95,
  twosided = T,
  type = "zStatistic"
)


Method cumSum()

Usage

ResultParser$cumSum(
  df,
  var = "aar",
  timeVar = NULL,
  cumVar = NULL,
  fun = cumsum
)


Method createReport()

Usage

ResultParser$createReport(file = "EventStudy.xlsx")


Method clone()

The objects of this class are cloneable with this method.

Usage

ResultParser$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
if (FALSE) {
# Assume you already performed an Event Study and result files are saved in 
# the actual working directory.
estParser <- ResultParser$new()

# parse request file
estParser$parseRequestFile("01_RequestFile.csv")

# parse result files
estParser$parseReport("Analysis report.csv")
estParser$parseAR("AR results.csv")
estParser$parseAAR("AAR results.csv")
}

Run the code above in your browser using DataLab