Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: time series graph

From   Partho Sarkar <>
Subject   Re: st: time series graph
Date   Fri, 16 Sep 2011 21:00:42 +0530

Say your y variable is "yvar", and the recession years are 1920, 1930
etc.  The following is one way to do what you ask:

--------------------------CODE BEGIN----------------------
gen float maxy = max(yvar)
gen recession=.
replace recession==1 if inlist(year,1920,1930,....)
twoway (scatter yvar year) ///
(bar maxy year if recession==1,color(ltkhaki))
--------------------------CODE END----------------------

Partha Sarkar

On Fri, Sep 16, 2011 at 5:43 PM, Maria Ana Vitorino
<> wrote:
> Dear Stata-List users,
> Can anyone tell me what  do I need to do to replicate the effect in the
> following graph?, i.e. how do I "highlight" the recessions?
> Thanks!
> Ana
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index