Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: pweights and -table-


From   "Emma Slaymaker" <[email protected]>
To   <[email protected]>
Subject   Re: st: pweights and -table-
Date   Fri, 14 Oct 2005 16:51:24 +0100

You can do this if you use the svy commands.  First you need to -svyset-
the data.  Assuming your weight variable is called weightvar:
svyset [pw=weightvar]
then you can use -svy:tab- which gives you the weighted count in
e(N_pop).
Cheers,
Emma

>>> [email protected] 14/10/05 16:34:15 >>>
I'm applying pweights to a dataset and wish to work with the weighted
sum resulting from a -table- statement using r(). The problem arises
when the only r() output from -table- is r(N), when what I want is the
weighted value (as output in the results window). I can get access to
the weighted data using -summarize- just fine ("sum_w") but then I can't
use pweights. Is there a workaround, or am I just missing something
here?

Cheers

Cameron.

--------------------

This email message is for the sole use of the intended recipient(s)
and
may contain privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all
copies
of the original message.



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index