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.)

  • $\begingroup$ 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. $\endgroup$ – gung Nov 19 '15 at 19:30
  • 1
    $\begingroup$ 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. $\endgroup$ – Michael Nov 19 '15 at 21:08

I would frame your analysis question as: What is the causal effect of the campaign on orders in countries that were targeted by the campaign?

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.

Note that it's probably useful to add further predictor variables, as long as these are not themselves affected by the campaign and as long as their association with the response variable is stable over time.

  • $\begingroup$ Thank you so much Kay. This is exactly the answer I was looking for. I did supply additional predictor variables gathered from Google Trends. $\endgroup$ – Michael Nov 23 '15 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.