ANOVA

An ANOVA test is performed when we want to compare the mean of multiple groups. The null and alternative hypothesis will be very similar for every problem.
H_0: \mu_1 = \mu_2 = \mu_3 = \cdots
H_a: at least one mean is different
Note: The null hypothesis will have means equal to the number of groups being compared.
EX:
If there are three groups, the null hypothesis will be: H_0: \mu_1 = \mu_2 = \mu_3
If there are four groups, the null hypothesis will be: H_0: \mu_1 = \mu_2 = \mu_3 = \mu_4
But for every situation, the alternative hypothesis will remain the same.

The key to tackling ANOVA problems is being able to understand the ANOVA table.

Source

The ANOVA table splits up variation in the data into two groups, Factor and Error. Factor is the variation between groups and Error is the variation within groups.

Degrees of Freedom (DF)

The DF for Factor is k - 1, where k is the number of groups there are. This should be the same amount of means we have in the null hypothesis. If we have four means (H_0: \mu_1=\mu_2=\mu_3=\mu_4), then k is equal to four. The DF for Error is N - k, where N is the total sample size. If we have 20 people in our first group, 15 in the second, and 25 in the third, the total sample size (N) is 60. The DF for Total is also the sum of DF for Total and DF for Error.

Sum of Squares (SS)

The Sum of Squares column is the variation in our data. Sum of Squares Between (SSB) is the variation between our groups. It can also be called the Sum of Squares Groups (SSG) and Sum of Squares Treatment (SSTr) since it is the variation due to our factor. The formula to calculate SSB is:
SSB = \displaystyle \sum_{i=1}^{k} n_i(\bar{x}_i - \bar{X})^2
The Sum of Squares Within (SSW) is the variation within groups, it can also be called Sum of Squares Error (SSE). This is the variation due to unexplained error or random error that arises in the data. The formula for SSW is:
SSW = \displaystyle \sum_{i=1}^{k} \displaystyle \sum_{j=1}^{J} (x_{ij} - \bar{x}_i)^2 = \displaystyle \sum_{i=1}^{k} (n_i - 1)s_i^2
The Sum of Squares Total (SST) measures the total variability that arises from multiple factors, the groups and random error. The formula for SST is:
SST = SSB + SSW = \displaystyle \sum_{i=1}^{N} (x_{i} - \bar{X})^2

Mean Squares

The Mean Squares column is the average variation in our data. The Mean Square Between (MSB) measures the average variability due to our factor/treatment. If the null hypothesis is true (all groups have equal means), this number should be small since it would mean the variation between sample means is due to chance.
MSB = \frac{SSB}{k-1}
The Mean Square Within or more commonly known as Mean Square Error (MSE) measures the average variability due to random error. If the null hypothesis is true, this is the amount of variation we would expect among the sample means.
MSW = \frac{SSW}{N-k}

F-Value

The F-Value is the test statistic for ANOVA. If the null hypothesis is true, then the F-Value will be closer to 1. So, if we have a large F-Value, we are more likely to reject the null hypothesis. It is also sometimes referred to as the “signal to noise” ratio.
F = \frac{MSB}{MSW}

P-Value

If the P-Value is less than our significance level, we reject the null hypothesis and conclude that at least one mean is different.
If the P-Value is greater than our significance level, we fail to reject (FTR) the null hypothesis and conclude all group means are equal.