F Distribution and One-Way ANOVA

45 The F Distribution and the F-Ratio



[latexpage]

The distribution used for the hypothesis test is a new one. It is called the F distribution, named after Sir Ronald Fisher, an English statistician. The F statistic is a ratio (a fraction). There are two sets of degrees of freedom; one for the numerator and one for the denominator.

For example, if F follows an F distribution and the number of degrees of freedom for the numerator is four, and the number of degrees of freedom for the denominator is ten, then F ~ F4,10.

Note

The F distribution is derived from the Student’s t-distribution. The values of the F distribution are squares of the corresponding values of the t-distribution. One-Way ANOVA expands the t-test for comparing more than two groups. The scope of that derivation is beyond the level of this course. It is preferable to use ANOVA when there are more than two groups instead of performing pairwise t-tests because performing multiple tests introduces the likelihood of making a Type 1 error.

To calculate the F ratio, two estimates of the variance are made.

  1. Variance between samples: An estimate of σ2 that is the variance of the sample means multiplied by n (when the sample sizes are the same.). If the samples are different sizes, the variance between samples is weighted to account for the different sample sizes. The variance is also called variation due to treatment or explained variation.
  2. Variance within samples: An estimate of σ2 that is the average of the sample variances (also known as a pooled variance). When the sample sizes are different, the variance within samples is weighted. The variance is also called the variation due to error or unexplained variation.
  • SSbetween = the sum of squares that represents the variation among the different samples
  • SSwithin = the sum of squares that represents the variation within samples that is due to chance.

To find a “sum of squares” means to add together squared quantities that, in some cases, may be weighted. We used sum of squares to calculate the sample variance and the sample standard deviation in Descriptive Statistics.

MS means “mean square.” MSbetween is the variance between groups, and MSwithin is the variance within groups.

Calculation of Sum of Squares and Mean Square

  • k = the number of different groups
  • nj = the size of the jth group
  • sj = the sum of the values in the jth group
  • n = total number of all the values combined (total sample size: ∑nj)
  • x = one value:
    x = ∑sj
  • Sum of squares of all values from every group combined:
    x2
  • Total sum of squares:
    SStotal =$\sum \left(x^2\right) – \frac{ \left(\sum x\right)^2}{n}$
  • Explained variation: sum of squares representing variation among the different samples:
    SSbetween = $\sum \left[\frac{(s_j)^2}{n_j} \right] – \frac{\left(\sum s_j\right)^2}{n}$
  • Unexplained variation: sum of squares representing variation within samples due to chance:
    SSwithin = SStotal – SSbetween
  • df‘s for different groups (df‘s for the numerator):
    df = k – 1
  • Equation for errors within samples (df‘s for the denominator):
    dfwithin = nk
  • Mean square (variance estimate) explained by the different groups:
    $MS_\text{between}=\frac{{SS}_\text{between}}{{df}_\text{between}}$
  • Mean square (variance estimate) that is due to chance (unexplained):
    $MS_\text{within}=\frac{{SS}_\text{within}}{{df}_\text{within}}$

MSbetween and MSwithin can be written as follows:

  • $MS_\text{between}=\frac{{SS}_\text{between}}{{df}_\text{between}}=\frac{{SS}_\text{between}}{k-1}$
  • $MS_\text{within}=\frac{{SS}_\text{within}}{{df}_\text{within}}=\frac{{SS}_\text{within}}{n-k}$

The one-way ANOVA test depends on the fact that MSbetween can be influenced by population differences among means of the several groups. Since MSwithin compares values of each group to its own group mean, the fact that group means might be different does not affect MSwithin.

The null hypothesis says that all groups are samples from populations having the same normal distribution. The alternate hypothesis says that at least two of the sample groups come from populations with different normal distributions. If the null hypothesis is true, MSbetween and MSwithin should both estimate the same value.

Note

The null hypothesis says that all the group population means are equal. The hypothesis of equal means implies that the populations have the same normal distribution, because it is assumed that the populations are normal and that they have equal variances.

F-Ratio or F Statistic

$$F=\frac{MS_\text{between}}{MS_\text{within}}$$

If MSbetween and MSwithin estimate the same value (following the belief that H0 is true), then the F-ratio should be approximately equal to one. Mostly, just sampling errors would contribute to variations away from one. As it turns out, MSbetween consists of the population variance plus a variance produced from the differences between the samples. MSwithin is an estimate of the population variance. Since variances are always positive, if the null hypothesis is false, MSbetween will generally be larger than MSwithin.Then the F-ratio will be larger than one. However, if the population effect is small, it is not unlikely that MSwithin will be larger in a given sample.

The foregoing calculations were done with groups of different sizes. If the groups are the same size, the calculations simplify somewhat and the F-ratio can be written as:

F-Ratio Formula when the groups are the same size

$$F=\frac{n\cdot s_{\bar x}^2}{s_\text{pooled}^2}$$

where …
  • n = the sample size
  • dfnumerator = k – 1
  • dfdenominator = nk
  • s2 pooled = the mean of the sample variances (pooled variance)
  • $\displaystyle s_{\bar x}^2$ = the variance of the sample means

Data are typically put into a table for easy viewing. One-Way ANOVA results are often displayed in this manner by computer software.

Source of Variation Sum of Squares (SS) Degrees of Freedom (df) Mean Square (MS) F
Factor
(Between)
SS(Factor) k – 1 MS(Factor) = SS(Factor)/(k – 1) F = MS(Factor)/MS(Error)
Error
(Within)
SS(Error) nk MS(Error) = SS(Error)/(nk)
Total SS(Total) n – 1
Table 11.1

Example 11.1

Three different diet plans are to be tested for mean weight loss. The entries in the table are the weight losses for the different plans. The one-way ANOVA results are shown in Table 11.2.

Plan 1: n1 = 4 Plan 2: n2 = 3 Plan 3: n3 = 3
5 3.5 8
4.5 7 4
4 3.5
3 4.5
Table 11.2

s1 = 16.5, s2 =15, s3 = 15.5

Following are the calculations needed to fill in the one-way ANOVA table. The table is used to conduct a hypothesis test.


$\begin{eqnarray}SS_\text{between} &=& \sum\left[ \frac{(s_j)^2}{n_j} \right] – \frac{(\sum s_j)^2}{n}\\&=& \frac{s_1^2}{n_1} + \frac{s_2^2}{n_2} + \frac{s_3^2}{n_3} -\frac{(s_1+s_2+s_3)^2}{n_1+n_2+n_3}\\&=&\frac{(16.5)^2}{4} + \frac{(15)^2}{3} + \frac{(15.5)^2}{3} – \frac{(16.5+15+15.5)^2}{10} \\
SS_\text{between} &=& 2.2458
\end{eqnarray}$

$\text{where } n_1=4, n_2 =3, n_3=3 \text{ and } n=n_1+n_2+n_3=10$


$\begin{eqnarray}SS_\text{total}&=&\sum x^2-\frac{\left( \sum x \right)^2}{n}\\ &=&\tiny{ (5^2+4.5^2+4^2+3^2+3.5^2+7^2 +4.5^2 +8^2+4^2 +3.5^2) }-\frac{5+4.5+4+3+3.5+7+4.5+8+4+3.5}{10}\\&=&244-\frac{47^2}{10} = 244-220.9\\SS_\text{total}&=&23.1\end{eqnarray}$


$\begin{eqnarray}SS_\text{within}&=&SS_\text{total}-SS_\text{between}\\&=&23.1-2.2458\\SS_\text{within}&=&20.8542\end{eqnarray}$


Source of Variation Sum of Squares (SS) Degrees of Freedom (df) Mean Square (MS) F
Factor
(Between)
2.2458 2 1.1229 0.3769
Error
(Within)
20.8542 7 2.9792
Total 23.1 9
Table 11.3

Try It 11.1

As part of an experiment to see how different types of soil cover would affect slicing tomato production, Marist College students grew tomato plants under different soil cover conditions. Groups of three plants each had one of the following treatments

  • bare soil
  • a commercial ground cover
  • black plastic
  • straw
  • compost

All plants grew under the same conditions and were the same variety. Students recorded the weight (in grams) of tomatoes produced by each of the n = 15 plants:

Bare: n1 = 3 Ground Cover: n2 = 3 Plastic: n3 = 3 Straw: n4 = 3 Compost: n5 = 3
2,625 5,348 6,583 7,285 6,277
2,997 5,682 8,560 6,897 7,818
4,915 5,482 3,830 9,230 8,677
Table 11.4


Create the one-way ANOVA table.

The one-way ANOVA hypothesis test is always right-tailed because larger F-values are way out in the right tail of the F-distribution curve and tend to make us reject H0.

Notation

The notation for the F distribution is F ~ Fdf(num),df(denom)

where df(num) = dfbetween and df(denom) = dfwithin

The mean for the F distribution is

$$\mu = \frac{df\text{(denom)}}{df\text{(denom)}-2}$$

License