| fg_eventStudy | R Documentation |
Summarizes and plots moves in data from a given set of event dates. Plots are designed to maintain reasonable aesthetics with as either time series or event dates increase.
fg_eventStudy(indata,dtset,output="path",changeas="diff",
nbd_back=10,nbd_fwd=20,n_color_switch=5,
title="Events",maxdelta=+Inf,meltvar="variable",verbose=FALSE)
indata |
A data.frame with at least one date column and multiple numeric columns. If melted,
must also contain the character column specified in parameter |
dtset |
A list of dates or a |
output |
(Default
|
changeas |
(Default |
nbd_back |
(Default 10) Positive integer for number of days prior to event are considered. |
nbd_fwd |
(Default 20) Positive integer for number of days after event are considered. |
n_color_switch |
(Default 5) A positive integer after which colors are displayed as gradients instead of separate colors. See Examples. |
title |
Character string for title of graph |
maxdelta |
(Default |
meltvar |
(Default |
verbose |
(Default |
Event Studies
a ggplot() object with the events analysis requested by output parameter, or a data.frame with statistics if output in c("data"","summary","stats")
dtset <- fg_get_dates_of_interest("fedmoves",startdt="2024-01-01")[,.(DT_ENTRY,text=eventid2)]
fg_eventStudy(yc_CMSUST,dtset,title="Fed Cuts",output="stats")
fg_eventStudy(yc_CMSUST,dtset,title="Fed Cuts",output="pathbyevent")
fg_eventStudy(yc_CMSUST,dtset,title="Fed Cuts",output="medbyvar")
fg_eventStudy(yc_CMSUST,dtset,title="Fed Cuts",output="lmbyvar",n_color_switch=0)
fg_eventStudy(yc_CMSUST,dtset,nbd_back=3,nbd_fwd=10,title="Fed Cuts",output="boxbyvar")
fg_eventStudy(yc_CMSUST,dtset,title="Fed Cuts",output="scatter")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.