Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: plot multiple vertical lines according to specific variable values
From
Francesco <[email protected]>
To
[email protected]
Subject
st: plot multiple vertical lines according to specific variable values
Date
Fri, 9 Mar 2012 16:26:50 +0100
Dear Statalist,
I have a (simple?) question :
Lets suppose I have the following dataset structure
Date X special_date
01/01/2008 10 0
03/01/2008 12 0
05/01/2008 13 1
07/01/2008 11 0
10/01/2008 11 1
12/01/2008 14 0
...
I would like to plot X against the date, so I type
-twoway line X date, sort
However I would also like to add a vertical line on my graph, EACH
time the special_date variable is true (that is =1)
I dont know how to do that. I know that there is the option -xline for
creating vertical lines at specific dates values, but how to use it
here (if appropriate) ?
Many thanks,
*
* 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/