Module 012 - One Way ANOVA and Its
Module 012 - One Way ANOVA and Its
1
One-Way ANOVA and Its Application
ANOVA Test
ANOVA is short for ANalysis Of VAriance. The main purpose of an ANOVA is to test if
two or more groups differ from each other significantly in one or more characteristics.
For some statisticians the ANOVA doesn’t end there – they assume a cause effect
relationship and say that one or more independent, controlled variables (the
factors) cause the significant difference of one or more characteristics. The way this
works is that the factors sort the data points into one of the groups and therefore they
cause the difference in the mean value of the groups.
Example: Let us claim that woman have on average longer hair than men. We find
twenty undergraduate students and measure the length of their hair. A conservative
statistician would then claim we measured the hair of ten female and ten male
students, and that we conducted an analysis of variance and found that the average
hair of female undergraduate students is significantly longer than the hair of their
fellow male students.
A more aggressive statistician would claim that gender has a direct relation to the
length of a person’s hair. Most statisticians fall into the second category. It is
generally assumed that the ANOVA is an ‘analysis of dependencies.’ It is referred to as
such because it is a test to prove an assumed cause and effect relationships. In more
statistical terms it tests the effect of one or more independent variables on one or
more dependent variables. It assumes an effect of Y = f(x1, x2, x3, … xn).
The ANOVA is a popular test; it is the test to use when conducting experiments. This
is due to the fact that it only requires a nominal scale for the independent variables –
other multivariate tests (e.g., regression analysis) require a continuous-level
scale. This following table shows the required scales for some selected tests.
Independent Variable
Metric Non-metric
DependentVariable metric Regression ANOVA
Course Module
Non-metric Discriminant χ²(Chi-Square)
Analysis
The F-test, the T-test, and the MANOVA are all similar to the ANOVA. The F-test is
another name for an ANOVA that only compares the statistical means in two
groups. This happens if the independent variable for the ANOVA has only two factor
steps, for example male or female as a gender.
The T-test compares the means of two (and only two) groups when the variances are
not equal. The equality of variances (also called homoscedasticity or homogeneity)
is one of the main assumptions of the ANOVA (see assumptions, Levene Test, Bartlett
Test). MANOVA stands for Multivariate Analysis of Variance. Whereas the ANOVA
can have one or more independent variables, it always has only one dependent
variable. On the other hand the MANOVA can have two or more dependent variables.
Medicine – Does a drug work? Does the average life expectancy significantly differ
between the three groups that received the drug versus the established product
versus the control?
Sociology – Are rich people happier? Do different income classes report a significantly
different satisfaction with life?
Management Studies – What makes a company more profitable? A one, three or five-
year strategy cycle?
An ANOVA test is a way to find out if survey or experiment results are significant. In
other words, they help you to figure out if you need to reject the null hypothesis or
accept the alternate hypothesis. Basically, you’re testing groups to see if there’s a
difference between them. Examples of when you might want to test different groups:
The one-way analysis of variance (ANOVA) is used to determine whether there are
any statistically significant differences between the means of three or more
independent (unrelated) groups. This guide will provide a brief introduction to the
one-way ANOVA, including the assumptions of the test and when you should use this
Quantitative Methods
3
One-Way ANOVA and Its Application
test. If you are familiar with the one-way ANOVA, you can skip this guide and go
straight to how to run this test in SPSS Statistics by clicking here.
The one-way ANOVA compares the means between the groups you are interested in
and determines whether any of those means are statistically significantly different
from each other. Specifically, it tests the null hypothesis:
If, however, the one-way ANOVA returns a statistically significant result, we accept
the alternative hypothesis (HA), which is that there are at least two group means that
are statistically significantly different from each other.
At this point, it is important to realize that the one-way ANOVA is an omnibus test
statistic and cannot tell you which specific groups were statistically significantly
different from each other, only that at least two groups were. To determine which
specific groups differed from each other, you need to use a post hoc test. Post hoc tests
are described later in this guide.
If you are dealing with individuals, you are likely to encounter this situation using two
different types of study design:
One study design is to recruit a group of individuals and then randomly split this
group into three or more smaller groups (i.e., each participant is allocated to one, and
only one, group). You then get each group to undertake different tasks (or put them
under different conditions) and measure the outcome/response on the same
dependent variable. For example, a researcher wishes to know whether different
pacing strategies affect the time to complete a marathon. The researcher randomly
assigns a group of volunteers to either a group that (a) starts slow and then increases
their speed, (b) starts fast and slows down or (c) runs at a steady pace throughout.
The time to complete the marathon is the outcome (dependent) variable. This study
design is illustrated schematically in the diagram below:
Course Module
Figure 1: One-Way ANOVA
URL: https://statistics.laerd.com/statistical-guides/one-way-anova-statistical-guide.php
Retrieved: September 09, 2018
Groups or levels are different groups in the same independent variable. In the above
example, your levels for “brand of cereal” might be Lucky Charms, Raisin Bran,
Cornflakes — a total of three levels. Your levels for “Calories” might be: sweetened,
unsweetened — a total of two levels.
Let’s say you are studying if Alcoholics Anonymous and individual counseling
combined is the most effective treatment for lowering alcohol consumption. You
might split the study participants into three groups or levels: medication only,
medication and counseling, and counseling only. Your dependent variable would be
the number of alcoholic beverages consumed per day.
If your groups or levels have a hierarchical structure (each level has unique
subgroups), then use a nested ANOVA for the analysis.
It’s whether you are replicating your test(s) with multiple groups. With a two way
ANOVA with replication , you have two groups and individuals within that group are
doing more than one thing (i.e. two groups of students from two colleges taking two
tests). If you only have one group taking two tests, you would use without replication.
Types of Tests.
There are two main types: one-way and two-way. Two-way tests can be with or
without replication.
One-way ANOVA between groups: used when you want to test two groups to
see if there’s a difference between them.
Two way ANOVA without replication: used when you have one group and
you’re double-testing that same group. For example, you’re testing one set of
individuals before and after they take a medication to see if it works or not.
Two way ANOVA with replication: Two groups, and the members of those
groups are doing more than one thing. For example, two groups of patients
from different hospitals trying two different therapies.
A one way ANOVA is used to compare two means from two independent (unrelated)
groups using the F-distribution. The null hypothesis for the test is that the
two means are equal. Therefore, a significant result means that the two means are
unequal.
Situation 1: You have a group of individuals randomly split into smaller groups and
completing different tasks. For example, you might be studying the effects of tea on
weight loss and form three groups: green tea, black tea, and no tea.
Situation 2: Similar to situation 1, but in this case the individuals are split into groups
based on an attribute they possess. For example, you might be studying leg strength
of people according to weight. You could split participants into weight categories
(obese, overweight and normal) and measure their leg strength on a weight machine.
A one way ANOVA will tell you that at least two groups were different from each other.
But it won’t tell you what groups were different. If your test returns a significant f-
statistic, you may need to run an ad hoc test (like the Least Significant Difference test)
to tell you exactly which groups had a difference in means.
ANOVA tests in statistics packages are run on parametric data. If you have rank or
ordered data, you’ll want to run a non-parametric ANOVA (usually found under a
different heading in the software, like “nonparametric tests“).
Course Module
Steps
It is unlikely you’ll want to do this test by hand, but if you must, these are the steps
you’ll want to take:
A Student’s t-test will tell you if there is a significant variation between groups. A t-
test compares means, while the ANOVA compares variances between populations.
You could technically perform a series of t-tests on your data. However, as the groups
grow in number, you may end up with a lot of pair comparisons that you need to run.
ANOVA will give you a single number (the f-statistic) and one p-value to help
you support or reject the null hypothesis.
The simplest case is one-way ANOVA. A one-way analysis of variance is used when
the data are divided into groups according to only one factor.
Assume that the data X11, X12, X13, … , X1n1 are sample from population 1, X21, X22, X23,
… , X2n2 are sample from population 2, , Xk1, Xk2, Xk3, … , Xknk are sample from
population k. Let Xij denote the data from the ith group (level) and jth observation.
Let N = n1 + n2 +… +nk is the total number of observations (the total sample size across
all groups), where ni is sample size for the ith group.
Quantitative Methods
7
One-Way ANOVA and Its Application
The parameters of this model are the population means µ1 + µ2 + … + µk and the
common standard deviation σ.
Using many separate two-sample t-tests to compare many pairs of means is a bad idea
because we don’t get a p-value or a confidence level for the complete set of
comparisons together.
represent the grand mean, the mean of all the data points:
Course Module
ANOVA is centered around the idea to compare the variation between groups (levels)
and the variation within samples by analyzing their variances.
Define the total sum of squares SST, sum of squares for error (or within groups) SSE,
and the sum of squares for treatments (or between groups) SSC:
Consider the deviation from an observation to the grand mean written in the
following way:
Notice that the left side is at the heart of SST, and the right side has the analogous
pieces of SSE and SSC. It actually works out that:
The total mean sum of squares MST, the mean sums of squares for error MSE, and the
mean sums of squares for treatment MSC are:
Quantitative Methods
9
One-Way ANOVA and Its Application
The one-way ANOVA, assuming the test conditions are satisfied, uses the following
test statistic:
The results of the computations that lead to the Fstatistic are presented in an ANOVA
table, the form of which is shown in the Table 1.
In statistical softwares is used to be in this table column with pvalue. This p-value
says the probability of rejection the null hypothesis in case the null hypothesis holds.
In case , where α is chosen significance level, is the null hypothesis rejected
with probability greater than % probability.
Step 1: Input your data into columns or rows in Excel. For example, if three groups of
students for music treatment are being tested, spread the data into three columns.
Course Module
Step 2: Click the “Data” tab and then click “Data Analysis.” If you don’t see Data
Analysis, load the ‘Data Analysis Toolpak’ add-in.
Step 4: Type an input range into the Input Range box. For example, if the data is in
cells A1 to C10, type “A1:C10” into the box. Check the “Labels in first row” if we have
column headers, and select the Rows radio button if the data is in rows.
Step 5: Select an output range. For example, click the “New Worksheet” radio button.
Step 6: Choose an alpha level. For most hypothesis tests, 0.05 is standard.
Step 7: Click “OK.” The results from ANOVA will appear in the worksheet.
Here, we can see that the F-value is greater than the F-critical value for the alpha level
selected (0.05). Therefore, we have evidence to reject the null hypothesis and say that
at least one of the three samples have significantly different means and thus belong
to an entirely different population.
Another measure for ANOVA is the p-value. If the p-value is less than the alpha level
selected (which it is, in our case), we reject the Null Hypothesis.
Step 8: Again, click on “Data Analysis” in the “Data” tab and select “t-Test: Two-Sample
Assuming Equal Variances” and click “OK.”
Step 9: Input the range of Class A column in Variable 1 Range box, and range of Class
B column in Variable 2 Range box. Check the “Labels” if you have column headers in
the first row.
Quantitative Methods
11
One-Way ANOVA and Its Application
Step 10: Select an output range. For example, click the “New Worksheet” radio button.
Step 11: Perform the same steps (Step 8 to step 10) for Columns of Class B – Class C
and Class A – Class C.
Here, we can see that the p-value of (A vs B) and (A vs C) is less than the alpha level
selected (alpha = 0.05). This means that groups A and B & groups A and C have less
than 5% chance of belonging to the same population. Whereas for (B vs C) it is much
greater than the significance level. This means that B and C belong to the same
population. So, it is clear that A (constant music group) belongs to an entirely different
population. Or we can say that the constant music had a significant effect on the
performance of students.
Another effect size measure for one-way ANOVA is called Eta squared. It works in the
same way as R2 for t-tests. It is used to calculate how much proportion of the
variability between the samples is due to the between group difference. It is
calculated as:
Course Module
Hence 60% of the difference between the scores is because of the approach that was
used. Rest 40% is unknown. Hence Eta square helps us conclude whether the
independent variable is really having an impact on the dependent variable or the
difference is due to chance or any other factor.
There are commonly two types of ANOVA tests for univariate analysis – One-Way
ANOVA and Two-Way ANOVA. One-way ANOVA is used when we are interested in
studying the effect of one independent variable (IDV)/factor on a population,
whereas Two-way ANOVA is used for studying the effects of two factors on a
population at the same time. For multivariate analysis, such a technique is called
MANOVA or Multi-variate ANOVA.