Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: xtile creating different deciles using same data

From   Nick Cox <>
To   "" <>
Subject   Re: st: xtile creating different deciles using same data
Date   Tue, 3 Jan 2012 12:59:40 +0000

So it seems possible that different samples are picking different weights even for the same household income and as a consequence - xtile- will yield different results.....


On 3 Jan 2012, at 12:43, "Alvaro Herrera E." <> wrote:

Just checked, and it isn´t.



On 2 January 2012 22:01, Nick Cox <> wrote:
Back to the Stata question:

Is -weight- also constant within households?


On Mon, Jan 2, 2012 at 8:23 PM, Cameron McIntosh <> wrote:

A comment on the nature of your income variable, as this is not a trivial matter. Per capita income is indeed preferable to raw total household income but is still not optimal, for reasons discussed in: Carson, J. (2002). Family spending power. Perspectives on Labour and Income, 3(10), 24-32.

I would suggest weighting in the manner Carson suggests (or slightly differently if the context warrants), and see if this has an impact on the results. Perhaps some of the OECD measures might be useful as well:,3746,en_2649_33933_49147827_1_1_1_1,00.html


Hi, I am using the command xtile on stata 11, 32bits, to create income
deciles on my database, but I found an inconsistency:

I have a variable with the household per capita income, with data for the
whole population. Then I create deciles, but I don't do it over the
population, but households.

To do so, I use only one observation per household (they all share the same household per capita income) to create my deciles, and then I assign the rest of the household members to the decile of such observations. Of course, as poorer families tend to be larger, I end up with deciles that have more than 10% of the population on the lower end of the distribution, and others with less than 10% on the other end. That's fine with me.

basically, what I do is
xtile decaux==income if count==1 [w=weight], nq(10)       where
count==1 is the first member-chosen randomly- of each household, and
recode decaux .=0
by id_househ: egen decile=sum(decaux)                          I
assign the other members of each household to the deciles of their
respective members (count==1)

The problem is that if I run the same commands on the same database for a second time (or a third, or fourth, always without modifying the data), then the number of observations assigned to each decile differs every time.

The overall population does not change, but the population assigned to the
deciles changes marginally every time.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index