I want to apply a quantile regression (with one dependent and one independent variable) to each month of a one-year time series , so that I will receive 12 coefficients as a result.
My data set is given by return_2000_xts
and rq()
is a function for quantile regression.
My dataset is in xts
format and includes daily returns of bank stocks.
I tried using apply.monthly()
:
apply.monthly(return_2000_xts,
rq(esb.eu ~ hsbc.uk, data = return_2000_xts, tau = 0.95))
Unfortunately, I get the following error message:
Error in get(as.character(FUN), mode = "function", envir = envir) : object 'FUN' of mode 'function' was not found
What could be the problem with my code?