Linear Regression Calculator
Find the Line of Best Fit and Predict Future Values.
Format:
X, Y or X YData Count (n): 0
Prediction Tool
If X =
Predicted Y
---
Regression Equation
y = mx + c
Slope (m)
-
Intercept (c)
-
Correlation (r)
-
R-Squared (R²)
-
Scatter Plot with Regression Line
What is Linear Regression?
[Image of linear regression scatter plot]Linear Regression is a statistical method used to model the relationship between two variables: an independent variable (X) and a dependent variable (Y). It finds the straight line that best "fits" the data points, minimizing the distance between the points and the line.
This line allows you to predict future values. For example, if you have data on "Hours Studied" (X) and "Exam Score" (Y), regression can predict the score for someone who studies 5 hours.
The Regression Equation
The calculator generates an equation in the form:
y = mx + c
- y: The dependent variable (what you want to predict).
- x: The independent variable (the input).
- m (Slope): The rate of change. It tells you how much Y changes for every 1 unit increase in X.
- c (Intercept): The value of Y when X is 0.
What are R and R-Squared?
- Correlation Coefficient (r): Measures the strength and direction of the relationship.
- +1: Perfect positive relationship (X goes up, Y goes up).
- -1: Perfect negative relationship (X goes up, Y goes down).
- 0: No relationship.
- Coefficient of Determination (R²): Tells you how well the regression line fits the data.
Example: If R² = 0.85, it means 85% of the variation in Y can be explained by X. The closer to 1, the better the model.