Two-Way ANOVA: Definition & Application

Instructor: Betsy Chesnutt

Betsy teaches college physics, biology, and engineering and has a Ph.D. in Biomedical Engineering

A two-way analysis of variance (ANOVA) is used to determine if two different factors have an effect on a measured variable or not. In this lesson, we will learn how to perform a two-way ANOVA and how to interpret the results.

What is ANOVA?

A weight loss clinic is testing the effectiveness of four different diet programs. Each diet is supposed to help clients lose weight, but no one knows if one is more effective than the others. There are many situations like this where you want to know if there is a statistically significant difference between groups. When you are only comparing two groups, you can determine if they are different from each other using a t-test, but this won't work if you have three or more groups. An Analysis of Variance, or ANOVA, is another statistical test that you can use to determine if there are differences between three or more groups.

When Would You Use a Two-Way ANOVA?

In statistics, the conditions that can affect the measured variable are known as factors. An ANOVA can be used to determine the effect of just one or multiple factors on a measured variable. In the case of the weight loss clinic, the factor would be the diet program and the measured variable would be the amount of weight lost by patients. There is only ONE factor here, so this data could be analyzed using a one-way ANOVA.

What if the clinic wanted to investigate the effectiveness of not only diet programs, but also exercise plans on patient weight loss? Now, there would be TWO factors (diet plan and exercise plan) that might affect the measured variable (weight loss). There might even be some interaction between the diet plan and the exercise plan that a patient was following. In this situation, a two-way ANOVA would be used to determine if either of the factors caused differences in the measured variable and if there were any interaction effects between the two factors. An example of an interaction effect would be if the effectiveness of a diet plan was influenced by the type of exercise a patient performed.

Hypotheses Tested by a Two-Way ANOVA

A two-way ANOVA is actually testing three hypotheses. You are trying to determine if there are any differences caused by each of the factors on the measured variable, and also if there is any interaction between the two factors. This gives you three null hypotheses to test:

Null Hypothesis #1: There are no differences in the population mean (of the measurement variable) due to the first factor.

Null Hypothesis #2: There are no differences in the population mean due to the second factor.

Null Hypothesis #3: There are no interaction effects between the first and second factors.

These use very general language and can be applied to any situation. In our example about the weight loss clinic, you might write the hypotheses like this:

1. On every diet plan, patients lost the same amount of weight

2. On every exercise plan, patients lost the same amount of weight.

3. There was no interaction between the diet plan and the exercise plan.

How to Perform a Two-Way ANOVA

First, make a table of all your data. If there are 3 different diet plans and 3 different exercise plans that you want to investigate, then you need a table with 9 (3x3) different treatment groups. Each treatment group will contain a different combination of the two factors (diet and exercise plan, in this example).

Two way ANOVA data table

Next, you will calculate the mean of each column and row in the data table, as well as the total mean of all the data. From this, you can calculate the sum of squares within each factor and between factors. To calculate the sum of squares (SS), subtract each measurement from the mean and then square all these differences. Add them all up to get the sum of squares.

Then, find the mean square difference for each by dividing the sum of squares by the degrees of freedom.

ANOVA equations

For the two factors, the number of degrees of freedom is one less than the total number of groups in each factor. So the degrees of freedom for the diet plan factor would be 3-1 or 2, and the degrees of freedom for the exercise plan freedom would also be 2. The degrees of freedom for the interaction effect is found by multiplying the degrees of freedom for each factor. So in this case, it would be 2x2 = 4.

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account