Skip to content
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

slopes documentation #701

Merged
merged 39 commits into from
Aug 10, 2023
Merged

slopes documentation #701

merged 39 commits into from
Aug 10, 2023

Conversation

GStechschulte
Copy link
Collaborator

This PR provides documentation for PR #699 (slopes and plot_slopes). The notebook provides the following sections:

  • interpretation of regression coefficients under three scenarios and how this can be difficult and cumbersome: (1) gaussian model with no link function, (2) gaussian model with interactions, and (3) GLMs
  • how average predictive slopes are computed
  • how to use slopes and plot_slopes, and the benefits under the following:
    • user provided values (single and multiple)
    • conditional slopes (using a GLM with interaction terms)
    • unit-level slopes
    • average slopes
    • average by subgroup slopes
    • interpreting coefficients as an elasticity (or semi-elasticity)
    • slopes of categorical covariates

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2023

Codecov Report

Merging #701 (8a4226a) into main (457eee3) will increase coverage by 0.16%.
The diff coverage is 91.81%.

❗ Current head 8a4226a differs from pull request most recent head 8847ad3. Consider uploading reports for the commit 8847ad3 to get more accurate results

@@            Coverage Diff             @@
##             main     #701      +/-   ##
==========================================
+ Coverage   89.57%   89.73%   +0.16%     
==========================================
  Files          43       43              
  Lines        3522     3499      -23     
==========================================
- Hits         3155     3140      -15     
+ Misses        367      359       -8     
Files Changed Coverage Δ
bambi/plots/plotting.py 85.24% <88.88%> (+0.28%) ⬆️
bambi/plots/effects.py 90.94% <90.75%> (+1.69%) ⬆️
bambi/plots/utils.py 86.82% <92.98%> (+0.06%) ⬆️
bambi/plots/__init__.py 100.00% <100.00%> (ø)
bambi/plots/create_data.py 100.00% <100.00%> (ø)
bambi/plots/plot_types.py 73.39% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
@tomicapretto
Copy link
Collaborator

excellent work @GStechschulte. Just left some comments. I don't think further additions are needed, only some removals and maybe simplifications. Thanks a lot!

@GStechschulte
Copy link
Collaborator Author

GStechschulte commented Aug 3, 2023

excellent work @GStechschulte. Just left some comments. I don't think further additions are needed, only some removals and maybe simplifications. Thanks a lot!

Thanks @tomicapretto , and also for the review!

docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
@@ -0,0 +1,2503 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of having to do two imports we should just import bambi as bmb and then call

bmb.slopes, bmb.plot_slopes, etc


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will change this in PR #699 and then merge into this branch 👍🏼

docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
docs/notebooks/plot_slopes.ipynb Show resolved Hide resolved
@aloctavodia
Copy link
Collaborator

This is fantastic!

@GStechschulte
Copy link
Collaborator Author

GStechschulte commented Aug 5, 2023

This is fantastic!

Thank you @aloctavodia! And thanks for the feedback. Much appreciated :)

@tomicapretto
Copy link
Collaborator

@GStechschulte there are some conflicts now 😅

@aloctavodia if you don't have any further comments i will merge once the conflicts are resolved

@GStechschulte
Copy link
Collaborator Author

@GStechschulte there are some conflicts now 😅

@aloctavodia if you don't have any further comments i will merge once the conflicts are resolved

Good to go now 😄

@tomicapretto tomicapretto merged commit fcf8ab5 into bambinos:main Aug 10, 2023
4 checks passed
@GStechschulte GStechschulte deleted the slopes-docs branch January 21, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants