Bookmark and Share

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


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

Re: st: How to make deciles for 120 Periods


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: How to make deciles for 120 Periods
Date   Mon, 11 Mar 2013 19:35:34 +0000

This is often asked. As explained in e.g.
http://www.stata.com/statalist/archive/2013-03/msg00028.html there are
at least two solutions.

1. Write your own loop.

2. Use the -egen- function -xtile()- by Ulrich Kohler from -egenmore- (SSC).

That said, decile groups for _independent_ variables -- and separately
for 120 periods! -- just sounds like throwing away information, and I
advise against throwing away information.

Nick

On Mon, Mar 11, 2013 at 3:37 PM, Xixi Lin <[email protected]> wrote:

> I am trying to decile the independent variables by ID for 120
> periods, how to code it in stata?
>
> I can use xtile decile=ID if Period==1, nq(10)   for only 1 periods,
> but how can I do it efficiently by 120 periods?
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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