Description Usage Arguments Details Author(s) See Also Examples
Creates a time series plot where events given by a set of dates are aligned, with the adjacent prior and posterior time series data plotted in order. The x-axis is time, but relative to the date specified, e.g., number of months preceeding or following the events.
1 2 | chart.Events(R, dates, prior = 12, post = 12, main = NULL, xlab = NULL,
...)
|
R |
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns |
dates |
a list of dates (e.g.,
|
prior |
the number of periods to plot prior to the event. Interpreted as a positive number. |
post |
the number of periods to plot following to the event. Interpreted as a positive number. |
main |
set the chart title, same as in
|
xlab |
set the x-axis label, same as in
|
... |
any other passthru parameters to the
|
This is a chart that is commonly used for event studies in econometrics, usually with recession dates, to demonstrate the path of a time series going into and coming out of an event. The time axis is simply the number of periods prior and following the event, and each line represents a different event. Note that if time periods are close enough together and the window shown is wide enough, the data will appear to repeat. That can be confusing, but the function does not currently allow for different windows around each event.
Peter Carl
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.