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

Re: st: Weighted number of observations


From   Richard Williams <[email protected]>
To   [email protected], [email protected]
Subject   Re: st: Weighted number of observations
Date   Fri, 30 Jul 2004 13:04:41 -0500

At 10:35 AM 7/30/2004 -0700, Friedrich Huebler wrote:

According to -tab-, the weighted number of observations=1 is about
16.9. According to -tabstat-, the number is 50950. With -collapse- we
get the same result as with -tab-.
To add to the mystery:

. tabstat foreign [aw=weight], stat(count)

variable | N
-------------+----------
foreign | 74
------------------------

. tabstat foreign [aw=weight], stat(mean)

variable | mean
-------------+----------
foreign | .2280254
------------------------

. tabstat foreign [aw=weight], stat(sum)

variable | sum
-------------+----------
foreign | 50950
------------------------

So, the weighted N is 74, the mean is .228 (both of these are consistent with other results) but the sum is 50950. It appears that, unlike the other stats, the sum is not calculated by first rescaling back to the original sample size, e.g. aweights and fweights give you the same result when computing the sum using tabstat.

I never want to be so bold as to call something an error, but I too am puzzled by this behavior.

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc

*
* 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