I have a dataset of S&P500 returns. How can I calculate the value of $F(X ⩽ x)$. My code is as below:
library(quantmod) # Loading quantmod library getSymbols("^GSPC", from = as.character(Sys.Date()-365*16)) # SPX price date for 16 yrs SPX <- dailyReturn(GSPC) SPX_ecdf <- ecdf(as.numeric(SPX)) # dropping xts class
How do I calculate the probability of my data to be, let's say $\le -0.025$ ?