Slope (b)
b = Σ[(x - x̄)(y - ȳ)] / Σ(x - x̄)²Rate of change in Y per unit change in X
Positive = increasing, Negative = decreasing
Calculate linear, quadratic, exponential, and polynomial regression equations from data points with correlation coefficient.
https://www.solvezi.com/statistics/regression-calculator
Find relationships in your data
| # | X | Y | Action |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 |
5 data points (minimum 2 required for regression)
Regression Equation
y = ?
Slope (b)
0.0000
Intercept (a)
0.0000
Correlation (r)
0.0000
Very Weak • No Correlation
R-Squared (r²)
0.0000
0.0% fit
Summary Statistics
Predict Y from X
Understanding Linear Regression
Linear Regression finds the line of best fit: y = a + bx
• Slope (b) = rate of change • Intercept (a) = y-value when x=0
• Correlation (r) = -1 to 1 (strength & direction) • R² = how well data fits the line (0 to 1)
Linear Regression Calculator • Find relationships in your data
Master linear regression — understand slope, intercept, correlation, and R-squared, learn to predict outcomes, interpret relationships, and apply regression analysis in sales forecasting, real estate, healthcare, and finance.
Linear regression models the relationship between a dependent variable (Y) and one or more independent variables (X). It finds the line of best fit: y = a + bx.
"How does Y change as X changes — and can I use this relationship to predict Y for new X values?"
b = Σ[(x - x̄)(y - ȳ)] / Σ(x - x̄)²Rate of change in Y per unit change in X
Positive = increasing, Negative = decreasing
a = ȳ - b × x̄Predicted Y value when X = 0
Baseline value; may not be meaningful
r = Σ[(x - x̄)(y - ȳ)] / √[Σ(x - x̄)² × Σ(y - ȳ)²]Strength and direction of relationship
-1 to +1; closer to ±1 = stronger
r² = (correlation)²Proportion of variance explained
0 to 1; higher = better fit
Strong explanatory power
Good explanatory power
Moderate explanatory power
Limited explanatory power
Little explanatory power
R-squared = Proportion of variance in Y explained by X
Example: r² = 0.64 means 64% of Y's variation is explained by X
Check: Scatter plot shows straight-line pattern
Fix: Transform data or use non-linear models
Check: No repeated measures or time dependence
Fix: Use mixed models or time series methods
Check: Residuals have constant spread
Fix: Use robust standard errors or transformations
Check: Q-Q plot shows residuals on diagonal
Fix: Bootstrap or use robust methods
ŷ = a + bxBest guess prediction
Range for mean Y at given XUncertainty in mean prediction
Range for individual Y valuesWider than CI, for individual forecasts
Warning: Never extrapolate beyond your data's X range — predictions become increasingly unreliable!
Create scatter plot to visualize relationship
Find x̄ (mean of X) and ȳ (mean of Y)
b = Σ[(x - x̄)(y - ȳ)] / Σ(x - x̄)²
a = ȳ - b × x̄
ŷ = a + bx for any X value
Higher r² indicates better fit
Verify linearity, independence, homoscedasticity
Predict future sales and optimize marketing spend
Estimate property values from features
Understand health outcomes and risk factors
Model asset returns and risk relationships
Identify factors affecting student performance
Optimize production parameters
Correlation = Causation
Regression shows association, not causation
Use experiments or quasi-experimental designs for causation
Extrapolating beyond data range
Predictions outside X range are unreliable
Only predict within observed X values
Ignoring non-linear patterns
Always visualize data before fitting linear model
Try polynomial or log transformations if curvilinear
Overinterpreting R²
High R² doesn't guarantee useful predictions
Check residual plots and prediction intervals
Forgetting to standardize for comparison
Standardize variables to compare coefficient magnitudes
Use beta coefficients for variable importance
Correlation measures strength/direction of relationship (symmetric, no distinction between X and Y). Regression predicts Y from X (asymmetric) and provides an equation for prediction. Correlation = single number; Regression = full model with slope, intercept, and predictions.
Minimum n ≥ 2 to fit a line, but small samples produce unstable estimates. For reliable inference: n ≥ 10-20 per predictor. For prediction, larger samples (n ≥ 30-50) reduce uncertainty. With n < 10, interpretation is questionable. Our calculator warns with insufficient data.
R-squared can't be negative for linear regression (always 0-1). Negative R² occurs only if fitting a model without an intercept (forced through origin) and the fit is worse than using the mean. Our calculator includes intercept, so R² ≥ 0.
Outliers can dramatically change slope, intercept, and R² — pulling the regression line toward them. Leverage points (extreme X) are especially influential. Always examine residuals and consider robust regression or outlier removal with justification.
Multicollinearity occurs when predictor variables are highly correlated, making coefficient estimates unreliable and standard errors large. For simple linear regression (one predictor), multicollinearity isn't an issue. For multiple regression, check VIF (Variance Inflation Factor) > 5-10.
Use standardized coefficients (beta weights) when comparing importance of predictors measured in different units (e.g., age in years vs income in dollars). Standardized coefficients represent change in Y in standard deviations per standard deviation change in X.
Confidence interval (CI): range for the mean Y at a given X (narrower). Prediction interval (PI): range for individual Y values (wider, includes individual variation). For new predictions, always use PI. For understanding where true regression line lies, use CI.
APA format: β (unstandardized), SE, t, p. Example: 'Linear regression revealed that X significantly predicted Y, b = 0.45, SE = 0.12, t(28) = 3.75, p = .001, R² = .33, 95% CI [0.21, 0.69].' Include R², F-statistic, and confidence intervals.
1822-1911
Introduced regression concept (1885)
Coined 'regression to the mean' studying heredity
1857-1936
Formalized correlation coefficient
Father of mathematical statistics
1890-1962
Developed regression inference
Pioneered ANOVA and experimental design
Did You Know? Francis Galton first used the term "regression" in 1885 while studying heredity. He observed that tall parents tend to have children closer to average height — "regression to the mean." Karl Pearson later formalized the mathematics, and regression became one of the most widely used statistical methods.
Simple Regression:
"Linear regression revealed that advertising spend significantly predicted sales, b = 0.45, SE = 0.12, t(28) = 3.75, p = .001, R² = .33."With Confidence Interval:
"The slope of 0.45 (95% CI [0.21, 0.69]) indicates that each $1,000 in advertising increases sales by 0.45 units."Always include: slope (b), standard error (SE), test statistic (t), degrees of freedom (df), p-value, and R². Optionally include confidence intervals and standardized coefficients (β) for comparing predictors.
Linear regression calculator and complete guide. Calculate slope, intercept, correlation, and R-squared. Learn to interpret regression coefficients, check assumptions, predict outcomes, and apply to sales forecasting, real estate, healthcare, finance, and manufacturing. Essential for data scientists, business analysts, and researchers.