2-Way ANOVA
   

   

 Math Help -> Statistics -> 2-Way ANOVA 

Contents of this section:

Here's what you'll find in this section:

Two-way ANOVA and Nonparametric Inferences

 
bullet 
bulletTwo-way ANOVA

Two-way ANOVA

EXAMPLE:\ An agricultural scientist is interested in the corn yield when three different fertilizers are available and corn is planted in four different soil types. The questions he is interested in answering are:

  1. Does fertilizer type have an effect on crop yield?
  2. Does soil type have an effect on crop yield?
  3. Do the two treatment factors interact? For instance, there may be no difference between fertilizer #1 and fertilizer #2 in soil type 1, but fertilizer #1 may produce a greater corn yield than fertilizer #2 in soil type 2. This is an example of interaction.

Because we are applying two treatments to our population, we will use two-way ANOVA to analyze this type of problem. We will consider two types of two-way ANOVA:

  1. Two-way ANOVA without interaction (the ``additive model'').
  2. Two-way ANOVA with interaction.

 
bullet 
bulletThe Additive Model
bullet

The Additive Model

If we use the model

displaymath4807

we have to estimate IJ means and tex2html_wrap_inline2693 (a total of IJ+1 parameters) using only IJ observations! Since we can't estimate all of our parameters, we will change models (slightly),

displaymath4817

where tex2html_wrap_inline3873 is the effect of factor A and tex2html_wrap_inline4239 is the effect of factor B. Now we only have to estimate I+J+1 parameters, which is now possible. (Actually, we also assume tex2html_wrap_inline4829 which leaves us with only I+J-1 parameters to estimate.)

A slightly more general additive model is

displaymath4833

where tex2html_wrap_inline4835 are the number of replications at each combination of factor A and factor B levels.

NOTE:\ When k is small, especially when k=1, we are forced to use the additive model. There will be more about this in Section 10.2.2.

The ANOVA table for the additive model is given by

 

 

table2082

 

 

The relevant null hypotheses are

eqnarray2097

and are tested by tex2html_wrap_inline4859 and tex2html_wrap_inline4861 , respectively. In words, these hypotheses are

eqnarray2101

 

EXAMPLE:\ In a study of automobile traffic and air pollution, air samples taken at four different times and at five different locations were analyzed to obtain the amount of particulate matter present in the air. Is there any difference in true average amount of particulate matter present in the air due either to different sampling times or to different locations?

 

 

table2107

 

 

Notice that in this case, both tex2html_wrap_inline4859 and tex2html_wrap_inline4861 are significantly greater than one. Thus, there is an effect due both to time and location.

When the additive model holds, there is no interaction between factors A and B. In other words, the effect of factor A is the same no matter what the level of factor B is. When the additive model doesn't hold, we have to go to a model which allows A and B to interact.

 
bulletTwo-way ANOVA with Interaction
bullet

Two-way ANOVA with Interaction

We will use the model

displaymath4883

where tex2html_wrap_inline4885 , tex2html_wrap_inline4887 , and tex2html_wrap_inline4835 , but represent it in the form

displaymath4891

where tex2html_wrap_inline4893 is the interaction of factors A and B.

The relevant null hypotheses are

displaymath2117

and are tested by their respective F values in the following ANOVA table.

 

 

table2127

 


 

bulletNonparametric (Distribution-Free) Inferences

 
bullet 
bulletIntroduction to Nonparametric Inferences
bullet

Introduction to Nonparametric Inferences

If we have small samples, the one and two sample t tests and the test of comparing K means are all valid only if we are sampling from normal populations. This week we study methods for comparing the distribution of populations that do not require the normality (or any other distributional assumption). There are two basic points to be made:

1. The distribution-free methods are valid for any distribution of the populations being compared, that is, if we specify a certain tex2html_wrap_inline3873 value, then the true type I error probability is tex2html_wrap_inline3873 .

2. If the populations being compared do in fact have the normal distribution, then the previous methods (t tests and so on) are in fact better than the distribution-free methods we will study. They are better in the sense that if the populations are different, then the parametric procedures have a better chance of concluding they are different (that is, they are more powerful).

These two points are illustrated in the ``Comparing Parametric and Nonparametric Tests'' concept lab.


 
bulletThe Sign Test for Paired Data
bullet

The Sign Test for Paired Data

Given n pairs of data, the sign test tests the hypothesis that the median of the differences in the pairs is zero. The test statistic is the number of positive differences. If the null hypothesis is true, then the numbers of positive and negative differences should be approximately the same. In fact, the number of positive differences will have a binomial distribution with parameters n and p. Stataquest will return the p-value associated with the test statistic.

 
bulletThe Wilcoxon Signed-Rank Test for Paired Data
bullet

The Wilcoxon Signed-Rank Test for Paired Data

A similar test for the median difference in paired data to be zero consists of sorting the absolute values of the differences from smallest to largest, assigning ranks to the absolute values (rank 1 to the smallest, rank 2 to the next smallest, and so on) and then finding the sum of the ranks of the positive differences. If the null hypothesis is true, the sum of the ranks of the positive differences should be about the same as the sum of the ranks of the negative differences. Again, Stataquest will return the p-value of the test.

 
bulletThe Wilcoxon Rank-Sum (Mann-Whitney) Test for Two Independent Samples
bullet

The Wilcoxon Rank-Sum (Mann-Whitney) Test for Two Independent Samples

This test is used in place of a two sample t test when the populations being compared are not normal. It requires independent random samples of sizes tex2html_wrap_inline3601 and tex2html_wrap_inline3603 . The test is very simple and consists of combining the two samples into one sample of size tex2html_wrap_inline3621 , sorting the result, assigning ranks to the sorted values (giving the average rank to any `tied' observations), and then letting T be the sum of the ranks for the observations in the first sample. If the two populations have the same distribution then the sum of the ranks of the first sample and those in the second sample should be close to the same value. Stataquest returns a p value for the null hypothesis that the two distributions are the same.

 
bulletThe Kruskal-Wallis Test for K Independent Samples
bullet

The Kruskal-Wallis Test for K Independent Samples

This test is the nonparametric version of one way ANOVA and is a straightforward generalization of the Wilcoxon test for two independent samples. If we have K independent samples of sizes tex2html_wrap_inline3637 , we combine all the samples into one large sample, sort the result from smallest to largest and assign ranks (again assigning the average rank to any observation in a group of tied observations), and then find tex2html_wrap_inline4987 , the average of the ranks of the observations in the ith sample. The test statistic is then

displaymath4991

and reject the null hypothesis that all K distributions are the same if tex2html_wrap_inline4995 . Again, Stataquest will return the p value for the test.

 

bullet 
bulletComputer Lab
bullet

Computer Lab

Applicable StataQuest Commands:

Statistics tex2html_wrap_inline3057 ANOVA tex2html_wrap_inline3057 Two-way this also includes interaction plots

Statistics tex2html_wrap_inline3057 Nonparametric test tex2html_wrap_inline3057 Sign test for Wicoxon signed-rank test

Statistics tex2html_wrap_inline3057 Nonparametric test tex2html_wrap_inline3057 Mann-Whitney for Wicoxon-Mann-Whitney rank sum test

Statistics tex2html_wrap_inline3057 Nonparametric test tex2html_wrap_inline3057 Kruskal-Wallis for Kruskal-Wallis test


 
bulletConcept Lab
bullet 

 

Internet References

 

Related pages in this website

 

 

The webmaster and author of the Math Help site is Graeme McRae.
     [home]  [email]  [search]  [Links to Math Sites]  [Whiteboard]