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 divide the sample into quintiles?
From
"Nick Cox" <[email protected]>
To
<[email protected]>
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
[email protected]
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/