automatize the calculation of correlation in a dataset

Copper Contributor

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?

0 Replies