(upbeat music)
- Hello, I am Professor Rick Jerz
and I welcome you to this topic titled two sample test.
This topic most commonly follows one sample test
of hypotheses, so you might want to review
the one sample test methods as background.
In this session, we will learn how to test
if the means from two independent samples are the same,
and we will also test that the means
from two dependent samples are the same.
Some of these tests also require that we know
whether the sample variances are the same.
So I will include testing variances in this session.
I should mention that some textbook authors include
test of variances in different chapters
and extend this topic a little more broadly,
but I find it is best to cover what is needed now
to support the testing of means.
The need to compare two samples happens a lot in life,
so I think that you will use this analysis
frequently, and you will enjoy it too.
Let's get started.
Our goals are to conduct a test of hypothesis
that two independent population means are equal
and to conduct a test of hypothesis about
the mean population difference between
paired or dependent observations.
Here are some examples.
Is there a difference in the average value
of residential real estate sold by male agents
and female agents in south Florida?
Is there a difference in the mean number
of defects produced by the first shift
and the second shifts at Kimble Products?
Is there a difference in the mean number
of days absent between workers under 21 years old
and workers older than 60 years
old in the fast-food industry?
Is there an increase in the production rate
if music is piped into the production area?
These examples all involve taking two
samples and comparing their means.
There are four scenarios that
we will look at in this session.
The first group of scenarios
involve two independent samples.
The first case is where the population
standard deviations are known and equal.
The second case is where the population
standard deviations are not known but equal,
and the third case is where population
standard deviations are not known and not equal.
The last scenario involves two dependent samples,
and we question whether these samples are different.
There are three formats for our hypotheses
for comparing two independent population means.
We can compare whether or not the two means are equal,
if one mean is greater than or equal to
the other, or less than or equal to.
The most common comparison is whether or not they are equal.
The most common hypothesis for comparing two dependent
populations is that the difference
between these populations is zero.
Let's first focus our attention on independent samples.
For independent samples, the values that we collect
in the first sample are not related
to the values in the second sample.
When we compare independent samples,
there are a couple possibilities that might occur.
The first is whether the population variances are known.
The second is whether the population variances are unknown.
If they are unknown, there are two more scenarios.
Are the variances equal or unequal?
There are actually two statistical
methods that might be used.
I call these the historical method and the modern method.
For the historical method, we compute a special test
statistic, either a Z or T statistic.
We then compare it to the test statistic
of the desired confidence level, or alpha.
Under the modern method, we compute the P-value,
which is the probability, and compare this to
the minimum acceptable error, alpha.
If the P-value is smaller than alpha,
there is a difference, meaning that we reject
the null that they are the same.
Reviewing thee possible scenarios once again,
if the population variances are
known, we use the Z statistic.
If the population variances are unknown,
we use the T statistic, but before we use this T statistic,
we have to test whether or not the
variances are equal or not equal.
Said a little differently, if the population variances
are known, then use the normal distribution.
If the population variances are unknown,
use the student-T distribution.
You might recall this logic is identical
to what we had to do when we analyzed a single sample.
For a single sample, we had to decide whether or not
we were going to use the normal distribution
or the student-T distribution.
We see the same logic being applied when we want
to compare two samples with a subtle difference.
Since we are comparing two samples,
we have this added test of whether or not
the sample variances are the same.
This Powerpoint shows the equations
to calculate these Z or T statistics
under these three different scenarios.
If you stare at these equations for a moment,
you might notice that they look fairly similar.
However, they do vary in the way that we
calculate the variances and the degrees of freedom.
Trying to keep this logic of which equations apply
to which situations and how to do some of these
calculations by hand can really be difficult.
One common approach to performing these tests
is to use Microsoft Excel's data analysis tool pack.
Even Microsoft and this tool pack has recognized
that we have to handle these four
different two sample scenarios.
My approach is to build my own Excel model
that can handle these four different
scenarios all within the same model.
Case two and case three involve
situations with unknown variances.
When you don't know whether or not the variances
are equal or unequal, you have to test to see if they are.
Some authors will skip this test and just tell you
in the problem whether or not the
variances are or are not equal.
I prefer to show you how to do these tests
of variances so that we can correctly compare the means.
We saw just a little earlier that in order to test
for two sample means being equal,
we approach this by calculating
some special T or Z statistics,
but how would we test for equal variances?
The statisticians have developed an approach
and it's actually quite simple.
Consider this.
If we have two samples and two variances
and the variances were identical,
if we were to divide one variance by the other,
we would end up with the value one.
The more that the two sample variances are not equal,
dividing one by the other will
get us away from the value one.
If we took many, many samples of these two populations
and did the division and plotted them,
what would that distribution look like?
Well, the statisticians have explored this, mapped it out,
and they ended up with a new distribution
that is labeled the F distribution.
Let's take a look at this.
Here are some characteristics of the F distribution.
There is a family of F distributions.
Each member of the family is determined by two parameters,
the numerator degrees of freedom
and the denominator degrees of freedom.
F cannot be negative and it is a continuous distribution.
The F distribution is positively skewed
and its value ranges from zero to infinity.
As F approached infinity, the curve approaches the X-axis.
The F test involves the ratio of the sample variances.
If the variances are equal, this ratio should be nearly
unity, meaning F should be approximately equal to one.
If the F statistic is far below one or above one,
we would reject that hypothesis
of equal population variances,
meaning that they are not equal.
The F statistic is sensitive to non-normality
of the sampled populations, so it assumes that
the populations being sampled are normal.
The best way to understand the comparison
of two sample populations is to do some problems.
I will provide an Excel model for this purpose
and show you how to do this in our next session.
The last scenario that we still need to talk about
is that one for dependent samples.
Sometimes this is referred to as paired or matched samples.
Sometimes it is difficult to know if
you do have dependent samples.
Dependent samples typically occur
in two kinds of situations.
One is when you have one set of objects
that are subjected to two conditions.
These are sometimes referred to as before and after studies.
As an example, you might want to evaluate
a group of students to see how they did on the SAT exam
before and after studying, and another situation's
when we have one set of objects that
are evaluated by two different groups.
How did the two samples compare?
Are they matched or equal?
As an example, we might want to compare
the results of men and women on a standardized exam.
The exam questions are the same.
We're just trying to see if there are any differences
between men and women given the set of questions.
One characteristic of dependent sample tests
is that you always have the same count
of observations for each sample.
When we have dependent samples,
the most common form of the null hypothesis
is that the samples are the same.
We can say this a little bit differently
that if we took the difference between the two samples,
there would be no difference, or zero difference.
In my next session, I will demonstrate the differences
between these different four scenarios
by working some problems and doing
the calculations with my Excel model.
I will be providing you one model
to handle these four scenarios.
My model uses Excel's functions,
not the data analysis tool pack.
It captures the scenario logic
and it handles both one-tail and two-tail tests.
The advantage of my model is that the analysis
updates immediately whenever any data values change.
This provides you the ability to do sensitivity,
or what-if analysis, to better appreciate the results.
(relaxed music)
Thanks for taking time to spend some moments with me.
I hope you have enjoyed what I have shared with you.
If you ever have any questions
or need my help, please let me know.
(relaxed music)