CausalPy SyntheticControl With multiple cities in the Treatment

Hi, looking at causalPy example for geolift Bayesian geolift with CausalPy — CausalPy 0.3.0 documentation

Is it possible to include multiple cities in the treatment?

formula = “”"
Denmark ~ 0 + Austria + Belgium + Bulgaria + Croatia + Cyprus + Czech_Republic
“”"

Is there a way to do something like:

formula = “”"
Denmark ~ 0 + Austria ~ 0 + Belgium + Bulgaria + Croatia + Cyprus + Czech_Republic
“”"

Meaning that both Denmark and Austria where subjected to the treatment?

Thank you!

CC @drbenvincent

1 Like

Hi @Joao_Fidalgo. Yes, this is possible to do in CausalPy. I have a PR which is close to getting merged which will show you two different strategies for doing this (Add example analysis of multiple geo lift test analysis by drbenvincent · Pull Request #338 · pymc-labs/CausalPy · GitHub). It doesn’t rely on any new functionality, so as long as you can read the docs then you should be able to do it immediately.

If you don’t want to go to the bother of building the docs from that PR locally, or examining the notebook in that PR, then there is also a high level overview in this Medium blog post that I wrote Multi region geo-lift analysis. How to estimate the effects of… | by Benjamin Vincent | May, 2024 | Medium

Very happy to receive feedback about whether that does what you are looking for, or any other reflections.

1 Like

Hey,
Thank you so much for the quick reply!
The notebook is very clear and answers the question.

Great library by the way, very useful! Congrats!

1 Like