Test selection & reporting · ~5 min read
Correlation
Pearson and Spearman gave the same real dataset two different answers, 0.22 points apart.
Published
In short
Pearson's r and Spearman's rho both answer "are these two variables related," but Pearson assumes something about the shape of your data that Spearman doesn't need. When that assumption fails, the two coefficients don't just differ slightly, they can diverge by a meaningful margin on the same data. Below is a real result, computed both ways on the same 403-patient dataset, showing exactly how much that gap can be.
What Pearson actually assumes
Pearson's r measures the strength of a straight-line relationship between two continuous variables, and it does this by working directly with the raw values. That makes it sensitive to exactly the kind of skew and outliers common in clinical lab values, where most patients cluster in a normal range and a smaller group of severely affected patients stretches the distribution's tail out considerably. Spearman's rho sidesteps this by first converting both variables to ranks and correlating the ranks instead of the raw numbers, a transformation that makes it far less sensitive to a handful of extreme values.1
A real result: glucose and long-term glycemic control
Vanderbilt's diabetes dataset pairs a same-day stabilized glucose reading (stab.glu) with glycosylated hemoglobin (glyhb), a marker of average blood glucose over roughly the preceding three months, in 403 patients screened for diabetes risk.2 Checking normality first: Shapiro-Wilk rejects it decisively for both variables (stab.glu, W = 0.65, P < .001; glyhb, W = 0.72, P < .001), driven by the same pattern in both, a cluster of patients with normal values and a smaller group of diabetic patients with values far out in the tail.
Pearson r = 0.75 (95% CI, 0.70–0.79) · Spearman ρ = 0.53 (95% CI, 0.45–0.60) · n = 390
Because both stab.glu and glyhb departed significantly from normality (Shapiro-Wilk, P < .001 for each), Spearman's rank correlation was used as the primary measure of association: stabilized glucose and glycosylated hemoglobin were significantly correlated (ρ = 0.53; 95% CI, 0.45–0.60; P < .001). The Pearson correlation on the same data (r = 0.75; 95% CI, 0.70–0.79) is reported for comparison but reflects the small number of extreme values disproportionately.
Figures computed with scipy from real data (Vanderbilt diabetes dataset).
Example data: Vanderbilt University Department of Biostatistics public teaching datasets (hbiostat.org/data). Figures computed with scipy from real data.
That 0.75-versus-0.53 gap is not noise. Pearson's coefficient is being pulled upward by the same handful of severely hyperglycemic patients that broke the normality check in the first place. Running Pearson here by default, because it is the option most software opens with, would report a relationship measurably stronger than the rank-based evidence actually supports.
Writing the AMA sentence
State which coefficient was used and why in the same sentence as the result. "Stabilized glucose and glycosylated hemoglobin were correlated (r = 0.75)" omits the one piece of information a reviewer needs to trust the number: whether the distributional assumption behind it actually held. The version that survives review names the check: "Because both variables departed from normality (Shapiro-Wilk, P < .001), Spearman's rank correlation was used; stabilized glucose and glycosylated hemoglobin were significantly correlated (ρ = 0.53; 95% CI, 0.45–0.60; P < .001)."
Try it yourself
Reproduce this result
The result above comes from a public dataset. Reproduce it in either tool to confirm the numbers match.
In StatsPlease
- Upload the dataset as a CSV.
- Open the Analysis tab.
- Set the two variables: stab.glu and glyhb.
- Press the Correlation preset button. There is no separate run step; pressing the preset runs the analysis, screening normality and routing to Pearson or Spearman.
- On the Results tab, the normality check, coefficient choice, and the AMA sentence are shown together.
In SPSS
- Analyze → Descriptive Statistics → Explore, request Shapiro-Wilk for both variables.
- Confirm both reject normality.
- Analyze → Correlate → Bivariate. Check both Pearson and Spearman under Correlation Coefficients.
- Report the Spearman result as primary.
- Compute the 95% CI separately; SPSS's default output does not include one.
Frequently asked questions
How different can Pearson's r and Spearman's rho be on the same data?
Substantially. On real skewed clinical data, the two coefficients can diverge by 0.2 points or more, because Pearson works with raw values and is sensitive to extreme values, while Spearman works with ranks and is much less affected by them.
How do you decide between Pearson and Spearman correlation?
Check normality in both variables, typically with Shapiro-Wilk. If both are reasonably normal, Pearson is appropriate. If either departs significantly from normality, Spearman's rank correlation is the correctly routed alternative.
Does most statistical software choose the right correlation coefficient automatically?
No. Most software defaults to Pearson unless specifically told otherwise, regardless of whether the data's distribution actually supports it.
You might also read
References
- Nahm FS. Nonparametric statistical tests for the continuous data: the basic concept and the practical use. Korean Journal of Anesthesiology. 2016;69(1):8-14. https://doi.org/10.4097/kjae.2016.69.1.8
- Data obtained from http://hbiostat.org/data courtesy of the Vanderbilt University Department of Biostatistics.
- Bonett DG, Wright TA. Sample size requirements for estimating Pearson, Kendall, and Spearman correlations. Psychometrika. 2000;65(1):23-28. https://doi.org/10.1007/BF02294183
StatsPlease checks normality on your own variables before choosing between Pearson and Spearman, so the coefficient in your results tab is the one your data's actual shape supports.
Upload your data, set the two variables, and press the Correlation preset; pressing it runs the analysis and returns the coefficient with its confidence interval, computed from your data, not generated.
Try StatsPlease free