Open alienalex6 opened 4 years ago
Hi @alienalex6,
I am very sorry for my delayed reply and thank you for your kind words.
After some research, the only thing I was not able to understand how to do was adding multiple event dates and perform the analysis using the same number of days for the estimation period.
For now, you can use only consecutive days in the event window. Simply specify event_start
and event_end
far apart from each other, and you'll get multiple event dates. If you want to apply the same model's estimates you can pass the same list_of_returns
and make multiple calls to parametric_tests
:
library(magrittr)
tickers <- c("AMZN", "ZM", "UBER", "NFLX", "SHOP", "FB", "UPWK")
returns <- get_prices_from_tickers(
tickers,
start = as.Date("2019-04-01"),
end = as.Date("2020-06-01"),
quote = "Close",
retclass = "zoo"
) %>%
get_rates_from_prices(
quote = "Close",
multi_day = TRUE,
compounding = "continuous"
) %>%
apply_market_model(
regressor = rates_indx,
market_model = "mean_adj",
estimation_start = as.Date("2019-04-01"),
estimation_end = as.Date("2020-03-13")
)
# First set of dates
parametric_tests(
returns,
event_start = as.Date("2020-03-16"),
event_end = as.Date("2020-03-20")
)
# Second set of dates
parametric_tests(
returns,
event_start = as.Date("2020-04-16"),
event_end = as.Date("2020-04-20")
)
Is there any way to use the same market index, the same estimation period, the same event window but use different stocks and different event dates for each stock? I would really appreciate your help.
For now, the {estudy2}
package allows only to consider the same dates for stocks. But there is a trick. You can overwrite (hardcode) dates for stocks, so they do match and then act like these are the same dates. Please let me know if this makes sense to you and please do not hesitate to come back if it is not entirely clear.
Best, Iegor
@alienalex6, I wrote down a small workaround you might be interested in.
Hi Iegor,
I've been playing with this package and it's really great - thank you for coming up with it. After some research, the only thing I was not able to understand how to do was adding multiple event dates and perform the analysis using the same number of days for the estimation period. Is there any way to use the same market index, the same estimation period, the same event window but use different stocks and different event dates for each stock? I would really appreciate your help. Cheers!