Correlation vs regression
Both describe how two variables move together, but they answer different questions. Correlation measures how strongly two things are related, as a single number between −1 and +1. Regression describes the relationship as an equation, a best-fit line you can use to predict one value from the other. This tool gives you both, along with a scatter plot so you can see whether a straight line makes sense at all.
Reading the results
- Pearson r: +1 means a perfect upward straight-line relationship, −1 a perfect downward one, 0 no linear relationship. As a rough guide, 0.2 to 0.4 is weak, 0.4 to 0.7 moderate, above 0.7 strong (the same thresholds apply to negative values).
- R² is r squared: the share of the variation in y that the line accounts for. An R² of 0.81 means 81% of the ups and downs in y line up with x.
- The equation y = bx + a gives the slope (how much y changes for each 1-unit increase in x) and the intercept (the predicted y when x is 0, which may not mean anything if x = 0 is outside your data).
- p-value tests whether the slope is different from zero. Below 0.05 is conventionally significant; with few data points even a decent-looking r can fail this test.
- Spearman's rank correlation measures whether y tends to rise as x rises, without requiring a straight line. If Spearman is much higher than Pearson, the relationship is consistent but curved.
The formulas
slope b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)² intercept a = ȳ − b·x̄
r = Σ(x − x̄)(y − ȳ) ÷ √( Σ(x − x̄)² × Σ(y − ȳ)² )
t = r × √( (n − 2) ÷ (1 − r²) ), p-value from the t-distribution with n − 2 degrees of freedom
Spearman ρ = Pearson r of the ranks (ties get average ranks)
Worked example
The example data is ten months of advertising spend and sales for a small business. The correlation is very strong (r ≈ 0.99), and the line says each extra $1 of ad spend goes with about $5.70 more in sales. Predicting at $2,600 of spend gives about $22,500 in sales, slightly beyond the highest month in the data.
Two cautions an analyst would add. First, $2,600 is outside the range observed, and relationships often flatten as spend rises (ad audiences saturate), so the prediction is optimistic. Second, the months with higher spend might also be the busy season, when sales would have been higher anyway: the line shows association, not the effect of the ads themselves.
Correlation is not causation
A strong correlation tells you two things move together. It doesn't tell you that one causes the other. Common explanations for a correlation without causation include:
- A hidden third factor. Ice-cream sales and sunburn both rise in summer; neither causes the other.
- Reverse causation. Businesses often spend more on ads when sales are already rising.
- Coincidence. With small samples or many variables tested, chance correlations are easy to find.
To show cause and effect you need an experiment, such as an A/B test (see the A/B test calculator), or a careful study design that rules out the alternatives.
Check the scatter plot first
Pearson's r only measures straight-line relationships, and a single extreme point can create or hide a correlation. Look at the chart: if the points curve, fan out, or cluster into separate groups, the numbers alone will mislead. A strong curved pattern can have an r near zero. If one point sits far from the rest, check it in the descriptive statistics calculator and try the analysis with and without it.
Limits
This is simple linear regression with one predictor. Real outcomes usually depend on several factors at once (price, season, competition and marketing together), which needs multiple regression in Excel's Analysis ToolPak, R or Python. Use this tool to explore a relationship quickly, not as the final model for an important decision.
Questions
How many data points do I need?
At least 3 to calculate anything, but results become meaningful with about 20 or more pairs. With 5 points, even r = 0.8 may not be significant.
Which variable should be x?
Put the variable you think drives or predicts the other on x (for example ad spend) and the outcome on y (sales). Correlation is the same either way; the regression line is not.
Is my data uploaded?
No. Everything is calculated in your browser.
Last reviewed 2026-11-25