Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: xtile with survey weights


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: xtile with survey weights
Date   Fri, 5 Sep 2008 21:46:15 +0100 (BST)

I would make sure that -xtile- -tab- and -cumul- treat weights in the
same way by specifying for each command [pw=my_weight] 

Hope this helps,
Maarten

--- Mark Orr <mo2259@columbia.edu> wrote:

> Hello all,
> 
> I'm using a national dataset for which the weights adjust for 
> oversampling and some other factors.  My goal is to make deciles of a
> 
> variable, say var_x, but with taking the weighted empirical
> distribution 
> as the basis for making the deciles.  I've computed this three ways,
> but 
> all with slightly different results.  The code for the three
> different 
> decile computations were as follows:
> 
> 1. 
> xtile var_x [wt=my_weight], nq(10)
> 
> 2.
> tab var_x [wt=my_weight]
> THEN COMPUTE THE DECILES BY HAND BASED ON THE WGTED EMPIRICAL CDF
> 
> 3.
> cumul var_x [wt=my_weight], gen(cdist)
> gen var_x_decile = ceil(10 * cdist)
> 
> So, my method for comparing these was to compute the mean for each 
> decile.  I get three different (but) similar means for each
> computation 
> type.
> 
> Any thoughts.  I'm stumped.
> 
> Thanks very kindly. (i've checked the archives pretty well, but
> nothing 
> that really explains what is going on here)
> 
> -Mark Orr
> 
> -- 
> ***********************************************
> Mark G. Orr, PhD
> Heilbrunn Dept. of Population and Family Health
> Columbia University
> 60 Haven Ave., B-2
> New York, NY 10032
> 
> Tele: 212-304-7823
> Fax:  212-305-7024
> 
> www.columbia.edu/~mo2259
> 
> > begin:vcard
> fn:Mark G. Orr
> n:Orr;Mark G.
> org:Columbia University;Heilbrunn Department of Population and Family
> Health
> adr;dom:;;60 Have Ave., B2;New York;NY;10032
> email;internet:mo2259@columbia.edu
> title:Ph.D.
> tel;work:212-304-7823
> tel;fax:212-305-7024
> tel;home:718-414-5151
> url:http://www.columbia.edu/~mo2259
> version:2.1
> end:vcard
> 
> 


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

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index