Linear_Regression_Deviation_Example
Linear_Regression_Deviation_Example
In linear regression, understanding the different types of variation is crucial for interpreting the
model's performance. Let's break down the three key types of variation: total deviation, explained
Total variation measures how much the actual data points (the observed values) differ from the
Mathematically, for each data point, the total deviation is calculated as the difference between the
observed value (yi) and the mean of all observed values (mean y).
Explained variation measures how much of the total variation is explained by the regression line.
This represents the part of the difference between the actual value (yi) and the mean (mean y) that
can be explained by the relationship between the independent variables and the dependent
variable.
Mathematically, it is the difference between the predicted value (predicted y) from the regression line
Unexplained variation measures the portion of the total variation that the regression line does not
explain. This is the difference between the actual value (yi) and the predicted value (predicted y).
Mathematically, it is the difference between the actual value (yi) and the predicted value (predicted
y).
- The total deviation tells you how far the actual point is from the average of all points.
- The explained deviation tells you how much of that distance is explained by the regression line
- The unexplained deviation is what's left over, i.e., how much the point deviates from what the
In other words:
Example:
Suppose you have data on the number of hours students studied for a test (X) and their
| Hours Studied (X) | Actual Test Score (Y) | Predicted Test Score (predicted y) |
|-------------------|-----------------------|-----------------------------------|
|2 | 65 | 70 |
|4 | 75 | 80 |
|6 | 85 | 90 |
In this example:
- For Student 1, the total deviation is -10, explained deviation is -5, and unexplained deviation is -5.
- For Student 2, the total deviation is 0, explained deviation is 5, and unexplained deviation is -5.
- For Student 3, the total deviation is 10, explained deviation is 15, and unexplained deviation is -5.
This breakdown helps us understand how much of the variation in test scores can be explained by