Add HierarchicalLinearRegression for Hierarchical DiD#860
Conversation
|
👋 Welcome to CausalPy, @jsakv! Thank you for opening your first pull request! We're excited to have you contribute to the project. 🎉 Here are a few tips to help your PR get merged smoothly:
A maintainer will review your changes soon. Thanks for helping make CausalPy better! 🚀 💼 LinkedIn Shoutout: Once your PR is merged, we'd love to give you a shoutout on LinkedIn to thank you for your contribution! If you're interested, just drop your LinkedIn profile URL in a comment below. |
9da4533 to
f9f0946
Compare
|
Pending on #852 fix to pass CI checks |
|
This PR's failing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #860 +/- ##
==========================================
+ Coverage 95.07% 95.12% +0.05%
==========================================
Files 87 87
Lines 13701 13862 +161
Branches 812 815 +3
==========================================
+ Hits 13026 13186 +160
Misses 479 479
- Partials 196 197 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The PR is ready for review. Let me know what you think @drbenvincent! Key points:
|
|
Thanks for this @jsakv, and apologies for the delayed review! One question before the detailed feedback: do you intend to continue with the experiment wrapper + the marketing-campaign notebook (from #656) in this same PR, or were you planning to land those as separate follow-up PRs? My preference would be to keep them together in this PR if that works for you — it's much easier to review the model, the experiment that uses it, and a worked example as a single coherent unit than as several independent PRs where the model lands without a user-facing entry point. With that said, here's a review of the progress so far. Overall this is a solid foundation and I'm happy with the direction. What's working well
Minor
CI
Happy to defer the data-driven priors to a later PR as you suggested. Let me know your thoughts on keeping the experiment + notebook in this PR and I'll do a fuller review once those land. |
This PR adds the
HierarchicalLinearRegressionwith random intercepts and random slopes.The model takes both a fixed-effect design matrix and a random-effect design matrix, similar to Bambi or Statmodel’s linear mixed effect models.
This PR is part of issue #656 Hierarchical DiD experiment resolution.