Block 93: Correlation & Covariance
Measure and visualize relationships between numeric variables.
Concepts
- Pearson vs Spearman correlation
- df.corr() and np.corrcoef()
- Interpreting correlation coefficients: strength and direction
- Correlation ≠ causation examples
Code Examples
See exercise below.
Exercise
Compute correlation matrix for a dataset. Identify 3 strongest and 3 weakest correlations. Create a heatmap. Pick one pair and discuss whether correlation implies causation.
Homework
Find a famous example of 'correlation ≠ causation'. Write a 100-word explanation.