Skip to content
NexUnit home
EnglishEspañol

Correlation & Linear Regression Calculator

Fit a least-squares line to paired data and get the correlation coefficient r, R² and predictions.

Line of best fit

y = 0.5000909091x + 3.000090909

Correlation (r)
0.8164205163
R²
0.6665424595
Slope
0.5000909091
Intercept
3.000090909
Pairs
11

Show the work

  1. Means of x and y

    x̄ = Σx ÷ n; ȳ = Σy ÷ n

    99 ÷ 11; 82.51 ÷ 11 = 9, 7.500909091

  2. Slope

    b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄) to the power of 2

    55.01 ÷ 110 = 0.5000909091

  3. Intercept

    a = ȳ − b × x̄

    7.500909091 − 0.5000909091 × 9 = 3.000090909

  4. Line of best fit

    y = bx + a

    y = 0.5000909091x + 3.000090909

How it works

slope = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)²; intercept = ȳ − slope × x̄; r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² Σ(y − ȳ)²)

Questions

How does the correlation & linear regression calculator work?
slope = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)²; intercept = ȳ − slope × x̄; r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² Σ(y − ȳ)²).
What do I need to enter?
X values, Y values (same order), Predict y at x =. Optional fields can be left blank.

Want this on your site? Embed the correlation & linear regression calculator.