Linear Regression

Executive Summary

Linear regression is a statistical modeling technique that fits a straight line of best fit to paired coordinate datasets (X, Y). It is used to explore quantitative relationships, estimate correlations, and predict future outcomes.

Key Takeaways
  • best fit line: Linear regression solves the equation y = mx + c that best fits paired datasets using least squares.
  • slope and intercept: Slope (m) measures the rate of change in y per unit of x, while intercept (c) is the starting point at x = 0.
  • r-squared yield: R² values measure the proportion of variation in the dependent variable explained by the independent variable.
Formula
y = mx + c

Linear Regression Fit Formula

Variable Glossary
SymbolMeaning & Description
yDependent variable
mSlope of the regression line
cy-Intercept of the regression line
Step-by-Step Worked Example
1. Mapped Variables
X Values
1, 2, 3, 4, 5
Y Values
2, 4, 5, 4, 6
2. Equation Substitution
Equation with standard inputs
y = m × x + c (solved by minimizing squared errors)
3. Calculation Steps
Step 1: Compute means of X and Y

Mean X = 3.0000. Mean Y = 4.2000.

Step 2: Solve covariance and variance parameters

Calculate deviations from mean to determine slope and intercept.

Step 3: Fit regression equation

Equation: y = 0.8000x + 1.8000

Final Resolved Linear Regression Fity = 0.8000x + 1.8000
Live Simulation

Linear Regression Calculator Sandbox

Tweak variables below to see the formula calculate instantly.

Calculating...
Common Mistakes to Avoid

Correlation vs. Causation: A high R² value or strong correlation does not mean changes in X cause changes in Y. Both variables could be influenced by a third lurking variable.

Frequently Asked Questions
Interactive Tool

Linear Regression Calculator

Calculate slope, intercept, correlation, and R² for a paired dataset.

Launch Interactive Calculator