+Calculator+

Linear Regression Calculator

Fit a least-squares line to paired (x, y) data. Returns slope, intercept, correlation r, R squared, residuals, and standard error.

Data points

Separate x and y with a comma, space, or tab. Need at least 2 points with distinct x values.

Regression equation

y = 1 × x + 1.333333

Correlation (r)

0.9165

R squared

0.84

Slope

1

Intercept

1.3333

Mean x

3.5

Mean y

4.8333

SSE

3.3333

SST

20.8333

Std. error

0.9129

Points (n)

6

Frequently Asked Questions about the Linear Regression Calculator

What is least squares regression?
Least squares finds the line that minimizes the sum of squared vertical distances from each data point to the line. Squaring penalizes large misses more than small ones and produces a unique slope and intercept for any non-degenerate dataset.
What is the difference between r and R squared?
Pearson r ranges from minus 1 to plus 1 and shows the direction and strength of the linear relationship. R squared is r times r, ranges from 0 to 1, and tells you the share of variance in y explained by the line. R squared of 0.81 means 81 percent of the variation in y is captured by x.
What are residuals and why do they matter?
A residual is the gap between an observed y value and the value the regression line predicts. Plotting residuals reveals whether the linear fit is appropriate. A random scatter is good. A curve or funnel shape means the relationship is not actually linear.
Does a strong correlation prove causation?
No. Regression measures association, not cause. Ice cream sales and drownings both rise in summer, but one does not cause the other. To claim causation you need a controlled experiment or a careful causal-inference design, not just a high r.
When should I not use linear regression?
Skip it when the scatter plot is clearly curved, when residuals fan out as x grows, when a few outliers dominate the slope, or when the data are categorical or counts with many zeros. Polynomial, logistic, or robust regression often fit those cases better.