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

Add support for weighted responses #761

Merged
merged 12 commits into from
Nov 28, 2023
Merged

Conversation

tomicapretto
Copy link
Collaborator

With this PR Bambi supports weighted responses via the syntax weighted(values, weights) ~ 1 + x + y + ....

Weights in statistics can mean many things. In this case, the weights multiply the contribution of the observation to the log-likelihood. Thus, if an observation has a weight of 3 it is as if there were three records like that one.

Closes #639. Closes #561.

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (8dd25b1) 89.60% compared to head (219353b) 89.83%.

Files Patch % Lines
bambi/backend/utils.py 93.93% 2 Missing ⚠️
bambi/terms/utils.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #761      +/-   ##
==========================================
+ Coverage   89.60%   89.83%   +0.23%     
==========================================
  Files          45       45              
  Lines        3713     3768      +55     
==========================================
+ Hits         3327     3385      +58     
+ Misses        386      383       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tomicapretto tomicapretto marked this pull request as draft November 28, 2023 12:02
@tomicapretto
Copy link
Collaborator Author

tomicapretto commented Nov 28, 2023

Found room for improvement so I'm converting to draft

False alarm

@tomicapretto tomicapretto marked this pull request as ready for review November 28, 2023 12:41
@tomicapretto tomicapretto merged commit 2d4b260 into bambinos:main Nov 28, 2023
4 checks passed
@tomicapretto tomicapretto deleted the weights branch November 28, 2023 12:41
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.

Weights option Add survey weights
2 participants