Correlogram: a correlation matrix shown as a color grid

Updated

A correlogram shows a correlation matrix as a grid of colored cells: one row and one column per variable, and in each cell a color for the correlation between that pair. Strong positive correlations take one hue, strong negative ones another, and values near zero stay pale, so a table of 15, 45 or 100 correlations can be scanned at a glance. It is a screening tool: it tells you which pairs to look at in a scatterplot and which variables travel together.

In time series work, "correlogram" also names a different plot: the autocorrelation of one series against its own past, by lag. This article covers the correlation-matrix version.

When to use it

  • You have five or more numeric variables measured on the same items and want an overview of how they relate.
  • You need to pick candidates for a regression or a matrix plot from a long list of process variables.
  • You want to find groups of variables that move together, which may measure the same underlying thing, before a principal components analysis.
  • You check for collinearity between inputs before a model.

How it works

  1. Compute the Pearson correlation r for every pair of variables, using the rows where both are present.
  2. Arrange them in a square matrix. The diagonal is 1 and the matrix is symmetric, so many correlograms show only one triangle.
  3. Color each cell on a diverging scale: for example, dark blue at −1, white at 0 and dark red at +1. Some versions draw a circle or ellipse in each cell, sized or shaped by |r|.
  4. Print r in each cell, and optionally mark which correlations differ significantly from zero.
  5. Order the variables so related ones sit next to each other, by subject or by a clustering of the correlations.

A correlation is significantly different from zero at the 5% level (two-sided) when |r| exceeds a critical value that depends on the number of rows n:

r_crit = t / √(t² + n − 2), with t = t(0.975, n − 2)

For n = 30, t(0.975, 28) = 2.048 and r_crit = 0.361.

Example

A painting line logs six variables for each of 30 runs: shop humidity (%), shop temperature (°C), paint viscosity (cP), coating thickness (µm), cure time (min) and adhesion (MPa). The correlation matrix (lower triangle):

HumidityShop temp.ViscosityThicknessCure time
Shop temp.0.11
Viscosity−0.20−0.58
Thickness0.05−0.450.84
Cure time0.150.030.210.15
Adhesion−0.70−0.250.530.380.00

Bold values exceed 0.361 in absolute value, so they are significant at the 5% level. As a correlogram, the grid shows two dark-red cells (viscosity with thickness at 0.84, viscosity with adhesion at 0.53), two dark-blue cells (humidity with adhesion at −0.70, shop temperature with viscosity at −0.58) and a mostly pale cure-time row and column.

The pattern suggests two separate stories:

  • A temperature chain. A warmer shop thins the paint (−0.58), thinner paint gives a thinner coat (0.84), and the thinner coat goes with lower adhesion (0.38). Shop temperature's direct correlation with adhesion (−0.25) is weaker, as you would expect at the far end of a chain.
  • Humidity on its own. Humidity has the strongest link to adhesion (−0.70) but is almost unrelated to the other inputs, so it is a separate cause to investigate.
  • Cure time shows no relation to anything, within the range the line ran.

With 15 pairs tested at 5%, you would expect about 0.75 false alarms by chance alone, so the borderline 0.38 deserves a scatterplot before anyone acts on it. The strong correlations do too: a single odd run can create or hide a correlation.

How to read the results

  • Color intensity shows strength; hue shows direction. Pale cells mean little linear relationship.
  • Blocks of strong color among neighboring variables mark groups that move together.
  • The row of the output shows which inputs relate to it; the cells among inputs show collinearity.
  • Significance depends on n. With 300 runs, r = 0.12 is significant but tiny in practice; with 10 runs, r = 0.6 may not be significant.

Common mistakes

  • Skipping the scatterplots. r measures only straight-line relationships and is sensitive to outliers. A curve can give r near 0.
  • Treating every significant cell as a finding. With many pairs, some will pass by chance. Confirm the important ones.
  • Reading cause into correlation. The temperature chain above is a hypothesis, not a proof.
  • Using a rainbow scale. A diverging scale with a neutral middle makes sign and strength readable.
  • Mixing very different sample sizes. If missing values differ by variable, each cell may rest on a different number of rows.

Frequently asked questions

What is a correlogram?

A graphical correlation matrix: a grid of colored cells, one per pair of variables, with color showing the sign and strength of the correlation. In time series analysis, the same word also names the plot of a series' autocorrelations by lag.

How do I know which correlations are significant?

Compare |r| with the critical value for your sample size, r_crit = t / √(t² + n − 2), or use the p-values from a correlation analysis. For 30 rows, |r| above 0.361 is significant at the 5% level.

What is the difference between a correlogram and a matrix plot?

A correlogram gives one number and color per pair, so it scales to many variables. A matrix plot shows the full scatterplot for each pair, which reveals curves and outliers but only works for a handful of variables. Use the correlogram to choose which pairs to plot.

Why are the variables reordered?

Placing correlated variables next to each other turns scattered cells into visible blocks. Ordering by clustering does this automatically.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab