In this video, we'll discuss the overall F test in one-way analysis of variance. We'll look at the assumptions, the statistical null and alternative hypothesis, we'll see how to calculate the test statistic, determine the P value, and how to interpret the results. Suppose we want to compare healthiness of three groups of cats that consume different diets, raw meat, canned food and dry food. A veterinarian rates their health on a scale from zero to 10. First, we need to know and check the assumptions of analysis variance. These are equivalent to the assumptions of multiple linear regression although they might look a little different. First of all, the observation should be independent of each other. Random selection, or random assignment, in experiments, should take care of this. If the observations are dependent by design, for instance, with repeated measurements of the same participants, or paired - participants, you should use repeated measures in analysis of variance, which we won't go into here. In our example, we'll assume cats were randomly assigned to the conditions. Secondly, the response variables should be normally distributed in each group. The histograms in our example look acceptable. Even if they didn't, moderate violation of normality isn't problematic as long as the samples are large enough, say, at least ten observations in each group. If the samples are small and very skewed, you should use a non-parametric test instead. Thirdly, analysis of variance assumed homogeneity of variances, which means the population variance is assumed to be the same for all groups. Remember, this assumption forms the basis for the trick of using a population variance estimate that is always accurate and an estimate that is sometimes not so accurate to detect a difference in the means. Moderate violation of homogeneity variances is not problematic if the group sizes are equal. If the group sizes are unequal, a rule of thumb is that you can still perform analysis of variance, as long as the largest standard deviation is no more than twice the size of the smallest standard deviation. The null hypothesis states that all population means are equal. The alternative hypothesis states that at least one population mean differs from the rest. This is a nondirectional hypothesis, just like with the overall test in multiple regression. It specifies that there is a difference somewhere. It doesn't specify for which groups we expect the difference or in what direction. The test statistic F equals the between group variance divided by the within group variance. If the group sizes are equal, you can calculate the F value manually very easily using the sample variances. If the group sizes are unequal, you have to calculate the sum of squares in each group and divide by the appropriate degrees of freedom to obtain the variances. The within group sum of squares will probably seem most familiar. For each group, you take the difference between each observation in the group mean. You square this difference and you add the square differences. That's what the inner summation sign symbolizes. The outer summation sign, indicates that you have to do this for each group and then add the results. You've now calculated the within group sum of squares which turns into the within group variance. Once you divide by the total number of participants in all groups, N minus the number of groups, G. Manually calculated in between group variance follows the same logic, you just treat the means as if they were individual observations. For each group, you take the difference between the group mean and the grand mean, square the difference and multiply by the number of participants in that group. If you do this for each group and add the results, you have the between groups of a squares. This turns into the between group variance when she divide by the number of groups G minus 1. Statistical software of reports not just the F value but also the sum of the squares and mean sums of squares. Remember, mean sum of squares is just another word for variance. One thing to look out for is the difference in presentation between statistical software packages. The between group means some squares is often denoted using the name of the factor. The within group mean sum squares is often referred to as the mean square error, abbreviated by MSE. We've already calculated the two degrees of freedom associated with the F distribution, they are the numerator between degrees of freedom, the number of groups minus one, and the denominator within or error degrees of freedom, the total number of observations minus the number of groups. The test statistic follows an F distribution with two separate degrees of freedom. In our example, we find an F of 3.793 with two and 46 degrees of freedom. Since the F test is non directional, we always look in the right tail of the distribution. With the significance level set at 0.05 using the table, we find the critical F value with two and 40 degrees of freedom is 3.2317. The observed F value exceeds this value so we know the P value is smaller then 0.05. Software provides an exact P value of 0.03. We can reject the null hypothesis and conclude that at least one of the diet groups differs from the others in terms of mean health rating.