Least Squares Regression Line Calculator

Enter paired data to calculate regression equations, correlation, predictions, confidence intervals, residual diagnostics, interactive charts, and downloadable reports with clear statistical explanations and insights.

Calculator Options

Paired Data

Use x and y as the first two columns. A third column may contain weights.

#X valueY valueWeightAction
1
2
3
4
5
6

Summary Statistics

Summary mode calculates the main model statistics. Raw data is required for charts, residuals, leverage, Cook's distance, and point-level predictions.

Start over

Formula Used

The least-squares line estimates the expected response for each predictor value. It minimises the sum of squared vertical residuals. The fitted equation is written as y-hat equals intercept plus slope times x.

ŷ = b₀ + b₁x
b₁ = Σ[(xᵢ − x̄)(yᵢ − ȳ)] / Σ[(xᵢ − x̄)²]
b₀ = ȳ − b₁x̄
R² = 1 − SSE / SST

How to Use

Choose raw data or summary statistics. Enter paired observations and select the regression method. Add prediction values when forecasts are required.

Review the equation, fit statistics, and confidence intervals. Inspect residual plots and diagnostic flags carefully. Avoid relying on extrapolated predictions without supporting evidence.

Example Data

xyInterpretation
12.1First observed pair
23.9Response increases
36.2Near the fitted trend
48.1Moderate positive pattern
510.2Continued increase
611.8Last observed pair

Frequently Asked Questions

What is a least-squares regression line?

It is the straight line minimising squared vertical residuals. It summarises a linear relationship between two variables. It supports estimation within the observed data range.

What does the slope represent?

The slope measures expected response change per x unit. Positive slopes indicate increasing fitted responses. Negative slopes indicate decreasing fitted responses.

What does the intercept represent?

The intercept is the fitted response when x equals zero. It may lack practical meaning outside observed values. Interpret it within the study context.

What is the difference between r and R²?

Pearson r gives direction and linear association strength. R² gives the fitted variation proportion. Neither measurement proves a causal relationship.

When should regression pass through the origin?

Use it only when theory requires a zero intercept. Forcing zero can distort slopes and residuals. Compare assumptions before selecting this option.

What is weighted least squares?

Weighted regression gives observations different influence levels. Larger weights contribute more to estimation. Weights should reflect known precision or importance.

What is a residual?

A residual equals observed y minus predicted y. Residual patterns reveal possible model problems. Random scatter supports the linear model assumptions.

What is extrapolation?

Extrapolation predicts beyond the observed x range. Such estimates may be unreliable or misleading. Use subject knowledge before accepting extrapolated values.

Why are confidence and prediction intervals different?

Confidence intervals estimate the mean fitted response. Prediction intervals estimate individual future observations. Prediction intervals are usually wider than confidence intervals.

Related Calculators

Average Calculator StatisticsGeometric Mean CalculatorInter Quartile Range CalculatorLower Quartile CalculatorMaximum CalculatorMean Calculator StatisticsMedian Calculator StatisticsMidhinge Calculator StatisticsMid Range Calculator StatisticsMinimum Calculator Statistics

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.