Skip to content
Prev 248829 / 398503 Next

Finding the correlation coefficient of two stocks

Dieter is correct, the lengths of the 2 series are different

Try ....

s = merge(s1,s2)

corr = cor(s[,"Close.s1"],s[,"Close.s2"],use="pairwise.complete.obs")

print(corr)

HTH

Pete