So we've already covered the first two steps of the hypothesis testing procedure.
We've learned how to state null and alternative hypotheses as opposite statements.
And we talked in the last lecture about how to determine the level of significance or the alpha value
based on how important it is that we don't commit a type one error.
Now we want to talk about the third step, which is how to calculate the test statistic.
Now, regardless of what kind of test we're running and we'll talk a little bit more about that later
in this lecture.
The short answer here is that our test statistic formula is always given by this formula here.
So we're looking at the test statistic formula for a T score because we're assuming that population
standard deviation is unknown, which is almost always the case.
If we do happen to know population standard deviation, then we can calculate a Z score instead of a
T score, in which case the formula is exactly the same, except that we have Z equals instead of T
equals.
And instead of using sample standard deviation, we would use population standard deviation.
But again, since we almost never know, population standard deviation will assume here that we are
calculating a T score.
So you may recognize here that the values in this test statistic formula are the sample mean.
So the mean that we calculate from the sample that we take from our population and then this mu sub
zero value here or mu not is our hypothesized value.
So in the last lecture when we were talking about determining the level of significance, we gave these
hypothesis statements where we said that the alternative hypothesis was mu greater than 14, where we
said that we were hypothesizing that mean order processing time was longer than 14 hours, which means
that the alternative hypothesis is the opposite statement, which is that MU is less than or equal to
14.
That mean order processing time is less than or equal to 14 hours.
This value right here in our hypothesis statements, this is mu not it is our hypothesized value.
So we have sample mean, we have the hypothesized value and then here in the denominator you may recognize
the formula for standard error, the standard deviation of the sampling distribution of the sample mean
which is given by sample standard deviation divided by the square root of the sample size.
N So let's say here again that working with this set of hypothesis statements, again, the idea here
is that we are running a warehouse, a distribution center, we are shipping out orders and we're hypothesizing
here that mean order processing time is longer than 14 hours.
So from the time the customer places the order online to the time that we actually ship, the order
out of the warehouse is greater than 14 hours.
Let's say that we pull from our warehouse a simple random sample, and we use a sample size of 50 orders
and we calculate a sample mean of maybe we'll say 16.5 hours.
So for our 50 order sample, we found that the mean order processing time was 16 and a half hours.
We already said that our hypothesized value was 14.
And then let's say we also calculate it from that sample of 50 orders that we pulled a sample standard
deviation equal to, let's maybe say 1.5 hours.
So that's enough information to calculate the test statistic.
We would say that t is equal to our sample mean 16.5 minus the hypothesized value 14 divided by sample
standard deviation, which is 1.5 hours divided by square root of sample size.
We said that our sample size was and equals 50, so we divide by square root 50.
And if we use a calculator to find the value of this fraction, here we get an approximate T score of
about 11.79 and that's it.
That is the value of our test statistic and we are done with the third step of our hypothesis test.
But we still want to take this opportunity to talk about one extra factor in our hypothesis testing
procedure before we go forward, because we'll need this, which is the idea of a one tailed test versus
a two tailed test.
So if you remember from before, we talked about our null and alternative hypotheses and we said that
we had three options, we could use an equal sign in the null hypothesis, in which case the alternative
hypothesis has to have a not equal to sign or in the null we could have less than or equal to, in which
case the alternative has a greater than sign or the null has a greater than or equal to, in which case
the alternative has a less than sign.
These are our only three options when we state our null and alternative hypotheses.
Well, these three options correspond to one and two tailed tests.
So if we use this first option here where the null is.
An equal sign, and the alternative is a not equal to sign.
That means we're using a two tailed test, which we also sometimes call a non directional test or a
two sided test.
Those are three different ways of saying the same thing.
In contrast, if we use either the second or the third option, then we're conducting a one tailed test,
also called a directional test, also called a one sided test.
Now, previously when we talked about these three options, we said that this first option here, option
number one, was our most conservative option.
Using this option says that we don't really have an idea or a presupposition about the direction or
the directionality of our test.
We're not sure if we should use a greater than value or less than value in our alternative hypothesis.
We really don't have any preconceived idea about the direction.
But the reason in actuality that this is more conservative, we can see visually if we look at the normal
distribution here.
So we talked about this before too.
If we have our probability distribution, then we have our region of acceptance in the middle here that
is based on the confidence level percentage.
And if we're running a two tailed test or a non directional test, then we're going to have a region
of rejection over here in the lower tail and a region of rejection over here in the upper tail.
The amount of area under the curve in this lower tail region of rejection is alpha over two and the
amount of area in the upper tail is alpha over two.
Remember that alpha is given by one minus the confidence level.
So if we choose a confidence level of let's say 95%, then by definition the alpha value has to be 5%,
which means then that we would have 2.5% of all the area under the curve in this lower tail and 2.5%
of all the area under the curve in the upper tail.
So this lower tail region of rejection would make up two and one half percent of total area.
The upper tail region of rejection would make up two and one half percent of total area.
And then this whole region of acceptance in the middle would be 95% of the area.
Contrast that with a directional test in either direction where we have a one tailed test.
So if we have this situation here, this is situation number two.
So this is two and three, this is one and two.
And then while we're at it here, we'll say that this is scenario three.
So instead of two here, the alternative hypothesis states that we think the population mean is greater
than some hypothesized value.
And because we use this greater than value, that means we're using what we call an upper tailed test.
And the entire region of rejection is squeezed into this upper tail.
There is no other region of rejection down here in the lower tail.
So we just have the region of acceptance on the left and the region of rejection on the right.
Whereas if we state in our alternative hypothesis that we think the population mean is less than some
hypothesized value, so less than that means we're running a lower tailed test and it pushes the entire
region of rejection into the lower tail.
So we just have the singular region of rejection on the left and the region of acceptance on the right.
Now, going back here to this idea of the two tailed test being more conservative than either of the
one tailed directional tests.
The reason we say it's more conservative is because let's say that we have chosen a 95% confidence level,
like we said, and therefore an alpha value of 5%.
That means for a two tailed test, if we're running a two tailed test based on the fact that we have
stated null and alternative hypotheses with these equal and not equal to signs, if we're running a
two tailed test, then that means that this region of acceptance in the middle here is 95% of the area,
because that 95% area is centered around the mean.
It's symmetrical here in the middle of this distribution.
That means that the boundary here between this lower tail region of rejection and the region of acceptance
is here at 2.5% or at 0.0250.
That would be our Z score value if we were thinking about this in terms of Z scores.
And then the boundary here at the right edge of the region of acceptance and the lower edge of this
upper region of rejection, this boundary right here would be at a Z score of 97.5 or 0.9750.
We can see that two and one half percent over on the left, the two and one half percent over on the
right above 97.5 and the 95% in the middle between 97.5 and 2.5.
But if we run a one tailed or directional test, let's say we're running an upper tail test here and
we look at this boundary again with the same.
Its level of 95%.
That means that we have the entire 95% over here, which means that this Z score has to be associated
with 0.9500.
It is the Z score that gives 0.9500 in the body of the Z table.
So these are the Z scores that give 0.0250 and 0.9750 in the body of the Z table.
So that is the boundary value we'd be looking for.
And then similarly with this lower tail test, again, keeping our confidence level the same at 95%,
that means the entire alpha value, 5% has to get squeezed into this lower tail.
And so this boundary right here has to be associated with a Z score that gives 0.0500 in the body of
the Z table.
Now, what we see ultimately is that we are more likely to land in the region of acceptance with a two
tailed test.
It's going to be harder to reject the null hypothesis, harder to land within the region of rejection
if we're using a to tail test, because we can see here that with this two tailed test on this upper
side, we have to clear a bar of 0.975 in order to reject the null hypothesis.
Whereas here with the upper tail test we only have to clear a bar of 0.95.
In other words, our test statistic doesn't have to be as extreme when we run this upper tail test as
when we run this two tailed test.
And similarly here with the lower tail test, the test statistic does not need to be as extreme on the
low end in order to be to the left of 0.05, as it does to be to the left of 0.0 to 5.
So running a one tailed test makes it easier to reject the null hypothesis, which makes it easier to
lend support to our alternative hypothesis.
And so we've kind of lowered the bar, we've lowered the strictness of our test by running a one tail
test.
And that's why we said previously that it's super important that we have some idea, some evidence ahead
of time about the directionality of the test if we're going to move forward with one of these pairs
of hypothesis statements.
Otherwise, if we don't really have any evidence of directionality either way or we want to be more
conservative, we want to be safer and set the bar for ourselves as high as we can to make sure that
our conclusion is more rock solid, Then we should run a two tailed non directional test.
In other words, if we sort of line up these top two distributions here and we extend the boundary in
this second distribution between the region of acceptance and the region of rejection, we sort of pull
that up here into the first distribution.
Maybe that boundary is right around here.
If we extend that up, then what we're saying is that if we're running a two tailed test, we have to
find a test statistic that clears this boundary in order to reject the null hypothesis.
But if we were running a one tailed test only, we would need to find a test statistic that only clears
this bar, this boundary in order to reject the null.
And so any test statistics that we find between these two, any test statistics that fall within this
interval, we will fail to reject the null if we're running a two tailed test but succeed at rejecting
the null if we're running a one tailed test.
And so that's why we see that two tailed test as being more conservative with all of this out of the
way.
And now that we know how to calculate a test statistic, we can move on to the last couple of steps
of the hypothesis testing procedure, which will be determining whether or not this test statistic clears
one of these bars, these hurdles, and lands us in one of these regions of rejection instead of the
region of acceptance.
In other words, is our test statistic severe enough to land us within a region of rejection?
That's what we're going to look at next.
How to determine whether or not the test statistic shows us enough significance.
If it does, then we'll be landing within one of these regions of rejection, which will allow us to
reject the null hypothesis and lend support for our alternative hypothesis.
So now that we have this test statistic, we'll move on to determining these regions of acceptance and
rejection and looking at whether or not it'll be acceptable for us to reject the null hypothesis.