Methods

Reading a correlation matrix without fooling yourself

A twelve by twelve correlation heatmap in blue and orange

A correlation heatmap is a good first look at a new dataset and a poor last one. It compresses each pair of variables into a single number and invites stories the data cannot support.

A twelve by twelve correlation heatmap in blue and orange
Pearson correlations among twelve features. Orange is positive, blue negative; the diagonal is one by definition.

Four traps

  1. Pearson’s r only sees linear relationships; a perfect U-shape scores near zero.
  2. A single outlier can create or hide a strong correlation.
  3. Correlated features are often both caused by a third you did not measure.
  4. Ordering the matrix by clustering makes patterns look cleaner than they are.

Do this instead

Use the heatmap to choose which pairs to plot, then look at the scatter plots. Add rank correlations alongside Pearson. And treat anything you find as a question for an experiment, not an answer.

The figure below is the reason: pooled, these three groups show almost no correlation; within each group, the relationship is strong and consistent.

Contour lines of three overlapping clusters with sample points
Three clusters that produce a weak overall correlation and strong ones within each group.