ANOVA - Single Factor


Single factor or one-way analysis of variance (ANOVA)

The analysis of variance (often termed ANOVA or AOV) is a technique used to test multi-sample hypotheses whereby a variable (the mean) is measured from three or more samples.

In cases where multi-samples are to be tested, series of two-sample tests (i.e., t-tests, etc.) should not be employed. Aside from the fact that such an approach would be very time consuming, it may also be statistically invalid. For example, testing at the 0.05 level of significance, if three sample means are compared two at a time using the two-sample t-test, then there is a 13% chance of committing a Type I error (i.e., one in which the null hypothesis is rejected when it is actually true). As the number of samples increase the chance becomes greater (i.e., 63% when comparing ten sample means and 92% when comparing twenty sample means).

The single factor analysis of variance test should be applied when a test for the effect of only one factor on the variable in question is required. For example, an investigation may need to determine whether four different fertilizers result in different heights of a plant. In this case the single factor is fertilizer type and the variable is plant height. Each type of fertilizer is termed a level of the factor.

Two approaches may be employed which involve identical calculations but differ in construction of the null and alternate hypotheses. In the first case, known as a Model I or fixed effects ANOVA, the levels of the factor are specifically chosen. In the example mentioned above the fertilizer treatments have been selected to form levels of the factor and the null hypothesis would take the form of:

HO: µ(1) = µ(2) = µ(3) = µ(4) ...where µ represents the population mean.

In the second approach, known as a Model II or random effects ANOVA, the levels of the factor may be randomly selected to represent a random sample of a population. For example, in the case mentioned above we may be interested in whether there is great variability in the heights of the specific type of plant irrespective of fertilizer treatment. In this case the locations or sites of plant growth may be sampled. If specific sites with particular characteristics are chosen then a Model I ANOVA may be employed - the sites, or factorial levels may be influential in plant height attained. If the intention is to generalize so that all sites or locations are considered to comprise a random sample from all possible sites then a Model II ANOVA may be employed. In this case, the null hypothesis would simply be:

HO: There is no variability in plant height at different locations.

The parametric analysis of variance technique makes certain assumptions about the sample data used. Sample data used should follow a normal distribution and exhibit homogeneity of variances. However, some test 'robustness'is present. Tests will not be too adversely affected by small departures from normality particularly if the sample sizes are large. Similarly, differences in the variance between each group may be accomodated as long as sample sizes are the same.

The altenative non-parametric equivalent is the Kruskal-Wallis single factor analysis of variance by ranks.

Script operation

This tool operates in much the same way as most of the others with no specific departures from the usual methods needed.

Click here for information about general script usage.

Raw sample data must be entered as multiple samples, the data being arranged in columns. Follow the example output below and note that the statistics are computed for the four example columns and these have been labelled in the output under the headings 'Method I', 'Method II', etc. Notice how the original samples were labelled in the same manner and that these titles have been incorporated in the output by inclusion in the input data range.

Note that in this example summary statistics (i.e., the count (or 'n'), the sum, the mean and the variance) are computed for the columns.

Raw data


 Method I   Method II   Method III    Method IV
	5           9   	 8            1
	7          11   	 6            3
	6           8   	 9            4
	3           7   	 5            5
	9           7   	 7            1
	7       		 4            4
	4       		 4
	2

Spreadsheet output

 ANOVA - One way

 Group  	      Count        Total	   Mean      Variance
 Method_1       	  8           43	  5.375        5.4107
 Method_II      	  5           42	    8.4 	  2.8
 Method_III     	  7           43	 6.1429        3.8095
 Method_IV      	  6           18	      3 	  2.8

 ANOVA
 Source of Variation     SS      d.f.(v)  Variance Est.       F-Ratio

 Between Groups:    82.2217            3	27.4072        7.0167
 Within Groups:     85.9321           22	  3.906
 Total: 	   168.1538           25

 P(F<=f) one-tail:  0.00175
 F-Critical (95%):   3.0488
 F-Critical (99%):   4.8167

Interpretation

The example test outlined above may be considered to have been made after formulation of a null hypothesis such as:

HO: Weights of cakes do not differ when baked using four different methods.

In effect this ANOVA test would then be a random effects model in this case. The statistics produced in the output are known as sources of variation:

The between groups SS (sum of squares) and within groups SS are used in conjunction with their respective degrees of freedom to produce two variance estimates known as MS (an abbreviation of mean squared deviations from the mean). These are the between groups MS (often known as just groups MS) and the within groups MS (often termed the error MS) respectively.

If the null hypothesis is correct then both MS (or variance estimates) will be an estimate of the variance common to all four statistical populations. If the four population means are not equal then the between groups MS will be greater than the within groups MS. This can be tested by a simple one-tailed variance ratio test:

F = Between groups MS / Within groups MS

In this case:

F = 27.4072 / 3.9060 = 7.0167

In this example case, the critical value at the 0.05 level of significance can be seen to be 3.0488 and this is exceeded by the F value of 7.0167. In other words, the null hypothesis must be rejected and it can be stated that population means of the weights of cakes are significantly different dependent on baking method used.



Back to Main Document