Overview

ggdemetra is an extension of ggplot2 to add seasonal adjustment statistics to your plots. The seasonal adjustment process is done with RJDemetra that is an R interface to JDemetra+, the seasonal adjustment software officially recommended to the members of the European Statistical System (ESS) and the European System of Central Banks. RJDemetra implements the two leading seasonal adjustment methods TRAMO/SEATS+ and X-12ARIMA/X-13ARIMA-SEATS.

There are 4 main functionnalities in ggdemetra depending of what you want to add in the graphic:

  • geom_sa(): to add a time series compute during the seasonal adjustment (the trend, the seasonal adjusted time series, etc.).
  • geom_outliers(): to add the outliers used in the pre-adjustment process of the seasonal adjustment.
  • geom_arima(): to add the ARIMA model used in the pre-adjustment process of the seasonal adjustment.
  • geom_diagnostics(): to add a table containing some diagnostics on the seasonal adjustment process.

Installation

Since RJDemetra requires Java SE 8 or later version, the same requirements are also needed for ggdemetra.

If you have troubles with the installation of RJDemetra, check the installation manual.

Usage

By default, the seasonal adjustment is made with X-13-ARIMA with the pre-defined specification “RSA5c” (automatic log detection, automatic ARIMA and outliers detection and trading day and easter adjustment). If no new data or seasonal adjustment specification is specified (method or specification), these parameters is inherited from the previous defined: therefore you only need to specify the specification once. In the following examples, the seasonal adjustment will be perform with X-13-ARIMA with working day adjustment and no gradual easter effect adjustment.

To add the seasonal adjusted series and the forecasts of the input data and of the seasonal adjusted series:

To add the outliers at the bottom of the plot with an arrow to the data point and the estimated coefficients:

To add the ARIMA model:

To add a table of diagnostics below the plot:

See the vignette for more details.