We are going to observe correlations and slope in this article. Notice how price changes for GLD on this chart. When you compare SPY vs XOM, there should be high slope and high correlation in the scatter chart. On the other hand, there should be lower slope and lower correlation for SPY vs GLD.
Here is the code to generate two scatter charts for both situations.
Here is SPY vs XOM. Angle of the regression line is quite high, that means high slope. Distrubtion of points is kind of around the regression line, which means higher correlation.
Here is SPY vs GLD. Low slope (angle of the linear regression line) and distrubution of points is all over the chart, which means low correlation.
Here is the correlation in numbers. If we want to see correlation in numbers, we can use daily_returns.corr(method='pearson') from NumPy.
SPY XOM GLD
SPY 1.000000 0.821369 0.076348
XOM 0.821369 1.000000 0.080527
GLD 0.076348 0.080527 1.000000