After some nice #OpenSource collaboration, version 0.3.0 of the #rstats penalised #SyntheticControl package "pensynth" is now available on CRAN!  

https://cran.r-project.org/package=pensynth

Do you want to use the synthetic control method for #CausalInference with observational data? Try it out!

(⚡ It's faster than vanilla synthetic controls even without penalty)

pensynth: Penalized Synthetic Control Estimation

Estimate penalized synthetic control models and perform hold-out validation to determine their penalty parameter. This method is based on the work by Abadie & L'Hour (2021) <<a href="https://doi.org/10.1080%2F01621459.2021.1971535" target="_top">doi:10.1080/01621459.2021.1971535</a>>. Penalized synthetic controls smoothly interpolate between one-to-one matching and the synthetic control method.

New  package! For a project, I had to implement penalized synthetic control estimation, and I thought it would be nice to implement it "properly" so others could use it too.

https://github.com/vankesteren/pensynth

It also has a basic form of cross-validation to automatically determine the penalty parameter.

Feel free to try out / comment / collaborate!  

#rstats #statistics #economics #SyntheticControl #PolicyEvaluation #CausalInference

GitHub - vankesteren/pensynth: Penalized synthetic control estimation

Penalized synthetic control estimation. Contribute to vankesteren/pensynth development by creating an account on GitHub.

GitHub

The basic idea of #SyntheticControl for #causalinference is actually really simple.

Find out more in my #pydataglobal talk tomorrow
https://global2022.pydata.org/cfp/talk/FQBSP8/

What-if? Causal reasoning meets Bayesian Inference PyData Global 2022

## Core objectives: - Make the case that causal reasoning is required to answer many important questions in research and business. - Flesh out how causal reasoning and Bayesian inference complement each other. - Convey how some what-if questions can be answered using Synthetic Control methods. - Illustrate how to use Synthetic Control methods in practice with a worked example with Python code snippets (using PyMC) and empirical results. - Introduce the new Python package [CausalPy](https://github.com/pymc-labs/CausalPy). The talk will be a high-level overview, with very few (if any) equations. Rather, I focus on conveying the intuition and practical steps to answer what-if questions through concrete examples. I will provide references for those wishing to flesh out their understanding after the talk. This talk is aimed at a broad audience - anyone wanting to learn about the causal structure of the world, whether for fun or profit. Knowledge of causal inference is not assumed, but a beginner to intermediate knowledge of data science would be beneficial. Some familiarity with Bayesian methods would be beneficial, but are not required. ## Talk structure: - I will provide an overview of ‘what-if?’ questions including: “What would have happened to this patient if they had taken the drug rather than the placebo?” or “How much did an advertising campaign drive the change in user sign-ups?” - Establish why we cannot solve our problems with traditional statistical and data science methods in the absence of causal reasoning. - Describe how causal reasoning questions are complemented by the Bayesian approach, namely quantifying our uncertainty, and a focus on parameter estimation instead of hypothesis testing with p-values. - One main example will focus on how to approach the question “How did Brexit causally affect the United Kingdom’s GDP despite this not being a randomized experiment?” I will intuitively explain how the Synthetic Control method works (by creating a synthetic United Kingdom as a weighted sum of other countries unaffected by Brexit) and how we can implement this, with PyMC code snippets. - I will summarize by: a) outlining the bounds of Synthetic Control and when other approaches are called for, b) highlight available Python and R packages (CausalImpact, tfcausalimpact, GeoLift, and a PyMC-based solution), and c) providing further reading and learning resources. ## References - Cunningham, Scott. "Causal inference." Causal Inference. Yale University Press, 2021 - Huntington-Klein, N. (2021). The effect: An introduction to research design and causality. Chapman and Hall/CRC. - Facure, M (2021) Causal Inference for The Brave and True, https://github.com/matheusfacure/python-causality-handbook ## GitHub repository A supporting GitHub repository, with notebooks, can be found at [drbenvincent/pydata-global-2022](https://github.com/drbenvincent/pydata-global-2022).

They basically do the same that I did. They estimate a #SyntheticControl based on binary treatment classification of areas from where tests were dispatched to #Immensa lab.

Its funny how their and my figures a year later are so similar.

It highlights: data access is a key barrier as they had slightly better data. But this was entirely avoidable.

In fact, I did launch a #FreedomOfInformation #FOI request last year to request the data that the #UKHSA team was using...

Now that FOI...

@WeinbergEcon ahah that's fair. Well I also put #syntheticControl, long but unmistakable. The query is not producing much! Maybe some appropriate tags can help. @paulgp @johnholbein @marcfbellemare 🖖

Alright tooter, here comes my first #EconTwitter question.

What is your favourite recent paper applying #SyntheticControl ?

I am currently reading Hansen & McNichols (2020) but am looking for more. Working on a synth project and want to see what's considered best practice in applied settings. Dw, I have the theory side covered!

#econometrics #synth