From 8423a6c544cd8f7d9ef6d1b1a9fb7475f21c3612 Mon Sep 17 00:00:00 2001 From: Stiofain Fordham <17852477+sdfordham@users.noreply.github.com> Date: Sun, 19 Nov 2023 15:05:13 +0000 Subject: [PATCH] Add ATT method to the texas nb --- examples/texas.ipynb | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/examples/texas.ipynb b/examples/texas.ipynb index da6df5a..8a3ecdc 100644 --- a/examples/texas.ipynb +++ b/examples/texas.ipynb @@ -35,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -210,6 +210,40 @@ "synth.gaps_plot(time_period=range(1985, 2001), treatment_time=1993)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Compute the average treatment effect on the treated unit (ATT) over the post-treatment time period. This method returns a standard error also." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'att': 20339.375838131393, 'se': 3190.4946788704715}" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "synth.att(time_period=range(1993, 2001))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The summary function give more information on the predictor values. The first column shows the value of the $V$ matrix for each predictor, the column 'treated' shows the mean value of each predictor for the treated unit over the time period `time_predictors_prior`, the column 'synthetic' shows the mean value of each predictor for the synthetic control over the time period `time_predictors_prior` and finally the column 'sample mean' shows the sample mean of that predictor for all control units over the time period `time_predictors_prior` i.e. this is the same as the synthetic control with all weights equal." + ] + }, { "cell_type": "code", "execution_count": 6, @@ -389,7 +423,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]" + "version": "3.10.4" }, "orig_nbformat": 4, "vscode": {