Correlation Heatmap Maker
Fitness example data Medical example dataHere you can create a correlation heatmap online, free and without installing anything. Simply copy your data into the table above and select three or more metric variables. numiqo then calculates the full correlation matrix and draws the heatmap underneath it. Just try it with the example data.
How to create a correlation heatmap
- Copy your data into the table above, one variable per column.
- Select at least three metric variables.
- The correlation matrix appears with the coefficients and p-values, and the heatmap is drawn below it.
- Use the options beside the chart to show the coefficients in the cells, mark significant correlations, sort the variables by similarity, or hide the repeated upper half.
- Download the finished chart as PNG or SVG, or copy it straight into your document.
You can switch between Pearson, Spearman and Kendall's tau at any time. The heatmap always shows the coefficient you selected, and names it in the chart title so a figure cannot be confused later.
The fitness example contains eight measurements from 60 people: age, BMI, body fat, waist circumference, resting heart rate, VO2 max, weekly exercise hours and grip strength. Select all eight to see two groups of related variables appear, which is far easier to spot in colour than in a table of 64 numbers.
How to read a correlation matrix
Every cell holds one correlation coefficient, for the variable in that row and the variable in that column. Three properties are always true:
- The diagonal is always 1. Each variable correlates perfectly with itself, so the diagonal carries no information.
- The matrix is symmetric. The correlation of A with B is the same as B with A, so the upper half repeats the lower half. Switch off the upper half to make the remaining cells easier to read.
- The coefficient runs from -1 to +1. Near +1 both variables tend to rise together, near -1 one rises while the other falls, and near 0 there is no linear relationship.
In the fitness example, BMI and body fat correlate at about 0.89: people with a higher BMI tend to have a higher body fat percentage. VO2 max and resting heart rate correlate at about -0.72, in the opposite direction: the fitter someone is, the lower their resting pulse tends to be.
How to read the colours
Red cells are positive correlations, blue cells are negative ones, and near-white cells are close to zero. The colour scale is fixed to the full range from -1 to +1 rather than to the range that happens to occur in your data. That means the same colour always stands for the same value, so two heatmaps can be compared directly and a moderate correlation is never painted as if it were extreme.
Switch on Value labels to print the coefficient inside each cell. numiqo does this automatically for up to ten variables and turns it off above that, because the cells become too small for readable numbers. For a larger matrix, read the colours for the overall pattern and take exact values from the correlation table above the chart.
What the significance stars mean
Setting Significance to Stars adds an asterisk to each cell based on the p-value of that correlation:
- * means p is below .05
- ** means p is below .01
- *** means p is below .001
The p-value answers one narrow question: how likely a correlation this large would be if the two variables were in truth unrelated in the population. A small p-value does not mean the correlation is strong, and a large one does not mean the variables are unrelated. Strength is read from the coefficient itself, and with a large sample even a correlation of 0.15 can carry three stars.
One caution applies to every correlation matrix. A matrix of 10 variables contains 45 separate tests, and at a 5% significance level you would expect roughly two of them to reach significance by chance alone even if nothing were related. Treat individual stars in a large matrix as exploratory, and confirm the relationships that matter with a hypothesis stated in advance, or apply a correction for multiple comparisons.
The alternative setting, Hide non-significant, leaves cells with p of .05 or above empty instead. It gives a cleaner figure, but it also removes the coefficient, so a correlation of 0.29 at p = .06 becomes indistinguishable from one of 0.01. Stars keep both pieces of information visible.
Sorting the variables by similarity
Variables usually arrive in the order they were collected, which is rarely the order that makes the structure visible. Setting Order to By similarity rearranges rows and columns so that variables correlating with each other sit next to each other, using the angular order of eigenvectors. Groups of related variables then appear as blocks along the diagonal.
It is worth trying on the fitness example. In collection order the matrix looks like a checkerboard. Sorted by similarity, the body composition measures (BMI, body fat, waist circumference and resting heart rate) gather into one block, the fitness measures (VO2 max, weekly exercise and grip strength) into another, and age settles between them because it belongs to neither. The numbers do not change, only their arrangement.
What a correlation matrix cannot tell you
- Correlation is not causation. Two variables can move together because one causes the other, because both depend on a third, or by coincidence.
- Pearson only sees straight lines. A clear curved relationship can produce a coefficient near zero. Check a scatter plot before concluding that there is no relationship.
- Outliers move the result. A single extreme point can create or hide a strong correlation, especially in small samples.
- Missing values are handled case by case. numiqo uses complete cases across the variables you selected, so a person missing one value is excluded from every correlation in the matrix. Adding one sparsely measured variable can therefore lower the sample size for all pairs.
Using the heatmap in a report
When the heatmap is meant to replace the correlation table, switch on Value labels so the figure carries the coefficients, and state the sample size and the coefficient used in the caption. If you show stars, keep the note under the chart, since asterisks without their thresholds cannot be interpreted by a reader.
For the full table of coefficients, p-values and covariances, use the correlation calculator, or read the correlation tutorial for the background on how the coefficients are calculated and interpreted.