knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) options("getSymbols.warning4.0"=FALSE)
AbnormalReturns implements the event study methodology and abnormal returns in particular. The event study methodology is a common way to study the effects of certain events on stock prices. It thus calculates a so-called abnormal return that measures the impact without confounding influences. As part of this method, one first has to predict a normal return in the absence of the event under study. Afterwards, one calculates the difference between the actual return and the previously predicted normal return, i.e. the abnormal return.
AbnormalReturns provides a function abnormalReturn()
, that returns a data frame including the abnormal returns and the cumulative abnormal returns for all events.
To see example function calls, check out the help pages and the vignette.
Using the devtools package, you can easily install the latest development version of AbnormalReturns with
install.packages("devtools") # Option 1: download and install latest version from ‘GitHub’ devtools::install_github("axelperschmann/AbnormalReturns") # Option 2: install directly from bundled archive # devtoos::install_local("AbnormalReturns_0.1-0.tar.gz")
Notes:
In the case of option 2, you have to specify the path either to the directory of AbnormalReturns or to the bundled archive AbnormalReturns_0.1-0.tar.gz
A CRAN version has not yet been released.
This section shows the basic functionality of how to compute the abnormal returns for an arbitrary commodity and it's corresponding market portfolio. First, load the corresponding package AbnormalReturns.
library(AbnormalReturns)
This simple example computes the abnormal returns for commodity Adidas and market portfolio DAX for the year 2015, based on an estimationWindowLength
of 10.
The result is a data-frame with one row per result and five columns describing Date, abnormalReturn, cumulativeAbnormalReturn and actual stock return.
It also shows a visualization of the commodity performance and the corresponding abnormal returns.
abnormal = abnormalReturn(prices_stock="ADS.DE", prices_market="%5EGDAXI", model="marketmodel", from="2015-01-01", to="2015-12-31", estimationWindowLength=10, c=3, attributeOfInterest="Close", showPlot=TRUE) head(abnormal) summary(abnormal$abnormalReturn)
AbnormalReturns is released under the MIT License
Copyright (c) 2016 Axel Perschmann, Stefan Feuerriegel & Nicolas Pröllochs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.