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

RE: st: Labelling lines on graphs


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Labelling lines on graphs
Date   Fri, 13 Dec 2002 12:08:42 -0000

Ulrich Kohler
> 
> and, as further extension (the _Nth value is not missing):
> 
> local n =  _N + 1
> set obs n
> gen last1 = ser1[_N-1] if _n==_N
> gen last2 = ser2[_N-1] if _n==_N
> gen lab1 = 1 if (_n==_N)
> gen lab2 = 2 if (_n==_N)
> replace year = year[_N-1] + 1 if _n==_N  
> gr ser1 last1 ser2 last2 year, s(i[lab1]i[lab2]) c(l.l.) pen(2233)
> 
> Change the "+1" in the replace command to move the 
> description in the space 
> of the x-axis.  Of course, "lab1" etc may be string 
> variables to label each 
> line with a label sensu strictu.
> 

As yet further decoration note that 

... in l 

(think -l- for last) is always OK for 

... if _n == _N 

and faster to execute. 

N.B. the correct Latin is sensu stricto... 

Nick 
n.j.cox@durham.ac.uk 
*
*   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