Calculator Suite
Linear Regression Calculator
Perform simple linear regression analysis with comprehensive diagnostics and assumption checking
Educational Resources
Regression Equation
= y-intercept
= slope coefficient
= error term
Slope Formula
Y-Intercept Formula
R-squared
Proportion of variance explained by the model
Linear regression finds the best-fit line through your data points. The equation y = b₀ + b₁x predicts Y from X. R² tells you how well the model fits (0-1, higher = better). Check residual plots to verify assumptions before trusting results.
Enter Data Points
Input X,Y pairs manually or select a sample dataset.
Configure Analysis
Set confidence level and display options (confidence bands, outliers).
Run Regression
Click "Run Regression Analysis" to calculate slope, intercept, and R².
Analyze Results
Review scatter plot, residuals, Q-Q plot, and assumption checks.
📊 Example: Advertising Spend vs Sales
Data: 15 months of ad spend ($k) vs revenue ($k)
Equation
y = 12.4 + 3.2x
R²
0.87
p-value
<0.001
Interpretation
Significant
For every $1k increase in ad spend, revenue increases by $3.2k. The model explains 87% of revenue variation.
Key Assumptions:
- • Linear relationship between X and Y
- • Independent observations
- • Homoscedasticity (constant variance)
- • Normally distributed residuals
- • No autocorrelation in residuals
When to Use Alternatives:
- • Curved relationship: Polynomial regression
- • Multiple predictors: Multiple regression
- • Binary outcome: Logistic regression
- • Non-normal data: Transform variables
What does R-squared actually mean?
R² measures how much of Y's variation is explained by X. R² = 0.80 means 80% of variance is predicted. Higher is generally better, but a high R² doesn't guarantee a good model.
How do I interpret the slope?
The slope is the expected change in Y per one-unit increase in X. Slope = 2.5 means Y increases by 2.5 when X increases by 1.
What are residuals and why do they matter?
Residuals = observed - predicted Y values. Analyzing residual plots helps verify assumptions and identify outliers.
How many data points do I need?
While 3+ points work technically, aim for 10-20+ observations for reliable results and stable estimates.
What if my data isn't linear?
Consider variable transformations (log, sqrt), polynomial regression, or non-linear models. Always check residual plots first.