1D ANOVA Factors and Levels

A factor is a basis for categorizing data. For example, if you count the number of sit-ups individuals can do, one basis of categorization is age. For age, you might have the following levels.

Level 06 years old to 10 years old
Level 111 years old to 15 years old
Level 216 years old to 20 years old

Now, suppose that you make a series of observations to see how many sit-ups people can do. If you take a random sampling of five people, you might find the following results.

Person 1 8 years old (level 0) 10 sit-ups
Person 2 12 years old (level 1) 15 sit-ups
Person 3 16 years old (level 2) 20 sit-ups
Person 4 20 years old (level 2) 25 sit-ups
Person 5 13 years old (level 1) 17 sit-ups

Notice that you have made at least one observation per level. To perform an analysis of variance, you must make at least one observation per level.

To perform the analysis of variance, you specify an array X of observations, with values 10, 15, 20, 25, and 17. The array Index specifies the level (or category) to which each observation applies. In this case, Index has the values 0, 1, 2, 2, and 1. Finally, there are three possible levels, so you pass in a value of 3 for the # of levels parameter.