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

st: Generating percentiles

From   "Yvonne Capstick" <[email protected]>
To   [email protected]
Subject   st: Generating percentiles
Date   Sat, 16 Jul 2005 15:08:04 -0400


I am able to generate easily the median of a variable for a given year, e.g.

sort year
by year: egen medianprice = median(price)

Does anyone know how I can generate the 30th and 70th percentile of a
variable? I know I can use the centile function to display the 30th and 70th
percentiles, and the centile function can definitely be used with "by", but
it can't be used with "egen" it seems.


On the road to retirement? Check out MSN Life Events for advice on how to
get there!

*   For searches and help try:

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