Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: line plot with individual's median


From   "Clive Nicholas" <Clive.Nicholas@newcastle.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: line plot with individual's median
Date   Fri, 1 Sep 2006 08:39:53 +0100 (BST)

Nick Cox replied to Cathy Antonakos

> Here is an analogue to your problem as I understand it.
>
> . sysuse auto, clear
> (1978 Automobile Data)
>
> . egen median = median(price), by(rep78)
>
> . sort rep78 mpg
>
> . twoway connected price mpg || line median mpg , by(rep78)
> legend(order(2))

In addition, given that Cathy says she has time-series data, using
-tsline, by()- might also do the trick.

CLIVE NICHOLAS        |t: 0(044)7903 397793
Politics              |e: clive.nicholas@ncl.ac.uk
Newcastle University  |http://www.ncl.ac.uk/geps

Whereever you go and whatever you do, just remember this. No matter how
many like you, admire you, love you or adore you, the number of people
turning up to your funeral will be largely determined by local weather
conditions.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index