Analysis of Variance

 

Analysis of Variance allows us to compare two or more populations of quantitative data (such as the mean).  It allows us to determine whether differences exist among population means by analyzing the sample variance. 

 

Example:

A supermarket owner wants to determine whether or not the sales of a new product are affected by the aisle in which the product is stored.  If there are 10 aisles in the store, the experiment would consist of locating the product in a different aisle each of 10 weeks and recording the daily sales.  The owner would conduct an analysis of variance, which tests to determine if differences exist among mean daily sales.  The parameters are m1, m2, …, m10.  In this experiment, we are able to classify the population using only one factor, which is the aisle on which the new product is placed. This factor has 10 levels, which is the specific aisle on which the product is placed.  If we could placed the new product on one of three shelves in each aisle, then we would have a second factor (shelves) with 3 levels.

 

Single-Factor (One-Way) Analysis of Variance: Independent Samples

 

In this section, we will cover the procedure to apply when the samples are independently drawn.

 

Example: Single-Factor

The marketing manager of an apple juice manufacturer has to decide how to market a new liquid concentrate apple juice.  She can create advertising that emphasizes convenience, quality or price.  In order to facilitate a decision, she conducts an experiment.  She launches the product in three different small cities.  In City 1 she launches the product with advertising stressing convenience.  In City 2, she launches the product with advertising stressing quality.  In City 3, she launches the product with advertising stressing price.  The number of packages sold weekly is recorded for 20 weeks (stored in file XM15-01).  The marketing manager wants to know if differences in sales exit among the three cities. 

 

Weekly Sales in the 3 Cities:

City 1 (Convenience)

City 2 (Quality)

City 3 (Price)

529

804

672

658

630

531

793

774

443

514

717

596

 

The first step is to establish H0 and HA:

 

H0 : m1 = m2 = m3

HA : At least two means differ

 

 

Test Statistic:

Independent Samples from k Populations (Treatments)

 

1

2

k

x11

x12

x1k

x21

x22

x2k

 

 

 

 

 

 

xn11

xn22

xnkk

n1

n2

nk

 

xij = ith observation of the jth sample

nj = number of observations in the sample taken from the jth population

 

 = mean of the jth sample

 

 = grand mean of all the observations

 

where n = n1 + n2 = … + nk and k is the number of populations.  Notice that we allow the sample sizes to be different. 

 

The variable x is called the response variable and its values are called responses.

 

The unit that we measure is called an experimental unit. 

 

In our example, the response variable is weekly sales and the experimental units are the weeks in the 3 cities when we record sales figures.  The sales figures are the responses.

 

We have one factor, the advertising approach that defines the populations, and there are 3 levels of this factor (convenience, quality, price). 

 

Test Statistic:

The statistic that measures the proximity of the sample means to each other is called the between-treatments variation, which is also called the Sum of Squares for Treatments, SST.

 

 

If the sample means are close to each other, all of the sample means would be close to the grand mean and the SST would be small.  The SST is smallest when all the sample means are equal:

 

then SST = 0. 

 

In our example,

 

then:

 

SST = 20(577.55 - 613.07)2 + 20(653.00 - 613.07)2 + 20(608.65 - 613.07)2 = 57512.23

 

If large differences exist between the sample means, at least some sample means differ considerable from the grand mean, producing a large value of SST.  Then we reject H0. 

 

How large does SST have to be in order to reject H0?

 

To answer this question, we must know how much variation exists in the weekly sales, which is measured by the within treatments variation, which is called the Sum of Squares for Error, SSE.  SSE provides a measure of the amount of variation we can expect from the random variable we have observed.

 

 

Now look at this Table 2:

 

1

2

3

10

15

20

10

16

20

11

14

20

10

16

20

9

14

20

 

In this example, the variation within each sample is small and SST is judged to be a large number. This random variable displays very little variation.  The differences between the sample means appear to be caused by real differences between the population means. 

 

Now look at Table 3:

1

2

3

1

19

5

12

31

33

20

4

20

10

9

12

7

12

30

 


 


The value of SST in Table 15.3 is equal to Table 15.2.  However, the variation within the samples is large, which tells us that this random variable features a lot of variation.  SST is small which we would conclude that the differences between the sample means does not allow us to infer that the population means differ.

 

SSE can also be expressed as the following when we divide each component by nj - 1:

 

SSE = (n1 - 1)s12 + (n2 - 1)s22 + … + (nk - 1)sk2 =

 

Where sj2 is the sample variance of sample j. 

 

Thus the SSE is the combined or pooled variation of the k samples.

 

To use this form of the SSE, the population variances must be equal:

s12 = s22 = … = sk2   

 

In our apple juice example, the sample variances are:

 

s12 = 10774.44

s22 = 7238.61

s32 = 8669.47

 

Thus,

 

SSE = (n1 - 1)s12 + (n2 - 1)s22 + (n3 - 1)s32

SSE = 19(10774.44) + 19(7238.61) + 19(8669.47)

SSE = 506967.88

 

The next step is to calculate the Mean Squares. 

 

The Mean Square for Treatments (MST):

 

MST = SST/(k - 1)

 

The Mean Square for Error (MSE):

 

MSE = SSE/(n - k)

 

Test Statistic:

 

F = MST/MSE

 

The test statistic is F-distributed with k - 1 and n - k degrees of freedom provided that the response variable is normally distributed.  The ratio F = MST/MSE is the ratio of two sample variances.

 

MST = SST/(k - 1) = 57512.23/(3-1) = 28756.12

 

MSE = SSE/(n - k) = 506967.88/(60 - 3) = 8894.17

 

F = MST/MSE = 28756.12/8894.17 = 3.23

 

Rejection Region

 

F > Fa, k - 1, n - k

 

If we let a = .05, then the rejection region for the apple juice example is:

 

F > Fa, k - 1, n - k = F > F.05, 2, 57 ~ 3.15

 

Show Figure 15.4 - F distribution and rejection region

 

We found the value of the test statistic to be F = 3.23, which allows us to conclude that there is enough evidence to infer that the mean weekly sales differ among the three cities, and we reject H0. 

 

The results of the analysis of variance are usually reported in an ANOVA Table:

ANOVA Table for the Single-factor Analysis of Variance: Independent Samples

Source of Variation

Degrees of Freedom

Sum of Squares

Mean Squares

F-Statistic

Treatments

k-1

SST

MST = SST/(k - 1)

F = MST/MSE

Error

n-k

SSE

MSE = SSE/(n - k)

 

Total

n-1

SS(total)

 

 

 

ANOVA Table for Apple Juice example

Source of Variation

Degrees of Freedom

Sum of Squares

Mean Squares

F-Statistic

Treatments

2

57,512.23

28,756.12

3.23

Error

57

506,967.88

8,894.17

 

Total

59

SS(total)

 

 

 

Using Minitab:

1.      Type or Import the data

2.      If the data are unstacked, click Stat, ANOVA, and Oneway (Unstacked)

3.      Type the names of the treatments (Convnce, Quality, Price)

4.      Click O.K.

If the data are stacked,

5.      Click Stat, ANOVA, and Oneway

6.      Type the variable name of the response variable and variable name of the factor

7.      Click O.K.

 

Interpreting the Results

The p-value is .047 which means there is evidence to infer that mean weekly sales of the apple juice are different in at least two of the cities. 

 

SS(Total) = SST + SSE

 

SSE = measures the amount of variation within the samples

 

SST = measures the amount of variation attributed to the differences among the treatments

 

If SST explains a significant portion of the total variation, we conclude that the population means differ.

 

Can We Use t-tests of the Difference Between Two Means Instead of the Analysis of Variance?

The Analysis of variance tests to determine whether there are differences among two or more population means.  The t-test of m1 - m2 determines whether there is a difference between two population means. 

 

The question you might ask "can we use t-tests instead of the analysis of variance?"  That is, instead of testing all the means at once as with the ANOVA, why not test each pair of means?

 

In the apple juice example, we would test m1 - m2 , m1 - m3 , m2 - m3  If we found no evidence of a difference in each test, we would conclude that none of the means differ.  Alternatively, if we found evidence of at least one difference in a test, we would conclude that some of the means differ.

 

There are 2 reasons we do not use multiple t-tests:

1.      We would have to perform many more calculations. 

2.      Conducting multiple tests increases the probability of making Type I errors (probability of rejecting a true Null Hypothesis).     

 

Example:

Consider a problem where we want to compare 6 populations, all of which are identical.  If we conduct an analysis of variance and set the significance level at 5%, there is a 5% chance that we would reject the Null Hypothesis (we would conclude that differences exist when in fact they do not). 

 

To replace the F-test, we would perform 15 t-tests (a combinations problem of taking 6 things 2 at a time).  Each test would have a 5% probability of erroneously rejecting the null hypothesis.  This probability becomes 54% for all 15 tests combined (computed using a Binomial distribution with n = 15, and p = .05).  

 

Can We Use the Analysis of Variance Instead of the t-test of m1 - m2  

The Analysis of Variance is one of several techniques used to compare two or more populations.  It can be used to compare exactly 2 populations, so why do we need a technique specifically for 2 populations such as the t-test?  Suppose we plan to use the analysis of variance to test 2 population means:

 

H0: m1 = m2

HA: At least 2 means differ

 

The alternative Hypothesis specifies that m1 ¹ m2 . If we want to determine whether m1 is greater than m2 or less than m2 we cannot use the analysis of variance since it only tests for a difference.

 

Conceptually and mathematically, the F-test of the independent samples single factor analysis of variance is an extension of the t-test of m1 = m2.  In fact, if you square the test statistic for the t-test, you have the F-test.  If we simply want to determine if a difference between two means exists, we can use the analysis of variance.  The advantage is using the ANOVA is that we can partition the total sum of squares, which allows us to measure how much variation is attributed to differences among populations and how much variation is attributed to difference within populations.

 

Analysis of Variance Models

 

Single Factor and Multi-factor Models

Remember, the group of treatments or populations is called a factor.  The apple juice example was a single factor analysis of variance because it addressed the problem of comparing 2 or more populations on the basis of one factor.

 

A multi-factor model is one where there are 2 or more factors that define the treatments. 

 

Consider the advertising example.  We used the single factor model because the treatments were the 3 advertising approaches.  The factor was the advertising approach and the 3 levels were convenience, quality, and price.

 

Now, what if we conduct another study and vary the medium in which the advertising is delivered: television or newspaper.  We could then develop a 2 factor analysis of variance.  The second factor would be the advertising medium with 2 levels. 

 

Independent Sample and Blocks

When the problem objective is to compare more than 2 populations, the experimental design is called the randomized block design. 

 

The term block refers to a matched group of observations from each population. 

 

Example:

To determine whether incentive pay plans are effective, we selected 3 groups of 5 workers who assemble electronic equipment.  Each group will be offered a different incentive plan.  The treatments are the incentive plans, the response variable is the number of units produced each day, and the experimental units are the workers.

 

If we obtain data from independent samples, we may not be able to detect differences among the pay plans because of variation among the workers.  If the there are differences among the workers, we need to identify the source of the differences. 

 

Sup