Skip to content

Conversation

@igerber
Copy link
Owner

@igerber igerber commented Jan 17, 2026

  • Add diff_diff/datasets.py module with functions to load classic econometric datasets for DiD analysis:

    • load_card_krueger(): Card & Krueger (1994) minimum wage study
    • load_castle_doctrine(): Castle Doctrine / Stand Your Ground laws
    • load_divorce_laws(): Unilateral divorce laws (Stevenson-Wolfers)
    • load_mpdta(): Minimum wage panel data from R did package
    • list_datasets(): List available datasets with descriptions
    • load_dataset(): Load dataset by name
    • clear_cache(): Clear locally cached datasets
  • Add docs/tutorials/09_real_world_examples.ipynb with comprehensive examples demonstrating:

    • Classic 2x2 DiD with Card-Krueger data
    • Staggered adoption with Castle Doctrine data
    • Long panel staggered DiD with divorce laws data
    • TWFE bias and Bacon decomposition
    • Callaway-Sant'Anna and Sun-Abraham estimators
    • Event study visualizations
  • Add tests/test_datasets.py with 22 tests covering:

    • Dataset structure validation
    • Fallback data generation
    • Integration with DiD estimators
  • Update init.py to export dataset functions

  • Update CLAUDE.md and TODO.md documentation

- Add diff_diff/datasets.py module with functions to load classic
  econometric datasets for DiD analysis:
  - load_card_krueger(): Card & Krueger (1994) minimum wage study
  - load_castle_doctrine(): Castle Doctrine / Stand Your Ground laws
  - load_divorce_laws(): Unilateral divorce laws (Stevenson-Wolfers)
  - load_mpdta(): Minimum wage panel data from R did package
  - list_datasets(): List available datasets with descriptions
  - load_dataset(): Load dataset by name
  - clear_cache(): Clear locally cached datasets

- Add docs/tutorials/09_real_world_examples.ipynb with comprehensive
  examples demonstrating:
  - Classic 2x2 DiD with Card-Krueger data
  - Staggered adoption with Castle Doctrine data
  - Long panel staggered DiD with divorce laws data
  - TWFE bias and Bacon decomposition
  - Callaway-Sant'Anna and Sun-Abraham estimators
  - Event study visualizations

- Add tests/test_datasets.py with 22 tests covering:
  - Dataset structure validation
  - Fallback data generation
  - Integration with DiD estimators

- Update __init__.py to export dataset functions
- Update CLAUDE.md and TODO.md documentation
igerber pushed a commit that referenced this pull request Jan 17, 2026
- Remove unused imports (hashlib, os, Optional) from datasets.py
- Clear notebook outputs for cleaner version control
- Improve seed comments for better clarity on reproducibility
@igerber igerber merged commit 118e3d7 into main Jan 17, 2026
4 checks passed
@igerber igerber deleted the claude/add-real-world-examples-Ut7pi branch January 17, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants