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
Means of x and y
x̄ = Σx ÷ n; ȳ = Σy ÷ n
99 ÷ 11; 82.51 ÷ 11 = 9, 7.500909091
Slope
b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄) to the power of 2
55.01 ÷ 110 = 0.5000909091
Intercept
a = ȳ − b × x̄
7.500909091 − 0.5000909091 × 9 = 3.000090909
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.
Related tools
- Weighted Average CalculatorAverage a list of values where each one counts by its own weight.
- Z-Score CalculatorTurn a value into a z-score (standard score) and find the share of a normal distribution below and above it.
- Percentile CalculatorFind the value at any percentile of a data set, and the percentile rank of a value.
- Quartile & Five-Number Summary CalculatorGet the quartiles, interquartile range (IQR), five-number summary and outliers of a data set.
- Confidence Interval CalculatorFind the confidence interval for a mean from the sample mean, standard deviation and sample size.
- Sample Size CalculatorFind how many people to survey (or measurements to take) for a chosen margin of error and confidence level.
Want this on your site? Embed the correlation & linear regression calculator.