I am working with financial data on R and I need to know what is the percentage of days with a stock return larger than 5% in absolute value.
I have the variable "returns" and my intuition is that I should create another variable for which the absolute value of the return is larger than 5% and then see how many elements would that variable vector contain and compute the ratio between its length and the total number of observations. However, I need help with the commands I should use on R.
(I know this may sound very easy but I am not used to analysing financial data with R)