Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st:-expand- to adjust according to the sampling weight

From   Amanda Fu <>
Subject   st:-expand- to adjust according to the sampling weight
Date   Mon, 20 Dec 2010 08:29:55 -0500

Dear Statalisters,

I have a question about how to use expand to adjust sampling weight
for the command that pw is not allowed to use. I know previous
discussion from this link
 talks some points about expand. But I am still not sure how to use

Suppose I have there variables in the data set:X,Y, and sampling
weight. In order to use stata command that does not allow to use pw, I
am thinking to expand the data set according to weight.

X             Y            sweight
1              2             10
2              2.5           2
Is it correct if I use
. gen tt_weight=sum(weight)
. expand sweight/tt_weight                          ?

Thanks for your help!

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index