- [Instructor] In this Screencast,
I'm going to introduce you
to a new distribution, the F distribution,
and I'm gonna show you how we can use the F distribution
to perform hypothesis tests related
to the comparison of two population variances.
From previously when we were talking
about comparison of means, we had to make the assumption
that the population variances were
either equal or not equal.
For example, we work through this natural gas example.
We determined the standard deviations to be 5.2 and 4.1
and we just assumed that those are pretty similar,
we assumed the variance equal case.
But now you're gonna learn how you can show statistically
that the variances
of the methane concentration are equal or unequal.
Again, recall that we had to make the assumption
that the variances were equal or not equal
and that guided us to which test statistics
to use in the comparison of means scheme.
In order to compare variances of two populations,
we use the F distribution.
The random variable F is defined
as the ratio of two independent Chi squared variables,
each divided by its degrees of freedom.
Here, W and Y are both Chi squared random variables
and U and new are the numerator
and denominator degrees of freedom respectively.
The associated probability density function
of the F distribution is shown here.
It's quite complicated and again,
like the other probability density functions
that I've shown, it's not important that you memorize
or can use this as written because there are Excel functions
and tables out there that give you the data related
to the F distribution.
The F distribution has an asymmetric shape.
Here we have one example.
I've also got this file on the course website
where we can change the numerator degrees
of freedom, U, and the denominator degrees of freedom,
that's what the F distribution primarily depends upon
and you see that if we change those degrees
of freedom in the numerator versus the denominator,
we can change the shape of the F distribution a little bit.
The F distribution doesn't change too much
but it does change a little bit
and it's always quite asymmetric.
Just like the other probability density functions
we've been working with, we can denote a point
on the abscissa that corresponds to the area
to the right when we have that in a subscript.
So here, if this is the F distribution,
F of alpha with U numerator degrees of freedom
and new denominator degrees of freedom, we can denote
that as F alpha U, new and that has alpha to the right.
If we wanted to denote the F value having alpha to the left
that's F of one minus alpha with U,
numerator degrees of freedom
and new denominator degrees of freedom.
And just because of the nature
of the mathematics behind the F distribution,
this is also equal to one over F alpha of new, U.
You notice here that we have switched the order
of the numerator and denominator degrees of freedom.
This used to be quite useful
because tables in the back of your book
and elsewhere would only publish small values of alpha.
In other words, they wouldn't publish F of one minus alpha.
If we take a look at your book, table six in the appendix A,
you see that there's different tables depending
upon what alpha is.
So here we have alpha equal 0.05.
The next page is 0.025 and then 0.01
but we never have left tail distributions, for example,
F of 0.99 with new one and new two degrees of freedom.
New one and new two, by the way, corresponds to U and new
that I'm using in my terminology in my PowerPoint slide.
By the way,
there are Excel functions that do this, F.DIST,
this gives the cumulative probability.
F.INV gives the F value
for a given cumulative probability P.
And so we can easily use Excel
to determine these percentage points
of the F distribution
and they depend upon two degrees of freedom,
the numerator and denominator degrees of freedom.
So how do we use this
for hypothesis tests when we want to compare variances?
Well, the ratio of sample variances,
sample variances follow Chi squared distributions,
so an F distribution we can set up as follows
where the samples have to be both normally distributed.
The random variable F is described by an F distribution
with N one minus one numerator degrees of freedom
and N two minus one denominator degrees of freedom.
Typically, the null hypothesis is
that the variances are equal.
If that's the case,
and the variances are equal, then these basically cancel
and our test statistic is just the ratio
of the sample variances
and then we can perform a hypothesis test on this.
For example, if our alternate hypothesis is
that the variance of population one is greater
than that of population two, this is an upper tail test
and in order to accept the alternate
and show that the variances are not equal,
we can compare our test statistic to F alpha N one minus one
numerator degrees of freedom
and N two minus one denominator degrees of freedom.
And the rejection criteria
for the null hypothesis, acceptance criteria
for the alternate are similar to what we've done previously.
We can calculate for a two-tailed test
in order to accept the alternate,
the test statistic has to be greater than F alpha
over two or less than F of one minus alpha over two.
And again, note that we can always compute F
of one minus alpha over two
by the reciprocal relationship
where we're switching the order of the degrees of freedom.
For an upper tail test,
our test statistic has to be greater than F sub alpha
and for a lower tail test, our test statistic has
to be less than F of one minus alpha or equivalently,
we can use the reciprocal relationship
and our test statistic has to be less than one divided
by F of alpha and we've switched the order
of the degrees of freedom there.
So let's revisit our example.
We're gonna be doing an upper tail test
because our sample standard deviations
suggest an upper tailed test
and we're gonna calculate a P value for this test.
First we need to calculate a test statistic.
That's just the ratio of the sample variances,
S one squared divided by S two squared.
So the ratio of our sample variances here is 1.58.
That's our test statistic.
And now what we need to do for an upper tailed test,
we're comparing to F of alpha
with six degrees of freedom in the numerator
and four degrees of freedom in the denominator.
So we can compare this to the F alpha F.INV,
this is going to be a right tailed function.
We're going to put 5% into the right tail, numerator degrees
of freedom is N one minus one.
Denominator degrees of freedom, N two minus one
and that's 6.16.
We would have to exceed that value, that critical value
of F sub alpha that has 5% to the right of it
but we are not exceeding that
and so our conclusion is that we cannot accept
the alternate hypothesis and we fail to reject the null.
And so in this case we would assume
that the variances are equal.
Now let me show you how we can use the data analysis tool.
If you go into data, data analysis, and you select F test,
two sample for variances, we can click okay,
it asks us to input our variable one range,
so that's our source one.
Our source two is that.
Our alpha is 0.05, and let's just put this
onto the spreadsheet over here.
I'm just gonna select in cell H8 and we run that,
make this a little bit bigger
and we see that the test statistic that we got
is what that tool got,
the two sample for variances data analysis tool obtained.
We also get the critical one tail F value here, 6.16
and let's real quick calculate a P value
so we can use the F.DIST,
this is a right tailed test because this is an upper tail.
Our test statistic of 1.58, we had N one minus one
numerator degrees of freedom,
N two minus one denominator degrees of freedom.
And when we press enter, we're getting a P value
of .342 which is what that tool gave us as well.
Our conclusion then is
that we cannot accept the alternate and we assume
that the variances are equal
and that's what we would use then if we go back
to the comparison of means scheme,
we would use the variance equal case.
Hopefully this screencast gives you a better idea
of the F distribution and how we can use the F distribution
to compare variances of two populations.