This calculator performs comprehensive analysis of the linear relationship between two continuous variables. It provides everything you need for professional statistical analysis, from basic model fitting to advanced diagnostic testing, ensuring your regression model meets all statistical assumptions and delivers reliable insights.
What You'll Get:
- Complete Model Summary: R-squared, adjusted R-squared, F-statistic, and significance testing
- Detailed Coefficients: Slope and intercept estimates with standard errors, t-values, and confidence intervals
- Professional Visualizations: Regression plot with fitted line, confidence bands, and prediction intervals
- Comprehensive Diagnostics: Four essential diagnostic plots to validate model assumptions
- Statistical Tests: Durbin-Watson, heteroscedasticity, and normality tests for thorough validation
- Publication-Ready Output: APA-formatted results ready for academic or professional reporting
💡 Pro Tip: Always examine the diagnostic plots before interpreting your results! The residuals vs fitted plot reveals non-linear patterns, while the Q-Q plot checks normality assumptions. For multiple regression analysis, check out our Multiple Linear Regression Calculator to analyze relationships with several predictor variables.
Ready to explore the linear relationship in your data? Load our sample dataset to see the required data format and regression analysis in action, or upload your own data to discover the strength and direction of the relationship between your variables.
Calculator
1. Load Your Data
2. Select Columns & Options
Related Calculators
Learn More
Simple Linear Regression
Definition
Simple Linear Regression models the relationship between a predictor variable (X) and a response variable (Y) using a linear equation. It finds the line that minimizes the sum of squared residuals.
Key Formulas
Regression Line:
Slope:
Intercept:
R-squared:
Key Assumptions
Practical Example
Step 1: Data
1 | 2.1 | -2 | -3.82 | 4 | 7.64 |
2 | 3.8 | -1 | -2.12 | 1 | 2.12 |
3 | 6.2 | 0 | 0.28 | 0 | 0 |
4 | 7.8 | 1 | 1.88 | 1 | 1.88 |
5 | 9.3 | 2 | 3.38 | 4 | 6.76 |
Means: ,
Step 2: Calculate Slope ()
Step 3: Calculate Intercept ()
Step 4: Regression Equation
Step 5: Calculate
(98.6% of variation in Y explained by X)
Code Examples
library(tidyverse)
data <- tibble(x = c(1, 2, 3, 4, 5),
y = c(2.1, 3.8, 6.2, 7.8, 9.3))
model <- lm(y ~ x, data=data)
summary(model)
ggplot(data, aes(x = x, y = y)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
theme_minimal()
par(mfrow = c(2, 2))
plot(model)
import numpy as np
import pandas as pd
import statsmodels.api as sm
X = [1, 2, 3, 4, 5]
y = [2.1, 3.8, 6.2, 7.8, 9.3]
X = sm.add_constant(X)
model = sm.OLS(y, X).fit()
print(model.summary())
Alternative Regression Methods
Consider these alternatives when assumptions are violated:
- Robust Regression: When outliers significantly impact the model fit
- Polynomial Regression: For curved relationships between variables
- Quantile Regression: When variance changes across X values (heteroscedasticity)
- Weighted Least Squares: When observations have different levels of precision