- Yoonkang Low

# Causal Impact Analysis in R, and now Python!

**What is Causal Impact?**

According to __the dedicated web page__, Causal Impact implements an approach to **estimate the causal effect of a designed intervention on a time series**. For example, how many additional daily clicks were generated by an advertising campaign? Answering a question like this can be difficult when a randomized experiment is not available.

**How does it work?**

Given a response time series (e.g., clicks) and a set of control time series (e.g., clicks in non-affected markets or clicks on other sites), the package constructs a **Bayesian structural time-series model**. This model is then used to try and predict the *counterfactual*, i.e., how the response metric would have evolved after the intervention if the intervention had never occurred.

**How do I get started in R?**

The __dedicated web page__ has a very comprehensive run-through, that includes:

Installing the package

Creating an example dataset

Running analysis

Plotting Results

Working with dates and times

Extracting and printing summary statistics

Adjusting the model

Customising the model

**How do I get started in Python?**

Recently, Jamal Senouci has "translated" the Causal Impact analysis package from R to Python! I've compiled a walk through__ on my github page__ for Python users so you too can now reap the benefits of this very useful package! I've included a link to Jamal's __original page__ too.

Please __click here to get started!__

__Yoonkang Low__ is a freelance Analytical and Data Science consultant with over 9 years experience, including time with analytical agencies, and at Amazon.