Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: calculate column sum with survey weights


From   "Holod, Aleksandra" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: calculate column sum with survey weights
Date   Tue, 2 Apr 2013 21:32:27 +0000

Hello Statalist,

I would like to calculate a column total of a variable, but I need to weight the data.  

I am currently following this guidance in the Statalist archive: http://www.stata.com/statalist/archive/2002-08/msg00269.html, 
summ enrollment, meanonly [apply if or in as desired]
scalar sigma = r(sum)
di sigma

How can I do this calculation with survey weights?  I added the iweight command as shown below, but is there a better way?
summ enrollment [iweight=resp_wgt], meanonly [apply if or in as desired]
scalar sigma = r(sum)
di sigma

Thanks,
Alex



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index