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, statalist.org is already up and running.


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

st: Re: How to generate quantile categories by group/varlist?


From   Alika Tuwo <alika.tuwo@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: How to generate quantile categories by group/varlist?
Date   Thu, 25 Oct 2012 12:13:40 +0700

Hi there,

I'm working on a national survey data and I'm trying to group
expenditure per capita according to provincial (NOT national)
quantiles.

prov - code for province (33 unique values)
ecp - expenditure per capita
weind - individual weight


If I were to group 'epc' by national quintiles I would use the command:

 xtile q_epc = epc [fweight = weind], nquantiles(5)

But what if I would like to generate quantile groups for each
province? Is there any quick way to do this?  The 'by' option wouldn't
work with 'xtile'. So far I've had to work on each province
separately. Thanks in advance for the help.


Best regards,

Alika
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index