Dec 21 2018 04:08 AM
I have 40 years of historical data with 3 columns: the stock price of Microsoft, S&P500, and date.
I have to find the correlation between MSFT and S&P500 for each year how can I automatize the calculation so I don't have to select the data of each year by hand?