EconPapers    
Economics at your fingertips  
 

CAUSALIMPACT: Stata module to evaluate the Causal impact of an intervention on a time series using a Bayesian structural time-series model

Merwan Roudane

Statistical Software Components from Boston College Department of Economics

Abstract: causalimpact estimates the causal effect of a designed intervention on a time series, using the Bayesian structural time-series (BSTS) approach of Brodersen, Gallusser, Koehler, Remy and Scott (2015). It is a faithful Stata implementation of the R package CausalImpact 1.4.1 (github.com/google/CausalImpact), against which it has been verified on shared data; see help causalimpact rcheck. The idea is a generalisation of difference-in-differences to the time-series setting. A state-space model is fitted to the response over the pre-intervention period only, using a set of control series that were not themselves affected by the intervention. The fitted model is then used to predict what the response would have been over the post-intervention period had the intervention not taken place. That prediction is the counterfactual; the difference between the observed response and the counterfactual is the causal effect.

Language: Stata
Requires: Stata version 14
Keywords: causal effect; counterfactual; tiem series; intervention (search for similar items in EconPapers)
Date: 2026-08-05
Note: This module should be installed from within Stata by typing "ssc install causalimpact". The module is made available under terms of the GPL v3 (https://www.gnu.org/licenses/gpl-3.0.txt). Windows users should not attempt to download these files with a web browser.
References: Add references at CitEc
Citations:

Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/c/causalimpact.ado
http://fmwww.bc.edu/repec/bocode/c/causalimpact.sthlp
http://fmwww.bc.edu/repec/bocode/c/causalimpact_example.do
http://fmwww.bc.edu/repec/bocode/c/causalimpact_interpretation.sthlp
http://fmwww.bc.edu/repec/bocode/c/causalimpact_methods.sthlp
http://fmwww.bc.edu/repec/bocode/c/causalimpact_p.ado
http://fmwww.bc.edu/repec/bocode/c/causalimpact_postestimation.sthlp
http://fmwww.bc.edu/repec/bocode/c/causalimpact_rcheck.sthlp

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s459853

Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php

Access Statistics for this software item

More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2026-08-14
Handle: RePEc:boc:bocode:s459853