Statalist


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

st: xtile with survey weights


From   Mark Orr <[email protected]>
To   [email protected]
Subject   st: xtile with survey weights
Date   Fri, 05 Sep 2008 16:12:34 -0400

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:[email protected]
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




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