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]
Re: st: plot multiple vertical lines according to specific variable values
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: plot multiple vertical lines according to specific variable values
Date
Fri, 9 Mar 2012 15:33:06 +0000
levelsof date if special_date, local(levels)
line X date, sort xli(`levels')
Nick
On Fri, Mar 9, 2012 at 3:26 PM, Francesco <[email protected]> wrote:
> 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) ?
*
* 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/