Przejdź do treści
Liczbnik

Linear Regression Calculator

This linear regression calculator determines the best-fit line y = ax + b through your data points. It computes the slope (a), intercept (b), coefficient of determination (R²), and a predicted Y value for any X you provide. Useful for statistics, data analysis, economics, and scientific research.

Reviewed byRedakcja Liczbnik
Calculator
Regression ResultsSlope coefficient (a)1.73
Intercept (b)
0.43
Coefficient of Determination R²
1
Predicted Y Value
10.81

How to Use the Linear Regression Calculator

Enter your X values separated by commas (e.g. 1,2,3,4,5) in the "X Series" field. Enter the corresponding Y values in the "Y Series" field. Enter the X value for which you want a prediction. Click "Calculate" to see the regression line equation and R².

Linear Regression Calculation Example

Given X = [1, 2, 3, 4, 5] and Y = [2.1, 3.9, 5.8, 7.2, 9.1], the calculator finds: a ≈ 1.75, b ≈ 0.38, R² ≈ 0.9993. The prediction for X = 6 is y ≈ 10.88. The near-perfect R² confirms a strong linear relationship.

Frequently Asked Questions

What is linear regression?

Linear regression is a statistical method that models the linear relationship between a dependent variable Y and an independent variable X using the equation y = ax + b.

What does the slope coefficient a represent?

The slope a indicates how much Y changes when X increases by one unit. A positive a means Y increases with X; a negative a means Y decreases.

What does the intercept b represent?

The intercept b is the value of Y when X equals zero. It indicates where the regression line crosses the Y-axis.

What is R² and how do I interpret it?

R² (coefficient of determination) measures how well the regression model fits the data. A value of 1.0 means a perfect fit; 0.0 means no linear relationship.

What is a good R² value?

It depends on the field. In natural sciences, R² > 0.95 is common. In social sciences, R² > 0.7 may be acceptable. Higher is generally better.

How many data points do I need?

At least 2 points are needed mathematically, but 5–10 or more are recommended for reliable results. More data improves model stability.

Indicative result

Results are for informational purposes. Linear regression assumes a linear relationship between variables. For non-linear data or data with outliers, results may be less accurate.
  • Pearson Correlation Calculator

    Calculate the Pearson correlation coefficient (r) and coefficient of determination (r2) for two data series. Enter values separated by commas — instant result with interpretation, no signup needed.

    Statistics
  • Standard Deviation Calculator

    Calculate standard deviation and variance for a sample or population. Enter numbers separated by commas — instant result, no signup needed.

    Statistics
  • Weighted Average Calculator

    Calculate the weighted average for grades, scores or any numeric values. Enter up to 5 value–weight pairs and get the result instantly. Free online tool.

    Education