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
Some commands appear to ignore [w=weights] #88
Comments
@erciomunoz This is not a clear
set obs 5
g units=1
g weight=5
collapse (sum) units [w = weight]
disp units Gives 5 as the answer. The reason is that aweights are normalized to sum to the number of observations. Try
Gives a different answer, showing weights are not being ignored (they just work different than how you might intuit). Cheers. |
@erciomunoz I've decided to leave this issue up in case others have a similar question about how |
Thanks for the quick reply. This makes total sense, now I regret a little bit that I did not spend more time thinking about it before posting. |
I noticed that some commands like gegen take weights but actually do not use them. For example, if you try to generate a count or total of a variable and use weights. Below I provide an example where the total is 5, but I thought it would be 25 if using the weights. Perhaps it would be good to stop allowing the use of weights and give an error if the user uses them for these particular commands.
The text was updated successfully, but these errors were encountered: