Skip to content

Feature: Panel Fixed Effects (PanelRegression experiment class)#670

Closed
drbenvincent wants to merge 4 commits intomainfrom
panel-regression
Closed

Feature: Panel Fixed Effects (PanelRegression experiment class)#670
drbenvincent wants to merge 4 commits intomainfrom
panel-regression

Conversation

@drbenvincent
Copy link
Collaborator

@drbenvincent drbenvincent commented Jan 16, 2026

Summary

Add a PanelRegression experiment with fixed effects support, diagnostics, and docs.

Closes #627

Changes

  • Add PanelRegression experiment with within/dummies FE and plotting helpers
  • Export the new experiment and add validation/plot data tests
  • Add a panel fixed effects notebook and docs index entry
  • Refresh the interrogate badge from pre-commit

Testing

  • pre-commit run --all-files
  • python -m pytest causalpy/tests/ -x -v

Checklist

  • Pre-commit checks pass
  • All tests pass
  • Documentation updated (if applicable)
  • Follows project coding conventions

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

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions bot added the enhancement New feature or request label Jan 16, 2026
@drbenvincent drbenvincent marked this pull request as draft January 16, 2026 20:42
@drbenvincent
Copy link
Collaborator Author

drbenvincent commented Jan 16, 2026

  • Initial stab at the docs notebook was poor.
    • Did not conform to the structure laid out in the issue, and one of the plot functions errored.
    • References section didn't work because of incorrect citation format
    • Text uses hard wrapping with line breaks, but it should use soft wrapping without the new lines. Let auto word wrap take care of that.
  • Code seems pretty good. But no docstrings.

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 39.42029% with 209 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.94%. Comparing base (b5de507) to head (a13f90a).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
causalpy/experiments/panel_regression.py 33.86% 195 Missing and 14 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #670      +/-   ##
==========================================
- Coverage   94.38%   91.94%   -2.44%     
==========================================
  Files          44       46       +2     
  Lines        7517     7862     +345     
  Branches      456      511      +55     
==========================================
+ Hits         7095     7229     +134     
- Misses        261      457     +196     
- Partials      161      176      +15     

☔ 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.

@drbenvincent
Copy link
Collaborator Author

I should work through a bunch of examples and see how the functionality compares to related packages

@read-the-docs-community
Copy link

Documentation build overview

📚 causalpy | 🛠️ Build #31148705 | 📁 Comparing a13f90a against latest (b5de507)


🔍 Preview build

Show files changed (25 files in total): 📝 7 modified | ➕ 18 added | ➖ 0 deleted
File Status
404.html 📝 modified
genindex.html 📝 modified
py-modindex.html 📝 modified
_modules/index.html 📝 modified
knowledgebase/quasi_dags.html 📝 modified
notebooks/index.html 📝 modified
notebooks/panel_fixed_effects_pymc.html ➕ added
api/generated/causalpy.experiments.html 📝 modified
api/generated/causalpy.experiments.panel_regression.PanelRegression.init.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.effect_summary.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.fit.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.get_plot_data.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.get_plot_data_bayesian.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.get_plot_data_ols.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.input_validation.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.plot.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.plot_coefficients.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.plot_residuals.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.plot_trajectories.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.plot_unit_effects.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.print_coefficients.html ➕ added
api/generated/causalpy.experiments.panel_regression.PanelRegression.summary.html ➕ added
api/generated/causalpy.experiments.panel_regression.html ➕ added
_modules/causalpy/experiments/panel_regression.html ➕ added

@drbenvincent
Copy link
Collaborator Author

Superseded by #628. Same feature (PanelRegression for #627); we're consolidating on #628, which has the review fixes, correct __init__ pipeline, and full test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Panel Fixed Effects (PanelRegression experiment class)

1 participant