Correlation Analysis
Find relationships between variables using Pearson correlation and Seaborn heatmaps
Correlation measures how strongly two variables are related. A positive correlation means as one increases, the other tends to increase. A negative correlation means they move in opposite directions. Correlation analysis is a standard part of EDA — it reveals which factors drive your key metric and which variables can be used to predict others.
Example
Key Points
- ✓Pearson r: 0.8–1.0 = strong, 0.5–0.8 = moderate, 0–0.5 = weak correlation
- ✓Correlation measures LINEAR relationship — it misses non-linear patterns
- ✓.corr() default is Pearson; use method="spearman" for non-normal/ordinal data
- ✓Always visualise correlation with scatter plots — the number alone can be misleading
- ✓Multicollinearity (correlated predictors) is a problem in regression models
Practice Question
A correlation coefficient of -0.85 between Returns and Sales indicates:
Related Topics
Descriptive Statistics in PythonCalculate mean, median, mode, variance, standard deviation and percentilesSeaborn for Statistical ChartsCreate beautiful distribution, correlation and categorical charts with SeabornFeature Engineering for AnalystsCreate new meaningful columns from existing data to improve analysis and modelling