car design and fuel economy
Pearson r for 11 variables measured on 32 cars; the lower triangle shows each pair once.
Compute Pearson or Spearman correlations between 2–30 numeric columns, or draw a matrix you already have. Pairwise n, optional Holm or FDR-adjusted p-values and a colour-blind-safe scale fixed at −1 to 1.
Pearson r for 11 variables measured on 32 cars; the lower triangle shows each pair once.
Spearman ρ for daily ozone, solar radiation, wind and temperature; * marks Holm-adjusted p < 0.05.
A supplied 7 × 7 correlation matrix of supervisor ratings, drawn in full with the diagonal.
Raw data (one row per observation; blank or NA is missing):
ID Age BMI SBP Glucose P01 54 27.1 138 5.9 P02 61 31.4 151 7.2 P03 47 23.8 124
Or a correlation matrix you already have:
Age BMI SBP Age 1 0.21 0.48 BMI 0.21 1 0.39 SBP 0.48 0.39 1
To show one pair with its scatter and fitted line, use Scatter Plot Maker; to compare distributions between groups, use Box Plot Maker.
r, pairwise n, two-sided p-values (t = r√((n − 2)/(1 − r²)), n − 2 df; Spearman with the t approximation as R cor.test(exact = FALSE)), Fisher-z 95% intervals for Pearson r and Holm or Benjamini–Hochberg adjustment are checked against base R cor, cor.test and p.adjust on mtcars, airquality, iris and edge-case files, to a relative difference of 10⁻⁹. Correlation describes association, not cause.
Pearson r measures linear association and suits roughly symmetric variables without strong outliers. Spearman ρ is the Pearson correlation of ranks: it measures monotonic association and is less affected by skew and outliers. Choose before looking at the results and say which one you used; the Methods text does this for you.
Each pair of variables uses the rows where both values are present (pairwise complete, as R cor with use = "pairwise.complete.obs"). The n of every pair is in the n table and its range is in the reading summary and Methods text. Pairs with fewer than 3 shared values show no r.
A matrix of k variables tests k(k − 1)/2 pairs at once: 11 variables already give 55 tests, so some unadjusted p-values fall below 0.05 by chance. Holm controls the chance of any false positive; Benjamini–Hochberg controls the expected share of false positives (FDR). p-values are off by default and adjusted with Holm when you turn them on.
A fixed scale keeps colours comparable between figures and stops a weak correlation from looking strong. Zero sits at the light middle, negative and positive correlations get two different hues, and the default brown–teal and orange–purple scales stay distinguishable with common colour-vision deficiencies. The value and its sign are also printed in the cell.
Yes. Paste a square table whose first column repeats the header names. The matrix is checked for symmetry, a diagonal of 1 and values between −1 and 1, and drawn as given. Choose “A correlation matrix” under The table holds if it is not recognised automatically.
A p-value for r needs the number of observations behind it, which a matrix does not contain (and with missing data it differs per pair). Compute the matrix here from the raw data to get n and adjusted p-values.
No. Tables, Excel files and project files are read and computed in your browser; nothing is sent to a server. The R script lets you reproduce every r, n and p in base R.