Skip to content

Commit 648c498

Browse files
committed
#76 #44 tweaks to DID banks example
1 parent c7f28e3 commit 648c498

File tree

1 file changed

+17
-36
lines changed

1 file changed

+17
-36
lines changed

docs/notebooks/did_pymc_banks.ipynb

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
"source": [
77
"# Banking dataset with a `pymc` model\n",
88
"\n",
9+
"<div class=\"alert alert-warning\">\n",
10+
"\n",
11+
"Warning\n",
12+
"\n",
13+
"We are still refining the difference in differences analysis code. Expect improvements soon.\n",
14+
"\n",
15+
"</div>\n",
16+
"\n",
917
"This notebook analyses historic data on banking closures from [Richardson & Troost (2009)](http://masteringmetrics.com/wp-content/uploads/2015/02/Richardson_Troost_2009_JPE.pdf) and used as a case study for a difference in differences analysis in the [Mastering Metrics](http://www.masteringmetrics.com) book. Here, we replicate this analysis, but using Bayesian inference."
1018
]
1119
},
@@ -650,49 +658,22 @@
650658
]
651659
},
652660
{
653-
"cell_type": "code",
654-
"execution_count": null,
661+
"cell_type": "markdown",
655662
"metadata": {},
656-
"outputs": [],
657663
"source": [
658-
"from causalpy.pymc_experiments import DifferenceInDifferences\n",
659-
"from causalpy.pymc_models import LinearRegression\n",
664+
"<div class=\"alert alert-info\">\n",
660665
"\n",
661-
"result = DifferenceInDifferences(\n",
662-
" df_long,\n",
663-
" formula=\"bib ~ 1 + district + year + district:treated\",\n",
664-
" time_variable_name=\"year\",\n",
665-
" prediction_model=LinearRegression(),\n",
666-
")"
667-
]
668-
},
669-
{
670-
"cell_type": "code",
671-
"execution_count": null,
672-
"metadata": {},
673-
"outputs": [],
674-
"source": [
675-
"fig, ax = result.plot()"
676-
]
677-
},
678-
{
679-
"cell_type": "code",
680-
"execution_count": null,
681-
"metadata": {},
682-
"outputs": [],
683-
"source": [
684-
"result.summary()"
666+
"Note\n",
667+
"\n",
668+
"Coming soon!\n",
669+
"\n",
670+
"</div>"
685671
]
686672
},
687673
{
688-
"cell_type": "code",
689-
"execution_count": null,
674+
"cell_type": "markdown",
690675
"metadata": {},
691-
"outputs": [],
692-
"source": [
693-
"ax = az.plot_posterior(result.causal_impact, ref_val=0)\n",
694-
"ax.set(title=\"Posterior estimate of causal impact\");"
695-
]
676+
"source": []
696677
}
697678
],
698679
"metadata": {

0 commit comments

Comments
 (0)