ANOVA
ANalysis Of VAriance
What it does
This is used to explain if the Regression Line we got from doing a Linear Regression, actually does fit the data well, or is it just due to pure randomness.
If the line actually does fit well, by knowing the considered independent variable (wind speed in below graph) should be able to explain the dependent variable with some confidence level (like 95% confidently)

- total - This is the total deviation of the from mean of y
- explained by line - This part is explained entirely by the line got from regression. i.e. just by knowing the , we can get this part ().
- residual - Left over part that cannot be determined by the regression line. If the line is really a good fit, this part should be minimal as much as possible.
ANOVA Identity
ANOVA identity uses this relation with Sum of Squares. (just summing up cancel +/- errors otherwise)
- TSS - Total Sum of Squares
- RSS - Regression Sum of Squares
- ESS - Error Sum of Squares
| Source | Sum of Squares | df | Why this df | Mean SS (SS/df) |
|---|---|---|---|---|
| Total () |
| | points minus | - | | Regression () |
| | one slope. Line passes thru |
| | Error () |
| | points minus and |
| A "mean square" is , and the division is chosen so that it is an unbiased estimate of :
From these two chi square distributions, we can get the following F distribution, which we can use to determine how good of a line we got from regression. i.e. How confidently we can estimate the value of from
How to find TSS, RSS, ESS
TSS
This one is pretty obvious from the data, since this is just the sum of squares of all values w.r.t. mean of
To see how to calculate Linear Regression#Useful formulas
RSS
This can be calculated using the regression line slope . Regression Line goes thru
For any point we can get the from regression equation. 
ESS
This is the quantity we cannot determine using a formula. So we have to derive it by computing TSS and RSS
Coefficient of Determination ()
is the fraction of the total variation in that the line explains
This number determines if the regression line is much more closer to data points. Higher the better.
This tells as 98% of the variable is correctly explained by the regression

:
- means the line explains nothing (flat line, ).
- means every point lies exactly on the line ().
Hypothesis testing with the ratio in ANOVA
Decision Rule
: regression line does not fit the data
: regression line fits the data
For the null hypothesis, if the regression line does not fit the data that means,
| Meaning | |
|---|---|
| the line explains about as much as pure noise would. No evidence of a real slope. | |
| the line explains far more than noise could. Strong evidence of a real slope. | |
| near | the line explains almost nothing, which is exactly what predicts. |

So if the computed ratio fall within the rejection region, we can reject the null hypothesis.
The rejection region always goes to the right due to the ratio must be larger if alternative hypothesis is true, i.e. noise should be less compared to the actual data. But if the null hypothesis is true, regression line does not fit the data, then F ratio can be close to or fall below
Our chosen significance level determines what is the minimum ratio we need to have in order to reject the null hypothesis.