Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new Difference In Differences notebook #424

Merged
merged 21 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,257 changes: 1,257 additions & 0 deletions examples/causal_inference/difference_in_differences.ipynb

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions examples/causal_inference/make_DAG_difference_in_differences.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import daft
import matplotlib.pyplot as plt

plt.rcParams.update({"text.usetex": True})

pgm = daft.PGM()
pgm.add_node("treat", "treatment", 0, 0.5, aspect=1.8)
pgm.add_node("y", "outcome", 0, -0.5, aspect=1.5)
pgm.add_node("t", "time", -1, 0, aspect=1.2)
pgm.add_node("g", "group", 1, 0, aspect=1.2)
pgm.add_edge("t", "y")
pgm.add_edge("g", "y")
pgm.add_edge("t", "treat")
pgm.add_edge("g", "treat")
pgm.add_edge("treat", "y")
pgm.render()
pgm.savefig("DAG_difference_in_differences.png", dpi=500)
37 changes: 37 additions & 0 deletions examples/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ @book{berry1996statistics
year = {1996},
publisher = {Duxbury Press}
}
@article{bertrand2004much,
title = {How much should we trust differences-in-differences estimates?},
author = {Bertrand, Marianne and Duflo, Esther and Mullainathan, Sendhil},
journal = {The Quarterly journal of economics},
volume = {119},
number = {1},
pages = {249--275},
year = {2004},
publisher = {MIT Press}
}
@book{breen1996regression,
title = {Regression models: Censored, sample selected, or truncated data},
author = {Breen, Richard and others},
Expand Down Expand Up @@ -78,6 +88,12 @@ @article{caprani2010gev
url = {https://www.sciencedirect.com/science/article/pii/S016747300900071X},
author = {Colin C. Caprani and Eugene J. OBrien}
}
@misc{card1993minimum,
title = {Minimum wages and employment: A case study of the fast food industry in New Jersey and Pennsylvania},
author = {Card, David and Krueger, Alan B},
year = {1993},
publisher = {National Bureau of Economic Research Cambridge, Mass., USA}
}
@misc{carpenter2016hierarchical,
title = {Hierarchical partial pooling for repeated binary trials},
author = {Carpenter, Bob and Gabry, J and Goodrich, B},
Expand Down Expand Up @@ -114,6 +130,12 @@ @article{collinswilson2019
issn = {2050-084X},
publisher = {eLife Sciences Publications, Ltd}
}
@book{cunningham2021causal,
title = {Causal inference: The Mixtape},
author = {Cunningham, Scott},
year = {2021},
publisher = {Yale University Press}
}
@article{efron1975data,
title = {Data analysis using Stein's estimator and its generalizations},
author = {Efron, Bradley and Morris, Carl},
Expand Down Expand Up @@ -240,6 +262,12 @@ @misc{hogg2010data
archiveprefix = {arXiv},
primaryclass = {astro-ph.IM}
}
@book{huntington2021effect,
title = {The effect: An introduction to research design and causality},
author = {Huntington-Klein, Nick},
year = {2021},
publisher = {Chapman and Hall/CRC}
}
@article{iacobucci2016mean,
title = {Mean centering helps alleviate ``micro'' but not ``macro'' multicollinearity},
author = {Iacobucci, Dawn and Schneider, Matthew J and Popovich, Deidre L and Bakamitsos, Georgios A},
Expand Down Expand Up @@ -530,6 +558,15 @@ @book{wilkinson2005grammar
issn = {1431-8784},
isbn = {978-0-387-24544-7}
}
@article{wing2018designing,
title = {Designing difference in difference studies: best practices for public health policy research},
author = {Wing, Coady and Simon, Kosali and Bello-Gomez, Ricardo A},
journal = {Annu Rev Public Health},
volume = {39},
number = {1},
pages = {453--469},
year = {2018}
}
@article{Yao_2018,
doi = {10.1214/17-ba1091},
url = {https://doi.org/10.1214\%2F17-ba1091},
Expand Down
Loading