Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Deciles and Stata


From   Binod Manandhar <[email protected]>
To   [email protected]
Subject   Re: st: Deciles and Stata
Date   Tue, 23 Aug 2005 16:40:19 +0545

About Deciles in Stata,

Is your proplem is to create decile variable "New_year" according to X
varilable?
 Try with command
 xtile newYear = X, nq(10)

Binod Manandhar
CBS, Nepal
       


On 8/21/05, Nuno Soares <[email protected]> wrote:
> Hi everyone,
> 
> I'm looking for help with a problem with stata and deciles.
> I want to insert a new variable (NewVar) which is based on another variable
> (X) deciles/quartiles.
> Here goes an example of my problem:
> Ex. for the quartiles case (just for the sake of exposition, since I need
> deciles...), I would like to be able to generate the NewVar variable based
> on the quantiles of X's observations:
> 
>        X               NewVar
>        1               1
>        6               2
>        2               1
>        4               2
>        3               1
>        5               2
>        12              4
>        9               3
>        8               3
>        10              4
>        11              4
>        7               3
> 
> Is there a function or a way of doing this automatically? I've searched the
> help files but found no solution to this problem...
> 
> Cheers,
> 
> Nuno
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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