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.

# Re: st: How to divide the sample into quintiles?

 From Stevie Kourama To statalist@hsphsun2.harvard.edu Subject Re: st: How to divide the sample into quintiles? Date Wed, 10 Mar 2010 18:50:49 +0300

```Nick,
What martin said makes sense since with quintiles say 1,2 3 4 5 for
Poorest Quintile; Poor, Rich and Richest one may wish to know the mean
net expenditure for each quintile. so when you Poorest quintile you
can also say their mean netexpe! I think that makes sense, unless I am
also out of context

I am working with the household budget survey and i wanted to use
netexpe of the household to divide them into quintiles, so i thought
it would have been interest to know each quintile stands at what mean!

Stevie

On Wed, Mar 10, 2010 at 6:35 PM, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> 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/
>

--
Stevie Kourama

*
*   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/
```