Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: egenmore xtile


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: egenmore xtile
Date   Mon, 2 Jan 2006 23:58:13 -0000

Forwarded on behalf of Sara Hussain. 

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

I would be grateful for advice on the xtile function. I have created a categorical variable denoting quintile group membership by region:

egen quin=xtile(income), by region nq(5) weight(wght)

I would like to know how I can create a variable that includes a percentile value eg lowest quintle using weights. I tried the folllowing but weights were not allowed:

by region: egen lquint=pctile(income), p(20)

Can xtile be modified for this? 

Also, please could anyone suggest a command incorporating weights to create a mean variable for each group (in my case, region)?


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index