Simple formula for calculating R-Squared between 2 stocks
Posted on 2016-08-19
Hello Experts, I'm a Delphi programmer writing a bit of a financial analysis program for myself and I'm having trouble with the calculation of R-Squared between the daily closing prices of 2 financial instruments. I thought I found a good formula on the net for doing it, but it doesn't yield sensible results. I'm no advanced statistics experts, but doesn't R-Squared have to be a value between 0 and 1? The formula I used yields values like 7.11 and 10.67... not making much sense. Here is the formula:
RSquared = (Covariance (x,y) * Covariance (x,y)) / (Variance(x) * Variance(y))
Could anyone offer any help please?