Dear all,
Hi, I'm interested in calculating a weighted group mean without collapsing the data. If we say the data is x and the weight is w, x or w (or both) can be missing for each observation. I want to use only the observations with nonmissing x and w to calculate a weighted group mean. I'm surprised egen does not allow for this and I was wondering if there's an efficient way of doing this.
I'd really appreciate any and all help!
Best,
John
Hi, I'm interested in calculating a weighted group mean without collapsing the data. If we say the data is x and the weight is w, x or w (or both) can be missing for each observation. I want to use only the observations with nonmissing x and w to calculate a weighted group mean. I'm surprised egen does not allow for this and I was wondering if there's an efficient way of doing this.
I'd really appreciate any and all help!
Best,
John
Comment