# Causal impact response time series

I am trying to analyze the effects of an online advertising campaign. The campaign was in market globally except for "Country A". In my response time series, I am using orders from all countries except "Country A". As one of my controls, I am using orders from "Country A" only. Is this the logically appropriate way to set up this analysis, or should the response variable include all orders, irrespective of country?

(Note, I am using the CausalImpact library from R.)

• It isn't clear if you are asking how to use this package, or if you are asking what the logically appropriate way to set up this analysis is. Note that if you are asking about how to use R, that would be off topic here. Please edit your question to clarify. – gung Nov 19 '15 at 19:30
• Edited for clarification. I changed "is this the correct way" to "is this the logically appropriate way to set up this analysis". Hopefully that clarifies. – Michael Nov 19 '15 at 21:08

In causal inference terms, this means asking about the causal effect of treatment on the treated. So your response variable should be all orders except for country A, and your predictor variable should be orders from country A. Using a model for counterfactual inference (e.g., CausalImpact), you can then compute an estimate of the time series of orders in all targeted countries had they not been targeted. The difference between observed orders and counterfactual orders provides you with an estimate of the causal effect of the campaign.