-
Notifications
You must be signed in to change notification settings - Fork 193
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
Improve weights docstrings #757
base: master
Are you sure you want to change the base?
Conversation
`AnalyticWeights` have a precise definition, on which we rely in several functions. Also make docstrings more consistent across types.
I think we should make an important note for both It would also help to be very specific about the following, to avoid people making the mistake of trying to use normalized weights: I believe the docstring for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. We already mentioned inverse variance weights, so maybe rewording that docstring to be less redundant would be good?
src/weights.jl
Outdated
Analytic weights describe a non-random relative importance (usually between 0 and 1) | ||
for each observation. These weights may also be referred to as reliability weights, | ||
Analytic weights represent the inverse of the variance for each case. | ||
These weights may also be referred to as reliability weights, | ||
precision weights or inverse variance weights. These are typically used when the observations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
precision weights or inverse variance weights. These are typically used when the observations | |
precision weights or regression weights. These are typically used when the observations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure the expression "regression weights" is used commonly? I'm afraid it could confuse users, as you can use any kind of weights in regression (e.g. Stata supports all three types).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think SAS uses that term for them, but I don't know how common it is elsewhere. I'm also fine with just removing the redundant inverse variance
and only listing two other common names (e.g., reliability weights
, precision weights
).
https://blogs.sas.com/content/iml/2017/10/02/weight-variables-in-statistics-sas.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's do that.
I've added mentions regarding scale-invariance of frequency and probability weights. For analytic weights I'd rather wait until #758 is settled as we may want to adjust the definition a bit (maybe in the next breaking release). AFAICT currently they are scale-invariant, right? |
I've updated the description of analytic weights in the light of #758. Does that sound correct? |
Oh, brief note that I think could be useful for users -- currently, all our methods for |
@ParadaCarleton Don't you think that this PR is a strict improvement over the current situation, even if we decide to split |
I think it's an improvement, yeah, but I'd clarify that the weights:
|
AnalyticWeights
have a precise definition, on which we rely in several functions.Also make docstrings more consistent across types.