Skip to main content
KalkuNet

Correlation & Simple Linear Regression Calculator

Pearson and Spearman correlation, r², the regression line, a test of r and predictions.

Calculated in your browserStatistics
Pearson correlation (r)
0.999104
very strong positive relationship
Regression line
y = 45.639906 + 3.047226x
Coefficient of determination (r²)
0.998209
Slope (b)
3.047226
Intercept (a)
45.639906
t statistic (df = 6)
57.828688
p-value for r (two-sided)
0
Standard error of the estimate
0.542198
Spearman correlation (ρ)
1
Pairs
8
Predicted Y at X = 15
91.348288

Formula and sources

r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² × Σ(y − ȳ)²) b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)²; a = ȳ − b·x̄ Test of r: t = r√(n − 2) ÷ √(1 − r²), df = n − 2 Spearman: Pearson correlation of the ranks (ties get the average rank)

  • Least squares and Pearson correlation — introductory statistics

When to use the Correlation & Linear Regression

  • The relationship between two variables

    Pearson correlation measures how strongly two variables move together, from −1 to 1. Examples are study hours and test scores, or advertising spend and sales.

  • A line for predictions

    Linear regression gives the line y = a + bx. Enter a new X to estimate Y, such as sales if the advertising budget goes up.

  • A significance test for a thesis

    The t and p values show whether the correlation differs significantly from zero. Together with r², the share of Y's variation explained by X, the results are ready to report.

  • Spearman for ranked data

    Spearman's correlation uses ranks, so it suits ordinal data such as Likert scales or data that rise together without a straight line.

Frequently asked questions

What value of r is strong?

A common guide for the absolute value of r: 0.0–0.2 very weak, 0.2–0.4 weak, 0.4–0.6 moderate, 0.6–0.8 strong and 0.8–1.0 very strong.

Can I predict outside the data range?

Be careful. Extrapolating far beyond the observed X range can mislead, because the linear relationship may not continue.

How do I enter data from Excel?

Copy the X column into the first box and the Y column into the second, in the same row order. Both boxes must hold the same number of values.

What does r² = 0.81 mean?

81% of the variation in Y is explained by its linear relationship with X, while the other 19% comes from other factors or chance.

What if the relationship is curved?

Pearson correlation and linear regression only capture straight-line relationships. For curved patterns try a transformation such as a logarithm, or use Spearman when the relationship rises or falls consistently.

Related calculators