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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: calculate column sum with survey weights


From   "Holod, Aleksandra" <aholod@air.org>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index