Regression Calculator

Calculate simple linear regression with slope, intercept, R-squared value and predictions. Free statistical analysis tool for data-driven decisions.

Simple Linear Regression Calculator

Regression Results

Sample Size (n)-
Slope (b)-
Y-Intercept (a)-
Equation-
R (Correlation)-
R² (Coefficient of Determination)-
Predicted Y-
MB
Mustafa BilgicStatistics & Data Analysis Specialist — Updated April 2026
RegressionStatisticsR-squared

R² Interpretation Guide

R² ValueStrengthInterpretationExample
0.90 - 1.00Very StrongModel explains 90%+ varianceHeight vs shoe size
0.70 - 0.89StrongGood predictive powerStudy hours vs grades
0.50 - 0.69ModerateReasonable fitAdvertising vs sales
0.30 - 0.49WeakSome relationshipWeather vs footfall
0.00 - 0.29Very WeakPoor predictive powerRandom variables

Key Regression Concepts

Slope (b)
Change in Y per unit X
Intercept (a)
Y when X = 0
Variance explained

How to Use This Calculator

1

Enter X values

Input your independent variable values separated by commas. These are the values you use to predict Y.

2

Enter Y values

Input your dependent variable values separated by commas. There must be the same number of Y values as X values.

3

Enter a prediction value

Optionally enter an X value for which you want to predict Y using the fitted regression line.

4

Review regression results

The calculator shows the slope, intercept, equation, correlation coefficient, R-squared, and predicted value.

Frequently Asked Questions

What is simple linear regression?
Simple linear regression finds the best-fit straight line through a set of data points. The equation is Y = a + bX, where b is the slope (how much Y changes for each unit change in X) and a is the y-intercept (the value of Y when X is 0). It assumes a linear relationship between one independent variable (X) and one dependent variable (Y).
What does R-squared mean?
R-squared (R²) is the coefficient of determination. It measures the proportion of variance in the dependent variable (Y) that is explained by the independent variable (X). An R² of 0.85 means 85% of the variation in Y can be explained by X. The remaining 15% is due to other factors or random variation.
When should I use linear regression?
Use linear regression when: you want to understand the relationship between two continuous variables, you want to predict one variable based on another, the relationship appears approximately linear (check with a scatter plot), and the residuals (errors) are approximately normally distributed. Do not use it for categorical outcomes or non-linear relationships.
What is the difference between correlation and regression?
Correlation (r) measures the strength and direction of the linear relationship between two variables. It ranges from -1 to +1. Regression goes further by fitting a predictive equation (Y = a + bX) and quantifying how much Y changes per unit change in X. Correlation tells you there is a relationship; regression tells you what the relationship is.
How many data points do I need?
For simple linear regression, a minimum of 3 points is mathematically possible, but 20-30+ points are recommended for reliable results. As a rule of thumb, you need at least 10-15 observations per predictor variable. Small samples can produce misleading R² values and wide confidence intervals.
What are the assumptions of linear regression?
The four key assumptions are: 1) Linearity (the relationship between X and Y is linear), 2) Independence (observations are independent of each other), 3) Homoscedasticity (constant variance of residuals), 4) Normality (residuals are approximately normally distributed). Violating these assumptions can lead to unreliable results.

Official Sources & References

Data verified against official UK government sources. Last checked April 2026.