# CausalImpact with Custom BSTS Model

I'm wanting to use a custom bsts model within the CausalImpact package, and I understand that I need to use a control group in my data; however, I don't really understand where that control group fits within the bsts model.

I know my dependent variable is from the test group and that my independent variables are from the control group. I'm confused at how that looks when actually making the model.

For example, if I want to predict sessions of the test group, would I just have a few control groups and use their sessions to predict? Or do I use one control group and use its predictor values?

Here's the code I would theoretically write for both of those scenarios:

Scenario 1:

bsts( test_sessions ~ control1_sessions + control2_sessions + control3_sessions, data = data, ss, niter = 1000)


Scenario 2:

bsts(test_sessions ~ control1_adwords+ control1_paidkeywords+ control1_organickeywords, data = data, ss, niter = 1000)


Of course it makes sense to take variables that are expected to be predictive for the response of interest. But even including variables that are not predictive should not hurt the model as CausalImpact performs automatic variable selection (a random noise variable should automatically be excluded). Concretely: if control1_adwords and control2_paidkeywords (they needn't be from the same control group) are good predictors for test_sessions in the pre-intervention period, it's fine to include them as predictors in addition to control1_sessions, control2_sessions, etc.