-
Notifications
You must be signed in to change notification settings - Fork 77
Propensity score Joint Estimation Versus 2 stage Estimation #500
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #500 +/- ##
=======================================
Coverage ? 95.15%
=======================================
Files ? 28
Lines ? 2435
Branches ? 0
=======================================
Hits ? 2317
Misses ? 118
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:09Z Can you briefly describe what you want to compare, just to keep the storyline flow? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:10Z Can you please remove this output ? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:11Z @NathanielF Thank you for this simulation! I wanted to do this for years, and this makes everything very clear! |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:11Z Could you please add an explanation for this section? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:12Z Can you please add explanation on what these numbers represent (again, for the non-expert users) |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:12Z can you please remove this output? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:13Z Can you add explanation of this model comparison |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:13Z Again, can you please add some explanatory test here? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:14Z Can you please remove this output? |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-07-12T08:29:14Z Can you please remove this output? |
Honestly it's super annoying. Think related to a bug or mismatch between pymc and apple mac: https://discourse.pymc.io/t/dataset-size-dependent-eoferror/11977/14 View entire conversation on ReviewNB |
Signed-off-by: Nathaniel <[email protected]>
Done. View entire conversation on ReviewNB |
Not sure i remember how to link section headings? View entire conversation on ReviewNB |
I left this as it was View entire conversation on ReviewNB |
added a box to this effect View entire conversation on ReviewNB |
Left this as it was. Seemed overkill View entire conversation on ReviewNB |
added dims View entire conversation on ReviewNB |
added a box to highlight.
Re: IV models. I think it's different the equations aren't directly influencing one another. The outcomes of the two equations in the IV are being modelled in the likelihood as a bivariate potentially correlated pair. I think an instrument plays a different role than a propensity score and the modularity isn't required in the same way. View entire conversation on ReviewNB |
renamed View entire conversation on ReviewNB |
I.E. one prediction doesn't feed into the next, we just allow that there maybe some correlation between both predictions View entire conversation on ReviewNB |
I've added the Fan li reference throughout. It's mainly her talk and paper that i'm referring to here. Added again in the conclusion, rather than here because it's more likely to spur follow up there. View entire conversation on ReviewNB |
Added View entire conversation on ReviewNB |
used item accessor to tidy View entire conversation on ReviewNB |
used item accessor to tidy View entire conversation on ReviewNB |
Fixed View entire conversation on ReviewNB |
hidden View entire conversation on ReviewNB |
added. View entire conversation on ReviewNB |
added reference to Hernan's book here. View entire conversation on ReviewNB |
hidden View entire conversation on ReviewNB |
added more citations View entire conversation on ReviewNB |
hidden View entire conversation on ReviewNB |
added a spline plot and admonition box explaining the idea View entire conversation on ReviewNB |
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Working on a draft PR to improve or augment the existing propensity scoring weighting implementation. In particular to make it a bit faster and more "Bayesian". As it currently stands we are performing a two-step strategy where we fit a propensity score model and then push the values of the posterior estimate for the propensity score through a re-weighting routine to estimate the causal contrast.
But we could try and explore a more properly Bayesian model where we fit the propensity score outcome and the model outcome at once in the same model context. This more properly Bayesian and a good bit faster.
See for instance, work here: https://github.com/ajnafa/Latent-Bayesian-MSM by Jordan Nafa and Andrew Heiss
---- EDIT ----
So i think i've finally understood the role of the propensity score in Bayesian estimation and I demonstrate that the two-stage method is what we actually want. The changes i've made are actually quite small. I've added a function to the PyMC model associated with the inverse propensity experiment class.
But in the notebook example i show why this two-stage process is to be preferred over the joint fit model.
📚 Documentation preview 📚: https://causalpy--500.org.readthedocs.build/en/500/