We are going to learn about ANOVA using the example that I hope you remember from childhood.
So let's take a walk down the yellow brick road and listen for the sounds of the dark side of the moon
To put us in the mood to conduct a one-way ANOVA by hand.
And here is the research story for our one-way ANOVA.
Following a series of complaints about wicked witches, the Wizard of Oz
conducts a study to determine if certain regions of oz have more problems with wicked witches than other regions.
He randomly surveys five munchkins from each of four regions and
records the number of complaints he received about wicked witchiness from each one.
Is here a difference in witch wickedness between regions?
Now before we go further in conducting this one way ANOVA by hand, let me let you in on a little secret.
You will not be conducting many ANOVAs by hand.
This is why
we have software. The purpose here is to show you how the ANOVA actually works,
something that you cannot see in the software.
But actually getting in and using the map helps you really
understand how each of these elements of the analysis relate to the others and this is really the best way of learning to truly
understand statistics.
So let's begin with our data. We can see that there are four regions: north, south, east, and west.
We have the data for the number of wicked witch complaints from each region and the means for each region.
20 Munchkins were surveyed, so that is our sample size. The number of regions is 4, so that is K.
Let's walk through the five steps of hypothesis testing for the ANOVA.
Step Number One: Select the Appropriate Statistic
We are comparing for independent groups,
so we will use the One-Way ANOVA.
Step Two: State The Null and Alternative Hypotheses
Our null hypothesis is that the means of each of the four regions are the same.
We would write this null hypothesis as,
H0: μ1 = μ2 = μ3 = μ4
The alternative hypothesis Is that the means differ from one another.
We are not saying which means differ from which other means, so
we are going to go with the safe option for the alternative hypothesis:
H1: μ1 ≠ μ2 ≠ μ3 ≠ μ4
Step 3: Select A level of Significance
We will use our typical alpha of .05, but
we don't really need to state a one tail to tail at this point because in a sense
ANOVA is always one-tail because the F-distribution has only one tail.
On the other hand, the ANOVA omnibus test only tells us that there are some mean differences in there somewhere, but
we would need a post-hoc tests to find out where those means lie, and that post hoc test could be
potentially directional.
We could hypothesize the means for one region will be higher than the means for another region.
So in that sense, the tails don't really matter for this step, only later for the post-hoc.
Although if we're going to do those kinds of comparisons with ANOVA, we would be better off to use something called planned
contrasts. More about that in another video.
What does matter here is the degrees of freedom so that we can find the critical value.
Calculating the critical value for a one-way ANOVA requires knowing the degrees of freedom for the numerator and the denominator
of the F ratio.
The degrees of freedom for the numerator Is based on the number of categories or levels, K.
This is called the degrees of freedom between.
The degrees of freedpm for the denominator is based on the sample size, n,
and this is called the degrees of freedom within.
The degrees of freedom between equals K - 1, so in our example where
we have 20 munchkins from four regions,
K = 4. The degrees of freedom between would be our four regions minus 1, or
3.
The degrees of freedom within
equals n - K.
The degrees of freedom within would be the total number of munchkins, or
participants, which was 20 minus the number of categories,
4, or
16.
The degrees of freedom total
equals n - 1, as it always does, with n being the total number of participants in all groups.
There are 20 participants, so the total degrees of freedom are 19
You can also reach the degrees of freedom total by adding the degrees of freedom between and the degrees of freedom within.
Now finding the critical value once we know these degrees of freedom requires turning to the ANOVA F table below.
The degrees of freedom between are contained in the columns at the top of the table.
The degrees of freedom within are in the rows.
The intersection of the column and the row is the critical value.
So for 3 degrees of freedom between and 16 degrees of freedom within, the critical value is
3.24, and that Is written CV (critical value) with 3 and 16 degrees of freedom equals 3.24.
Returning now to our five steps of hypothesis testing, for an alpha Level of .05
with 3 and 16 degrees of freedom, our critical value Is 3.24
Step Four:
Calculate The Statistics
When working an ANOVA by hand you must create columns of the data.
We call Them Columns X1 through X4, where north is X1, south is X2,
east is X3, and West is X4.
Then, we will create an X^2 column for each of these existing columns.
The X^2 column, was created by squaring each value in the corresponding X column.
Now, focusing on the X columns, I need to create a sum of X, or a sum of the column for each
one just like this, and
for each of the columns that we calculate, we also need to add across the rows and
calculate a total. So the sum of X Total is 51.
so now let's sum the X^2 columns, and
we will calculate the sum of X^2 Total.
The total sum of X^2 is 187.
I may be going a little quickly through this example knowing that you can pause at any point.
We will need the n for each group.
Each of the groups comprised 5 munchkins, so of course the total of those 4 groups would be
24. The next step
we square each sum of X in the red row and divide by n in the white row.
This is the sum of X Quantity^2.
Divided by n and it represents a variance number.
Do this separately for each group. Now this is a number that
we're going to use in the next step to calculate variance, so we might as well call it what my mentor Doc Fox called it
"variance units." Now these variance units are going to be used in a formula for variance, and
again, we will total these variance units. The sum is 1607.8.
And while we're at it, we might as well get some means. We're going to need those later.
You will recognize this formula for the mean as sum of X in the red row,
and in the white row, no need to sum these means.
Well, we are now ready to calculate the variance, so that we can analyze it. Let's take each of these values in this farthest right
column and bring them with us to the next slide, so that we can use them in formulas to calculate the F ratio.
So there they are. We're going to use those in a moment.
We are going to analyze variance so we need to have a formula for variance.
Remember that the variance
we are using is called the
Mean Square. Think of the average, the mean, of the sum of squares mean square, and
the formula for variance is the sum of squares, SS
divided by
Degrees of Freedom.
Let's begin calculating the sum of squares between.
We need the total variance units in the tan, and the
sum of x total in the red and n.
Plug in those values. Calculate, and the total is 37.75.
Well, we now need the degrees of freedom between so that
we can divide. We've already figured out the degrees of freedom between, its K minus 1, where K is the number of categories.
So 4 regions minus 1 is 3.
Therefore, the mean square, or the variance between, is 12.58
Good. Now, We just need to do the same thing to figure out our variance within.
The sum of squares within uses the sum of X^2 Total in the blue, and
subtract the total variance units in the tan.
Plug in these values.
Calculate. The answer is 19.20,
and so next we need the degrees of freedom within.
We've already calculated this as
well, it's n - K, where n is our total number of participants and K is our total number of categories.
20 munchkins, 4 regions, the total is 16.
Therefore, the mean square, or variance within, Is 1.20
Now that we have all of the numbers that, we need it's time to plug them Into an ANOVA Summary Table and
calculate our F ratio.
So here is how we Would fill out our ANOVA summary table. First, we compute the degrees of freedom between,
within, and total.
With four Regions and twenty munchkins, the degrees of freedom between is K minus 1, or 3.
The degrees of freedom within is n minus K.
20-4, or 16.
And the degrees of freedom total, n minus 1 is 19, and
again you can get to your degrees of freedom total by adding your degrees of freedom between to the degrees of freedom within.
The sum of squares values come from our previous calculations on the last slide.
The sum of squares between that we calculated was 37.75.
We calculated the sum of squares within as
19.20
The total sum of squares is 56.95,
which you can arrive at by adding the sum of squares between and the sum of squares within.
So now we need the MS, the mean square, or the average of the sum of squares
to fill in the Mean Square column. You
would divide the sum of squares in each row by its degrees of freedom so therefore the mean square between would be
37.75 divided by 3.
12.58
The mean square within Is 19.20 divided by 16 or
1.20.
And so now we are ready to calculate the F ratio.
Remember the F ratio is the variance between.
The variance within the variance term Is the mean square.
The variance in wicked witch complaints between regions is a function of the region, which
we will call a treatment effect plus
random chance, and
the variability within each region is just due to random chance.
By dividing the two variances, we are
cancelling out the chance term leaving us just with the treatment effect
How much more of the variability in complaints, was due to living in a certain region?
The F ratio is the mean square between
the mean square within, in this case 12.58
divided by 1.20 is
10.49
That means that there Is
10.4 times more variability between groups than there is within groups.
Remember that our critical value Is
3.24
Because the F of 10.49
exceeds the critical value of 3.24, this F ratio is statistically
significant. this tells us that there is a significant difference between the four regions in number of complaints about
wicked witches.
Now that we know that the means of the regions differ, we next want to know which
regions differ from which other regions, and
we need a
post-hoc test to tell us which regions were statistically
different from which other regions on wicked witch complaints, and for that
we will learn to use a Tukey's Honestly Significant Difference post-hoc test.