Based on the Dieselgate scandal we want to show you how you are able to fetch data in R, perform an Event Study, and do some basic plots with our R package.

Data Preparation

We use the package tidyquant to fetch the automotive stock data from Yahoo Finance. As we cannot get the full volume size from this companies through Yahoo Finance API, we do not perform a volume Event Study in this vignette.

Let’s define the window from which we want to fetch the data of the German auto companies.

We focus us on the big five motor manufacturers in Germany, namely

  • VW Group
    • VW
    • Audi
    • Porsche
  • Daimler
  • BMW

As reference market we choose the DAX.

Now, after we have fetched all the data, we prepare the data files for the API call, as described in the introductionary vignette. We prepare in this step already the volume data for later purposes.

Finally, we have to prepare the request file. The parameters for this Event Study are:

  • Estimation window: 250
  • Event window: -10 to 10
  • Event date: 18.09.2015

Details of the format can be found in the introductionary vignette.

Perform Event Studies: Abnormal Return, Volume, and Volatility

After the preparation steps, we are now able to start the calculations. We use in all type of Event Studies the GARCH(1, 1) model. Please consider in your Event Studies that fitting this model is computationally expensive and delayed response from the API should be expected.