📈 Linear Regression Calculator

Fit a least-squares line to paired data and calculate slope, intercept, correlation, and R².

📊 Statistics📐 Formula included🧠 Practice questions✓ Free
Please enter valid values.

Formula and Explanation

Fit a least-squares line to paired data and calculate slope, intercept, correlation, and R².

ConceptFormula or rule
Linear Regression Calculatorŷ = a + bx, where b = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)²

How to Use This Calculator

  1. Enter the sample, counts, probabilities, or summary statistics requested above.
  2. Keep paired lists in the same order and separate values with commas.
  3. Select the correct test direction or sample/population option when available.
  4. Press Calculate and interpret the result together with the supporting statistics.

Worked Example

Example: The fitted line minimizes the sum of squared vertical residuals.
✓ Use the slope to estimate expected change in Y per one-unit increase in X.

Where This Is Used

School & coursework
Check homework, understand formulas, and verify step-by-step statistics exercises.
Research
Explore estimates, uncertainty, distributions, and relationships before using full statistical software.
Business & data analysis
Summarize variation, compare groups, and communicate data-driven findings clearly.

Common Mistakes to Avoid

⚠️
Extrapolating far beyond the data
The fitted relationship may not continue outside the observed range.
⚠️
Ignoring residual patterns
A line can be inadequate even with moderate R².
⚠️
Treating association as causation
Regression alone does not establish a causal effect.

Practice Questions

1. If slope=3, how much does predicted Y change when X rises by 2?
Answer: 6
2. What does least squares minimize?
Answer: Sum of squared residuals.
3. Can R² be negative for ordinary regression with intercept?
Answer: No.

Frequently Asked Questions

What does the slope mean?▾
Expected change in predicted Y for a one-unit increase in X.
What is the intercept?▾
Predicted Y when X=0, which may or may not be meaningful.
What does R² show?▾
The proportion of Y variation explained by the fitted linear model.

Related Statistics Calculators