Statalist


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

Re: st: -mean- with weights


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: -mean- with weights
Date   Mon, 10 Nov 2008 21:46:24 +0000 (GMT)

--- "Rodrigo Alfaro A." <[email protected]> wrote:
> I found an weird outcome using -mean- with weights 
> (versions 9 and 10). I just one to know the average 
> with its SE. Using -mean- without weights I got the 
> same mean and SE as using -reg-. However, when I 
> used weights results are not same in terms of SE. 
> 
> sysuse auto
> set seed 1234
> gen tmp=uniform()
> gen factor=round(1/tmp,1)
> mean price
> mean price [w=factor]
> reg price, nohead
> reg price [w=factor], nohead

That is because the default weight-type differs 
between -regress- (analytic weights or aweights) and
-mean- (frequency weights or fweights).

-- Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room N515

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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