Skip to content

Commit 447970b

Browse files
committed
perfecting the ITS section
1 parent d5d61df commit 447970b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/source/quasi_dags.ipynb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
"source": [
218218
"## Interrupted Time Series\n",
219219
"\n",
220-
"A causal DAG for interrupted time series is given in Chapter 17 of {cite:t}`huntington2021effect`, though uses the [Event Study](https://theeffectbook.net/ch-EventStudies.html) label. These kinds of studies are suited to situations where an intervention is made at a given point in time at which we move from untreated to treated. Typically, we consider situations where there are a 'decent' number of observations over time. Here's the causal DAG - note that $\\text{time}$ represents all the things changing over time such as the time index as well as time-varying predictor variables."
220+
"A causal DAG for interrupted time series quasi-experiment is given in Chapter 17 of {cite:t}`huntington2021effect`, though they are labelled as [Event Studies](https://theeffectbook.net/ch-EventStudies.html). These kinds of studies are suited to situations where an intervention is made at a given point in time at which we move from untreated to treated. Typically, we consider situations where there are a 'decent' number of observations over time. Here's the causal DAG - note that $\\text{time}$ represents all the things changing over time such as the time index as well as time-varying predictor variables."
221221
]
222222
},
223223
{
@@ -262,9 +262,13 @@
262262
"source": [
263263
"What we want to understand is the causal effect of the treatment upon the outcome, $Z \\rightarrow Y$. But we have a back door path between $Z$ and $Y$ which will make this hard, $Z \\leftarrow \\text{after treatment} \\leftarrow \\text{time} \\rightarrow Y$.\n",
264264
"\n",
265-
"The approach taken is:\n",
266-
"1. Use the pre-treatment data only to create a prediction of what would have happened in the absence of treatment (i.e. the counterfactual). Splitting the dataset like this breaks the back door by removing any variation in $\\text{after treatment}$, all values are 0.\n",
267-
"2. If we can assume that in the absence of the treatment, nothing would have changed, then this counterfactual estimate will be unbiased and we can estimate the treatment effect by comparing the observed (post-treatment) data (where all values of $\\text{after treatment}$ are 1) with the counterfactual. "
265+
":::{note}\n",
266+
"Below is an attempt to explain one way that we can deal with this. Though it is a bit of a brain-twister and can take some time to get your head around. Thanks to Nick Huntington-Klein for some clarification in [this twitter thread](https://twitter.com/inferencelab/status/1783882438063661374).\n",
267+
":::\n",
268+
"\n",
269+
"One approach we can use is:\n",
270+
"1. We want to close the backdoor path, and one way to do this is to split the dataset into two parts: pre-treatment and post-treatment. By fitting a model only to the pre-treatment data, we have removed any variation in $\\text{after treatment}$ (all values are $0$), so there is now no variation in $Z$ caused by $\\text{time}$. This is one way to close a backdoor path, and means that a model fitted to this data (e.g. $Y_{\\text{pre}} \\sim f(\\text{time}_{\\text{pre}})$) will not be biased by the backdoor path.\n",
271+
"2. However, our goal is to estimate the causal effects of the treatment $Z \\rightarrow Y$, but we have just removed any variation in $Z$ and it does not appear in the aforementioned model, $Y_{\\text{pre}} \\sim f(\\text{time}_{\\text{pre}})$, so our work is not done. One way to deal with this is to use the model to predict what would have happened in the post-treatment era if no treatment had been given. If we make the assumption that nothing would have changed in the absence of treatment, then this will be an unbiased estimate of the counterfactual. By comparing the counterfactual with the observed post-treatment data, we can estimate the treatment effect $Z \\rightarrow Y$. By focussing only on the post-treatment data we are looking at empirical outcomes $Y_\\text{post}$ which are affected by treatment $Z = 1$, but have closed the back door because all $\\text{after treatment} = 1$. The final comparison (subtraction) between the counterfactual estimate and the observed post-treatment data gives us the estimated treatment effect."
268272
]
269273
},
270274
{

0 commit comments

Comments
 (0)