Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: how to group variables into equal number groups

From   Nick Cox <>
Subject   Re: st: how to group variables into equal number groups
Date   Tue, 26 Mar 2013 16:30:52 +0000

-egen, group()- is absolutely no use here. (Your example is illegal,
but that is not the main point.) It can't possibly improve on -xtile-.
In fact, no -egen- function can resolve ties.


On Tue, Mar 26, 2013 at 3:01 PM, Xixi Lin <> wrote:
> Hi Billy,
> There are some ties for some variables, will that be a big problem?
> Btw, do you mean egen decile=group(10)?
> Thanks,
> Xixi Lin
> On Tue, Mar 26, 2013 at 10:44 AM, William Buchanan
> <> wrote:
>> Why not use -egen-? Also, are there ties in the values for the variable you are trying to recode?
>> HTH,
>> Billy
>> Sent from my iPhone
>> On Mar 26, 2013, at 7:30, Xixi Lin <> wrote:
>>> Hi,
>>> I am trying to make independent variables into decile groups, and I
>>> used xtile decile=x1 if Period==`z', nq(10); however, it turns out
>>> that xtile does not make equal number of the 10 groups, is there any
>>> way to force stata to divide them into equal number of obs or almost
>>> equal number of obs?
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index