library(estudy2)
tickers <- c('PFE')
prices <- get_prices_from_tickers(tickers,start = as.Date('2020-04-20'),end=as.Date('2020-12-03'),quote='Close',retclass='zoo')
price_indx <- get_prices_from_tickers('XBI',start=as.Date('2020-04-20'),end=as.Date('2020-12-03'),quote='Close',retclass='zoo')
rates <- get_rates_from_prices(prices,quote='Close',multi_day=TRUE,compounding='discrete')
rates_indx <- get_rates_from_prices(price_indx,quote='Close',multi_day=TRUE,compounding='discrete')
securities_returns <- apply_market_model(rates=rates,regressor=rates_indx,same_regressor_for_all=TRUE,market_model='sim',estimation_method='ols',estimation_start=as.Date('2020-04-20'),estimation_end=as.Date('2020-11-03'))
list_of_returns=securities_returns
class(list_of_returns)
t_test(list_of_returns,event_start=as.Date('2020-11-04'),event_end=as.Date('2020-12-03'))
I don not know why the last code cannot run