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

Improve weights docstrings #757

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/weights.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ end
Construct an `AnalyticWeights` vector with weight values `vs`.
A precomputed sum may be provided as `wsum`.

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.
nalimilan marked this conversation as resolved.
Show resolved Hide resolved
These weights may also be referred to as reliability weights,
precision weights or inverse variance weights. These are typically used when the observations
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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

Copy link
Member Author

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).

Copy link
Member

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

Copy link
Member Author

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.

being weighted are aggregate values (e.g., averages) with differing variances.
""" AnalyticWeights
Expand Down Expand Up @@ -136,7 +136,7 @@ end
Construct a `FrequencyWeights` vector with weight values `vs`.
A precomputed sum may be provided as `wsum`.

Frequency weights describe the number of times (or frequency) each observation
Frequency weights represent the number of times (or frequency) each case
nalimilan marked this conversation as resolved.
Show resolved Hide resolved
was observed. These weights may also be referred to as case weights or repeat weights.
""" FrequencyWeights

Expand Down Expand Up @@ -173,9 +173,9 @@ end
Construct a `ProbabilityWeights` vector with weight values `vs`.
A precomputed sum may be provided as `wsum`.

Probability weights represent the inverse of the sampling probability for each observation,
Probability weights represent the inverse of the sampling probability for each case,
providing a correction mechanism for under- or over-sampling certain population groups.
These weights may also be referred to as sampling weights.
These weights may also be referred to as sampling weights or survey weights.
""" ProbabilityWeights

"""
Expand Down