pymc-labs / CausalPy

A Python package for causal inference in quasi-experimental settings
https://causalpy.readthedocs.io
Apache License 2.0
829 stars 52 forks source link

Enable `summary` method for all currently implemented frequentist experiments #355

Closed drbenvincent closed 1 week ago

drbenvincent commented 2 weeks ago
review-notebook-app[bot] commented 2 weeks ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.87%. Comparing base (4af4af6) to head (9fc0798).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #355 +/- ## ========================================== + Coverage 79.96% 80.87% +0.91% ========================================== Files 21 21 Lines 1642 1668 +26 ========================================== + Hits 1313 1349 +36 + Misses 329 319 -10 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

review-notebook-app[bot] commented 1 week ago

View / edit / reply to this conversation on ReviewNB

juanitorduz commented on 2024-06-19T08:00:38Z ----------------------------------------------------------------

These numbers look in different columns. Why don't er print a dataframe?


juanitorduz commented 1 week ago

Some tables based on print statements look out of phase. What if we use something like in the pyfixest package https://py-econometrics.github.io/pyfixest/quickstart.html ?

drbenvincent commented 1 week ago

Some tables based on print statements look out of phase.

Very good point @juanitorduz . For the moment I've kept the same basic approach, but have improved the formatting. The function that prints the model coefficients now evaluates the length of the longest coefficient label so that it can align the coefficient values appropriately.

I'm very open to rethinking the nature of the summary outputs, but I'm tempted to deal with that in a separate issue. For example, there is already https://github.com/pymc-labs/CausalPy/issues/174 as one option.

I'll do a similar formatting improvement for the pymc experiments in a different issue now.

What do you think?

PS. I just noticed I probably have to update the doctests 🤣 Will do that now :)