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

st: Re: Weighted number of observations


From   Friedrich Huebler <[email protected]>
To   [email protected]
Subject   st: Re: Weighted number of observations
Date   Tue, 3 Aug 2004 07:08:16 -0700 (PDT)

Dear Toyoto,

The auto data has 22 observations with foreign=1, not 50950. In [R]
tabstat we read: "aweights and fweights are allowed; see [U] 14.1.6
weight." [U] 14.1.6 states that most Stata commands rescale the
aweights to sum to N. However, -tabstat- does not rescale the
weights.  The fact that -tabstat- treats aweights the same way as
fweights is not clearly documented. One could also argue that this
behavior is inconsistent.

Friedrich Huebler

--- Toyoto Iwata <[email protected]> wrote:
> Dear Friedrich Huebler
> 
> You wrote about
> 
> > . tabstat foreign [aw=weight], stat(sum)
> >
> > variable | sum
> > -------------+----------
> > foreign | 50950
> > ------------------------
> 
> Perhaps I miss the point, but,
> 
> .gen eachmean = foreign*weight
> 
> .gen sumeachmean = sum(eachmean)  /* I don't know the mean of this.
> */
> 
> . list sumeachmean in l
> 
>      +----------+
>      | sumeac~n |
>      |----------|
>  74. |    50950 |
>      +----------+
> 
> This seems to agree with the definition of the aweight.
> 
> [Online help says,]
> 
> aweights, or analytic weights, are weights that are inversely 
> proportional to the variance of an observation; i.e., 
> the variance of the j-th observation is assumed to be sigma^2/w_j, 
> where w_j are the weights.  
> Typically, the observations represent averages and the weights are 
> the number of elements that gave rise to the average.  
> 
> 
> > The Stata User's Guide states in section 14.1.6: "For most Stata
> > commands, the recorded scale of aweights is irrelevant; Stata
> > internally rescales them to sum to N, the number of observations
> in
> > your data, when it uses them." It would be useful if the Stata
> > documentation could make clear which commands don't use aweights
> in this manner.
> > 
> > Friedrich Huebler
> 
> sincerely,
> 
> Toyoto


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
*
*   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