Skip to content

Some commands appear to ignore [w=weights] #88

@erciomunoz

Description

@erciomunoz

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.

set obs 5
g units=1
g weight=5
gegen total=total(units) [w=weight]
sum total
//     Variable |        Obs        Mean    Std. Dev.       Min        Max
// -------------+---------------------------------------------------------
//       total |          5           5           0          5          5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions