Correlation measures how two variables move together, which helps scientists, engineers, and students describe patterns in data. Pearson correlation is designed for straight-line relationships, while Spearman correlation is designed for ranked or monotonic relationships. Comparing them helps you choose a statistic that matches the shape of your scatterplot.
This matters because the wrong correlation can hide a real pattern or exaggerate a weak one.
Pearson uses the actual numerical values and measures how closely points cluster around a line. Spearman first converts values to ranks, then measures how well the ranks move together, so it can detect curved but consistently increasing or decreasing patterns. Outliers can strongly affect Pearson because extreme values change means, standard deviations, and the fitted linear pattern.
Spearman is often more resistant to outliers, but it can lose information when exact distances between values matter.
Understanding Statistics: Pearson vs Spearman Correlation
A scatterplot should guide the choice before any calculation. Imagine study time on the horizontal axis and test score on the vertical axis. If each extra hour tends to add about the same number of marks, a straight line is a sensible summary.
Pearson works well because it compares each value with the average value in its variable. It gives more weight to the actual gaps in the data.
A change from two to six hours is treated as a larger change than two to three hours. This is useful when the measured distances have real meaning, such as temperature, mass, speed, or exam marks.
Spearman changes the task by replacing values with their positions in order. The smallest value gets the lowest rank, the next gets the next rank, and so on. It then checks whether high positions in one list tend to match high positions in the other list.
This makes it useful for data such as finishing places in a race, customer ratings, or pain scores. These scales have an order, but the gap between ranks may not be consistent.
The difference between first and second place does not necessarily equal the difference between tenth and eleventh place. Ranking avoids pretending that such gaps are equal.
A monotonic pattern keeps moving in one overall direction. As one variable rises, the other mostly rises, or it mostly falls. The rate of change can vary.
For example, practice may improve performance quickly at first, then more slowly as a student becomes skilled. The graph can bend while still rising throughout. Spearman can show a strong relationship here, even when Pearson is lower because no single straight line fits the curve well.
Neither measure is a general detector of every pattern. A U-shaped graph can have a strong visible pattern but a correlation close to zero, since increases in one part of the graph are balanced by decreases in another part.
Outliers deserve careful attention. One unusual point can pull a straight-line result toward itself, especially in a small data set. A very tall student with an unusually large shoe size may make height and shoe size appear more closely linked than they are for most students.
Spearman reduces this influence because an extreme measurement usually becomes only the highest or lowest rank. It is not completely protected, particularly when there are few observations. Students should plot the data, check for clusters and isolated points, and consider whether an outlier is a recording error or a real case.
Tied values need care too. When several students receive the same score, they are assigned average ranks.
Correlation describes association, not cause. A strong result cannot prove that one variable produces changes in the other.
Key Facts
- Pearson correlation measures linear association between two quantitative variables.
- Spearman correlation measures monotonic association by applying Pearson correlation to ranks.
- Pearson formula: r = cov(x,y) / (sx sy).
- Spearman with no tied ranks: rho = 1 - 6 sum(d_i^2) / (n(n^2 - 1)).
- Both Pearson r and Spearman rho range from -1 to +1.
- Use Pearson for straight-line patterns with few outliers, and use Spearman for rank data, curved monotonic patterns, or strong outlier concerns.
Vocabulary
- Pearson correlation
- A statistic that measures the strength and direction of a linear relationship between two numerical variables.
- Spearman correlation
- A statistic that measures the strength and direction of a monotonic relationship by comparing the ranks of two variables.
- Linear relationship
- A relationship in which the data pattern is well described by a straight line.
- Monotonic relationship
- A relationship in which one variable tends to consistently increase or consistently decrease as the other changes, even if the pattern is curved.
- Outlier
- A data point that is far from the overall pattern and can strongly influence some statistical measures.
Common Mistakes to Avoid
- Using Pearson for a curved monotonic pattern, which is wrong because Pearson only measures how well the data follow a straight line.
- Using Spearman when the actual spacing between values is important, which is wrong because ranking removes information about the size of gaps between data points.
- Ignoring outliers before computing correlation, which is wrong because a single extreme point can greatly change Pearson r and sometimes change the interpretation.
- Treating correlation as proof of causation, which is wrong because two variables can be correlated due to a third variable, coincidence, or reverse direction of influence.
Practice Questions
- 1 For the data x = 1, 2, 3, 4 and y = 2, 4, 6, 8, what is the Pearson correlation r?
- 2 For the data x = 1, 2, 3, 4 and y = 10, 30, 20, 40, rank both variables and compute Spearman rho using rho = 1 - 6 sum(d_i^2) / (n(n^2 - 1)).
- 3 A scatterplot rises quickly at first and then levels off, with no major outliers. Explain whether Pearson or Spearman is more appropriate and why.