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]

RE: st: How to divide the sample into quintiles?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: How to divide the sample into quintiles?
Date   Wed, 10 Mar 2010 15:35:42 -0000

Stevie's question seemed unclear to me. As the mean can be in general
anywhere between the lowest value and the highest value, there is no
automatic relation to quintiles. 

If Martin's answer is not what is wanted, more detail is needed. 

Nick 
n.j.cox@durham.ac.uk 

Martin Weiss

" By the way, how do add the mean in this quintiles"

Use -egen, mean()-:

*************
sysuse auto, clear
xtile quant = mpg, nquantiles(5)
bys quant: egen meaninsidequantile=mean(mpg)
sort quant
l mpg  meaninsidequantile quant, sepby(quant) h(20)
*************

Stevie Kourama

Martin, I think the first command John gave was wrong, but the second
that he gave works now.

I am afraid describe netexp does not give much but

xtile quintile=netexpe [w=weight], nq(5)

creates the quintile variable

with frequencies and percentages.

By the way, how do add the mean in this quintiles


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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