|
6 | 6 | "source": [ |
7 | 7 | "# Banking dataset with a `pymc` model\n", |
8 | 8 | "\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", |
9 | 17 | "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." |
10 | 18 | ] |
11 | 19 | }, |
|
650 | 658 | ] |
651 | 659 | }, |
652 | 660 | { |
653 | | - "cell_type": "code", |
654 | | - "execution_count": null, |
| 661 | + "cell_type": "markdown", |
655 | 662 | "metadata": {}, |
656 | | - "outputs": [], |
657 | 663 | "source": [ |
658 | | - "from causalpy.pymc_experiments import DifferenceInDifferences\n", |
659 | | - "from causalpy.pymc_models import LinearRegression\n", |
| 664 | + "<div class=\"alert alert-info\">\n", |
660 | 665 | "\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>" |
685 | 671 | ] |
686 | 672 | }, |
687 | 673 | { |
688 | | - "cell_type": "code", |
689 | | - "execution_count": null, |
| 674 | + "cell_type": "markdown", |
690 | 675 | "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": [] |
696 | 677 | } |
697 | 678 | ], |
698 | 679 | "metadata": { |
|
0 commit comments