Pearson correlation: linear association
Pearson’s correlation coefficient describes how closely two measurements follow a straight-line relationship.
Fit
When to use it, and when not to
Use it when
- Each independent person contributes one value for each of two continuous variables.
- A scatter plot suggests a linear relationship without a single dominating point.
Not when
- The relationship is monotonic but curved, or the values are ranks. Consider Spearman correlation, covered in the correlation overview. Read: Choosing a correlation coefficient
- You need change in outcome units per exposure unit or covariate adjustment. Use regression. Read: Linear regression
- You compare two methods measuring the same quantity. Assess agreement. Read: Bland-Altman method comparison
Before you start
What you need
- Matched x and y values in the same orderKeep each person’s two values together and check equal list lengths.
- A scatter plot of all pairsLook for curves, unusual points and groups with different trends.
- The population and range of measurementsRestriction of the range can change the coefficient. Describe how participants were selected.
- Pairs from different people are independent.How to check: Repeated visits or shared clinics need methods that account for dependence.
- Both variables vary in the sample.How to check: A constant variable has no defined correlation coefficient.
- The usual small-sample t test assumes a bivariate normal model.How to check: Inspect the joint pattern. Nonnormal data may need a justified alternative inferential method.
Plain language
How it works
Center each variable by subtracting its mean. Pearson’s coefficient compares how the centered values move together with how much each variable varies. It lies between minus one and plus one. Zero means no linear association, not necessarily no relationship.
Bishara and Hittner’s simulation studies show that nonnormality can affect both the coefficient and its usual significance test. Plot the paired observations and justify the inferential method rather than choosing from the p-value.
Worked example
A worked example
- Setting
- 5 independent people each supply two measurements.
- Question
- How strong is their linear association?
- Approach
- x values: 1, 2, 3, 4, 5. y values: 2, 1, 4, 3, 5.
- Result
- Pearson r = 0.800; r squared = 0.640, or 64.0% of sample variation in a simple linear fit. The two-sided p = 0.104.
- What it means
- The positive sample association has substantial uncertainty. It establishes neither agreement between measurements nor a causal relationship.
In practice
Recent studies PubMed search · not vetted
Watch out
Common mistakes
The one to remember
Pearson correlation is not a slope, agreement measure or causal effect. A curved relationship, restricted range or influential point can mislead.
- Calling the coefficient the change in y per unit of x.Instead: That quantity is a regression slope and has units.
- Calling squared correlation a causal percentage.Instead: It describes sample linear fit, without identifying a cause.
Inside Mallard
How Mallard uses this
Mallard links this article to its Pearson calculator. The tool reports the sample coefficient, its square and a t-based p-value. The method registry links this method to its published analysis article and code.
correlation-pearson-spearman).analysis.pearson_correlation, the id a plan cue records.Work it out
Related Learn pages
Related designs and methods
Evidence
Sources & further reading
- Testing the significance of a correlation with nonnormal data: comparison of Pearson, Spearman, transformation, and resampling approaches (opens in a new tab) · Psychol Methods · doi 10.1037/a0028087
- Reducing Bias and Error in the Correlation Coefficient Due to Nonnormality (opens in a new tab) · Educ Psychol Meas · doi 10.1177/0013164414557639