Steve Spitz
November 23, 2014
CausalImpact: An R package for causal inference using
Bayesian structural time-series models
.
Version 1.0.3 Licensed under the Apache License, Version 2.0.
Author: Kay H. Brodersen
Copyright © 2014 Google, Inc.
Experimental test and control, without doing an experiment!
The Causal Impact R package uses time-series data to estimate the causal effect of designed interventions. It is used when randomized experiments are not available. For example, how many additional daily clicks were generated by an advertising campaign?
Although Causal Impact was developed to detect changes during an intervention, it can be used to check changes in time-series from many fields, including economics, epidemiology, political science, and social science.
Causal Impact uses sequential Bayes to model what should have happened without an intervention. This model constitues a 'control' time-series. Then the difference between acutal and control, post- vs. pre-intervention, is tested for significance.
The graph below appears in the shiny app with default settings:
The top panel, labeled original, shows the simulated time-series. The middle panel, pointwise, shows the pointwise difference between the actual time-series and the modeled control series (dotted line). The bottom panel, cumulative, shows the cumuluative difference between actual and control. In this case, the shaded uncertainty region is well above zero, indicating a significant intervention.
.
Go To Causal Impact Shiny App
The graph below is from the shiny app with the Tree Ring data set selected:
In the context of tree ring data, an 'intervention' would indicate some significant change in the climate. In this graph, the lower panel shows no significant change, as zero is contained well within the shaded uncertainty region.
.
Go To Causal Impact Shiny App
The graph below can be viewed in the shiny app with the Tree Ring dataset selected and the number of observations set to 200:
For tree ring data, an 'intervention' would indicate a change in climate. Now, the lower panel shows a significant increase in tree ring widths, suggesting a climate more favorable to growth.
.
Go To Causal Impact Shiny App