Skip to content

Conversation

mercury0100
Copy link
Contributor

@mercury0100 mercury0100 commented Aug 26, 2025

Addressed issue #516 by improving the TWFE explanation in the did_pymc_banks.ipynb notebook.

Changes made

  • Introduced $\gamma$ as the global intercept term to avoid overloading $\alpha$.

  • Updated equation to use \text{} for dataset variable names (district, year, post_treatment) to improve readability and rendering.

  • Revised bullet-point explanations to match the updated notation and ensure consistency (e.g., $i^{\text{th}}$ instead of $i^{th}$).

  • Clarified distinction between parameters ($\alpha$, $\beta$, $\gamma$, $\Delta$) and observed covariates (district, year, post_treatment).

These changes improve equation rendering, remove contradictory notation around $\alpha$, and make the explanation easier to follow for users who are new to TWFE models


📚 Documentation preview 📚: https://causalpy--522.org.readthedocs.build/en/522/

mercury0100 and others added 2 commits August 26, 2025 18:58
- Introduced γ as the global intercept to avoid overloading α
- Wrapped dataset variable names (district, year, post_treatment) in \text{} for clearer rendering
- Improved equation layout with consistent notation and salmon labels
- Revised explanatory bullets for consistency with updated notation
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@drbenvincent drbenvincent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! Thanks for this. Happy to merge, but any chance we can correct the "" appearing in the rendered docs preview in the post treatment term?

Image

@drbenvincent drbenvincent added the documentation Improvements or additions to documentation label Aug 28, 2025
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.19%. Comparing base (2016ff8) to head (638deb2).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #522   +/-   ##
=======================================
  Coverage   95.19%   95.19%           
=======================================
  Files          28       28           
  Lines        2457     2457           
=======================================
  Hits         2339     2339           
  Misses        118      118           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mercury0100
Copy link
Contributor Author

Hey @drbenvincent , dont know how I missed that! I've fixed the "" if you want to check.

@drbenvincent drbenvincent changed the title Fix issue 516 Improve clarity of TWFE explanation Aug 29, 2025
Copy link
Collaborator

@drbenvincent drbenvincent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mercury0100

@drbenvincent drbenvincent merged commit 23e0f3e into pymc-labs:main Aug 29, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants