nberShade {tis} | R Documentation |
nberDates
returns a matrix with two columns of yyyymmdd dates
giving the Start and End dates of recessions fixed by the NBER.
nber.xy
returns a list of x and y coordinates that can be fed
to polygon
to draw NBER shadings on the current plot.
It executes get("nberDates", pos = 1)()
to do so. This means
that if you have defined a local version of nberDates
, it will
be used rather than the one supplied by the tis package.
If the last row from nberDates()
has a Start entry but an "NA"
End entry and openShade
is FALSE
, the returned list will
not have coordinates for the last row, but will instead include a
vLine element that gives the x coordinate of the last Start. If
openShade
is TRUE
(the default), the list includes x
and y coordinates for the most recent recession, using the second
element of the horizontal range determined by the xrange
parameter as its end time.
nberShade
is a generic method for shading recession areas
on the current plot. The default version calls
nber.xy
to get x and y coordinates for the areas to be shaded
and then passes those coordinates along with its own arguments to
polygon
to do the shading. It also draws a vertical
line at the appropriate location if the list returned by
nber.xy
has a vLine element.
romerLines
draws vertical lines on the current plot at the
"Romer and Romer" dates when monetary policy is said to have become
contractionary.
## Default S3 method: nberShade(col = grey(0.8), border = FALSE, xpd = FALSE, xrange = NULL, openShade = TRUE, ...) nberDates() nber.xy(xrange = NULL, openShade = TRUE) romerLines()
All passed along to polygon
:
col |
color to shade recessionary periods |
border |
the default ( |
xpd |
should clipping take place? |
... |
other args passed to |
xrange |
horizontal range over which recession shading should be
drawn. The default value |
openShade |
governs how |
As described above, nber.xy
returns a list. The other
functions described do not return anything useful.
Recessions are dated by the Business Cycle Dating Committee of the National Bureau of Economic Research.
The Romer dates are October 1947, September 1955, December 1968, April 1974, August 1978, October 1979 and December 1988.
Christina D. Romer and David H. Romer. 1989. "Does Monetary Policy Matter? A New Test in the Spirit of Friedman and Schwartz." NBER Macroeconomics Annual 4: 121-170.
Christina D. Romer and David H. Romer. 1994. "Monetary Policy Matters." Journal ofMonetary Economics 34 (August): 75-88.
National Bureau of Economic Research. http://www.nber.org.
require("datasets") plot(presidents, type='n', ylab="Presidents approval rating") nberShade() lines(presidents)