Pearson Correlation: Formula, Assumptions, Interpretation and Examples
Pearson correlation measures the strength and direction of a linear relationship between two quantitative variables.
Pearson correlation measures the strength and direction of a linear relationship between two quantitative variables.
The result is expressed as the Pearson correlation coefficient, usually written as r. Its value ranges from −1 to +1:
- r = +1 indicates a perfect positive linear relationship.
- r = −1 indicates a perfect negative linear relationship.
- r = 0 indicates no linear relationship.
Pearson correlation is widely used in research, business analytics, finance, healthcare, social science, and data analysis. However, the coefficient can be misleading when the relationship is nonlinear, the data contain influential outliers, observations are not independent, or the sample does not represent the population of interest.
This guide explains how Pearson correlation works, how to interpret it correctly, which assumptions matter, and when another correlation method may be more appropriate.
What Is Pearson Correlation?
Pearson correlation, also called Pearson’s r or the Pearson product-moment correlation coefficient, measures how closely two variables follow a straight-line relationship.
Consider two simple examples:
- If study time tends to increase as exam scores increase, the variables may have a positive correlation.
- If outdoor temperature tends to increase as heating costs decrease, the variables may have a negative correlation.
A coefficient close to zero means there is little or no linear association. It does not necessarily mean that the variables are unrelated. They may still have a curved, cyclical, U-shaped, or otherwise nonlinear relationship.
Unlike covariance, Pearson correlation is standardized. It is therefore unaffected by the measurement units used for the two variables.
Pearson Correlation Formula
The sample Pearson correlation coefficient is:
| r = ∑ i=1 n (x i − x̄)(y i − ȳ) √ ∑ i=1 n (x i − x̄) 2 × √ ∑ i=1 n (y i − ȳ) 2 |
|---|
Where:
- xi and yi are paired observations.
- x̄ and ȳ are the sample means.
- n is the number of paired observations.
The numerator measures how the two variables vary together. The denominator scales that value using the variability of each variable, producing a coefficient between −1 and +1.
Pearson correlation can also be expressed as standardized covariance:
| r = cov(X, Y) s X s Y |
|---|
In practice, software such as R, Python, SPSS, Excel, Stata, SAS, and Google Sheets calculates the coefficient automatically. The more important task is deciding whether the method is appropriate and interpreting the result responsibly.
How to Interpret Pearson’s r
The sign of r shows the direction of the relationship:
- A positive value means the variables tend to increase or decrease together.
- A negative value means one variable tends to increase as the other decreases.
- A value near zero means there is little linear association.
The absolute value shows the strength of the linear relationship. Values closer to 1 indicate a stronger linear pattern.
| Absolute value of r | Possible interpretation |
|---|---|
| 0.00 to 0.19 | Very weak |
| 0.20 to 0.39 | Weak |
| 0.40 to 0.59 | Moderate |
| 0.60 to 0.79 | Strong |
| 0.80 to 1.00 | Very strong |
These thresholds are not universal rules. Interpretation should depend on the research context, measurement reliability, sample size, prior evidence, and practical consequences.
Pearson Correlation Example
Suppose a researcher measures weekly study hours and exam scores for a group of students and obtains:
| r = 0.70 |
|---|
This result indicates a relatively strong positive linear association. Students who study more hours tend to have higher exam scores.
However, the result does not prove that additional study time caused the higher scores. Other factors, such as prior knowledge, motivation, tutoring, sleep, or course difficulty, may affect both variables.
The coefficient also does not tell us whether the relationship is perfectly linear, whether outliers are influencing the result, or whether the pattern applies to students outside the sample. A scatter plot and additional analysis are still necessary.
What Does r2 Mean?
Squaring the correlation coefficient produces the coefficient of determination:
| r 2 |
|---|
For example:
| r = 0.70 r 2 = 0.49 |
|---|
In a simple linear regression with one predictor, r2 = 0.49 means that the fitted linear model accounts for approximately 49% of the observed variance in the outcome variable.
In a correlation-only discussion, it is also common to describe this as approximately 49% shared linear variance between the two variables.
This should not be interpreted as proof that one variable causes 49% of the change in the other. The value describes statistical association, not causation.
When Should You Use Pearson Correlation?
Pearson correlation is generally suitable when:
- Both variables are quantitative and measured on an interval or ratio scale.
- Each observation contains a valid pair of values.
- The observations are independent.
- The relationship is reasonably linear.
- There are no extreme or highly influential outliers.
- The data provide enough variation across the relevant range.
Before calculating the coefficient, create a scatter plot. A visual inspection can reveal curvature, clusters, data-entry errors, restricted ranges, unusual subgroups, and influential observations that a single coefficient may hide.
Does Pearson Correlation Require Normal Data?
Normality is frequently misunderstood in discussions of Pearson correlation.
You can calculate Pearson’s r even when the variables are not normally distributed. The coefficient itself does not require perfect normality.
Distributional assumptions become more important when you use conventional hypothesis tests, confidence intervals, or other inferential procedures, particularly with small samples. These procedures are commonly based on assumptions related to bivariate normality and independent observations.
With larger samples, moderate departures from normality may be less problematic for inference. Severe skewness, heavy tails, extreme outliers, or unusual dependence structures can still distort results.
In most practical analyses, checking linearity, independence, measurement quality, and influential observations is at least as important as checking marginal normality.
Important Assumptions and Data Checks
1. Quantitative variables
Pearson correlation is designed for quantitative variables. It is not usually appropriate for unordered categories.
Ordinal variables may be better analyzed using a rank-based method such as Spearman correlation or Kendall’s tau, depending on the research question and measurement scale.
2. Linearity
Pearson’s r measures linear association. A strong nonlinear pattern can produce a coefficient close to zero.
Always inspect a scatter plot rather than relying only on the coefficient.
3. Independent observations
Each pair of observations should be independent of the others.
Repeated measurements from the same participant, clustered data, time-series observations, or data collected from related individuals may violate this assumption. In those situations, multilevel models, repeated-measures methods, time-series techniques, or other specialized analyses may be required.
4. Influential outliers
A single extreme point can substantially increase, decrease, or reverse a Pearson correlation.
Investigate unusual observations carefully. Do not remove an outlier only because it weakens the result. Determine whether it is a data error, a valid extreme case, or evidence that the assumed model is inappropriate.
5. Adequate range
A restricted range can make a correlation appear weaker than it is in the broader population.
For example, studying the relationship between test scores and academic performance only among top-performing students may produce a smaller correlation because the sample contains little variation.
6. Reliable measurement
Measurement error can reduce the observed correlation. Two variables may be strongly related in theory but show a modest coefficient when one or both are measured unreliably.
Pearson Correlation and Statistical Significance
A correlation coefficient describes the direction and strength of an observed linear relationship. A hypothesis test addresses a different question.
A typical significance test evaluates the null hypothesis:
| H 0 : ρ = 0 |
|---|
Here, ρ represents the population correlation.
A small p-value indicates that the observed result would be relatively unusual under the assumptions of the test if the population correlation were zero.
It does not prove that:
- the relationship is important;
- the relationship is causal;
- the result will replicate;
- the data are unbiased;
- the assumptions are satisfied;
- the population correlation is large.
A very small correlation can be statistically significant in a large sample, while a practically important correlation may fail to reach conventional significance in a small sample.
Report the coefficient, sample size, confidence interval, p-value when relevant, and practical interpretation together.
Confidence Intervals for Pearson Correlation
A confidence interval communicates the uncertainty surrounding the estimated correlation.
| r = 0.42, 95% CI [0.18, 0.61] |
|---|
This is more informative than reporting r = 0.42 alone.
The interval shows the range of population correlation values reasonably compatible with the data and statistical model. Wide intervals indicate substantial uncertainty, often because the sample is small or the data are highly variable.
Confidence intervals for correlations are commonly calculated using Fisher’s z transformation or appropriate bootstrap procedures.
Pearson vs Spearman vs Kendall Correlation
The best correlation method depends on the variable types, relationship shape, sample characteristics, and research objective.
Use Pearson correlation when:
- both variables are quantitative;
- the relationship is approximately linear;
- influential outliers are not dominating the result;
- the goal is to measure linear association.
Use Spearman rank correlation when:
- the variables are ordinal or can be meaningfully ranked;
- the relationship is monotonic but not necessarily linear;
- the data are strongly skewed;
- outliers make Pearson correlation unstable;
- ranking is more meaningful than the original numerical distance.
Spearman correlation measures whether higher values of one variable tend to correspond to higher or lower values of the other.
Use Kendall’s tau when:
- the variables are ordinal;
- the analysis focuses on concordant and discordant pairs;
- rank agreement is central to the research question;
- the sample is small and a rank-based measure is appropriate;
- ties and ranking structure require a method designed around pairwise ordering.
Kendall’s tau is not selected simply because a dataset is small. The choice should reflect the measurement scale, estimand, tie structure, assumptions, and interpretation required.
Pearson Correlation vs Covariance
Covariance shows whether two variables tend to move together, but its magnitude depends on the units of measurement.
For example, changing a variable from meters to centimeters changes the covariance.
Pearson correlation divides covariance by the product of the variables’ standard deviations. This standardization makes the result unit-free and easier to compare across datasets.
Covariance is useful in statistical theory, portfolio analysis, and multivariate modeling. Pearson correlation is usually easier to interpret when the goal is to describe the strength and direction of a linear relationship.
Common Pearson Correlation Mistakes
Confusing correlation with causation
A strong correlation does not establish that one variable causes the other.
Possible explanations include:
- reverse causation;
- confounding variables;
- selection bias;
- measurement artifacts;
- shared trends;
- coincidence;
- direct causation;
- indirect causation.
Causal conclusions usually require a stronger research design, temporal evidence, theoretical justification, and methods suited to causal inference.
Treating zero correlation as independence
A Pearson correlation of zero means there is no linear association. It does not prove statistical independence.
Ignoring the scatter plot
Very different datasets can produce the same Pearson correlation coefficient.
A scatter plot can reveal:
- nonlinear patterns;
- clusters;
- influential observations;
- subgroups;
- changing variability;
- data-entry problems;
- unusual ranges.
Reporting only the p-value
The p-value does not communicate the strength of the relationship. Report the correlation coefficient, confidence interval, sample size, and practical meaning.
Using Pearson correlation for ordinal categories
Numerical codes do not automatically make a variable quantitative. A rank-based method may be more defensible for ordinal scales.
Ignoring missing data
Correlation calculations often use complete pairs only. State how missing data were handled and how many paired observations were included.
Testing many correlations without adjustment
A large correlation matrix can generate statistically significant results by chance.
Consider:
- multiple-comparison adjustments;
- preregistered hypotheses;
- replication;
- validation datasets;
- effect-size thresholds;
- domain knowledge.
Interpreting correlation matrices without checking redundancy
Highly correlated predictors may create multicollinearity in regression models. However, removing features solely because they are correlated can also discard useful information.
Partial Correlation
Partial correlation measures the linear relationship between two variables while statistically controlling for one or more additional variables.
For example, a researcher may examine the relationship between exercise and blood pressure while controlling for age.
Partial correlation can help investigate whether an association remains after accounting for measured covariates. It does not automatically remove confounding or establish causality.
Pearson Correlation in Regression Analysis
In simple linear regression with one predictor:
- the sign of the regression slope matches the sign of Pearson’s r;
- r2 equals the model’s coefficient of determination;
- the correlation summarizes linear association;
- the regression model estimates an expected change in the outcome associated with a change in the predictor.
Correlation treats the two variables symmetrically. Regression assigns different roles to the predictor and outcome.
The correlation between X and Y is the same as the correlation between Y and X, but the regression of Y on X is not generally identical to the regression of X on Y.
Real-World Applications of Pearson Correlation
Healthcare
Researchers may examine relationships between dosage, biomarker levels, treatment response, blood pressure, age, or recovery time.
Finance
Analysts may study how asset returns move together, although financial time series often require additional checks for nonstationarity, volatility clustering, and changing correlations.
Education
Researchers may investigate relationships among attendance, study time, assessment scores, motivation, and academic outcomes.
Environmental science
Analysts may examine associations involving temperature, rainfall, pollution, biodiversity, and other environmental measurements.
Business analytics
Organizations may study relationships among price, sales, advertising expenditure, customer satisfaction, retention, and operational performance.
Machine learning
Correlation matrices can help identify linear redundancy, detect possible multicollinearity, and support exploratory feature analysis.
Correlation should not be used as the only feature-selection method. Nonlinear relationships, interactions, data leakage, causal structure, model requirements, and out-of-sample performance must also be considered.
How to Calculate Pearson Correlation
In Excel
=CORREL(array1, array2)
or:
=PEARSON(array1, array2)
In Google Sheets
=CORREL(data_y, data_x)
In Python
Using pandas:
correlation = dataframe["x"].corr( dataframe["y"], method="pearson" )
Using SciPy:
from scipy.stats import pearsonr result = pearsonr(x, y) print(result.statistic) print(result.pvalue)
In R
cor(x, y, method = "pearson", use = "complete.obs")
For a hypothesis test and confidence interval:
cor.test(x, y, method = "pearson")
Always verify how the software handles missing values, ties, invalid observations, and confidence intervals.
How to Report Pearson Correlation
A clear report should include:
- the variables analyzed;
- the sample size;
- the correlation coefficient;
- the direction and strength of the association;
- the confidence interval;
- the p-value when inferential testing is relevant;
- a practical interpretation;
- confirmation that important assumptions and plots were examined.
Example:
There was a moderate positive linear association between weekly study time and exam score, r = .46, 95% CI [.25, .63], \(p < .001\), based on 120 complete observations.
Pearson Correlation Checklist
- Confirm that both variables are quantitative.
- Check that observations are paired correctly.
- Inspect a scatter plot.
- Assess whether the relationship is approximately linear.
- Investigate outliers and influential observations.
- Check whether observations are independent.
- Review missing-data handling.
- Consider whether range restriction may affect the result.
- Report r, sample size, and a confidence interval.
- Include a p-value only when hypothesis testing is relevant.
- Avoid causal language unless the research design supports it.
- Compare with a rank-based method when Pearson correlation is questionable.
Final Takeaway
Pearson correlation remains one of the most useful statistics for summarizing linear relationships between quantitative variables.
Its simplicity is also its main limitation. A single coefficient cannot reveal nonlinear patterns, establish causality, diagnose poor data quality, or replace visual inspection.
Use Pearson’s r when the research question concerns linear association and the data support that analysis. Interpret it alongside a scatter plot, confidence interval, sample size, subject-matter knowledge, and an honest assessment of the study design.
Frequently Asked Questions
What does a Pearson correlation of 0.7 mean?
A Pearson correlation of 0.7 indicates a relatively strong positive linear association. Higher values of one variable tend to occur with higher values of the other. It does not prove causation.
Is a Pearson correlation of zero proof that two variables are unrelated?
No. It indicates no linear association. The variables may still have a strong nonlinear relationship.
Can Pearson correlation be used with non-normal data?
Yes, the coefficient can be calculated for non-normal data. However, severe skewness, heavy tails, influential outliers, and small samples may affect interpretation and conventional inferential procedures.
When should I use Spearman instead of Pearson correlation?
Use Spearman correlation when the variables are ordinal, the relationship is monotonic but nonlinear, or outliers and distributional problems make Pearson correlation inappropriate.
Does a significant correlation mean the relationship is important?
No. Statistical significance depends partly on sample size. Practical importance should be judged using the coefficient, confidence interval, subject context, measurement quality, and real-world consequences.
Can a high Pearson correlation be misleading?
Yes. A high value may be driven by outliers, confounding, range selection, shared trends, repeated observations, or data errors. Always inspect the data and study design.
What is the difference between r and r2?
r describes the direction and strength of a linear association. In simple linear regression, r2 represents the proportion of outcome variance accounted for by the fitted linear model.
Is Pearson correlation suitable for time-series data?
Not automatically. Two trending time series can show a high correlation even when there is no meaningful relationship. Time-series data may require detrending, stationarity checks, lag analysis, and specialized models.
