We finally reached the end of our hypothesis testing procedure.
And now we're going to go through the last few steps where we get to determine whether or not our result
is significant enough to lend support to our alternative hypothesis.
So to pick up where we left off, we started out the hypothesis testing procedure by stating null and
alternative hypotheses.
And along with that we chose a confidence level and therefore an associated alpha value.
And we decided whether we wanted to run a one tailed test or a two tailed test.
And then in the last lecture we learned how to calculate our test statistic and we calculated this t
score because we always need to use a t test when population standard deviation is unknown.
Once we have our T score or our t test statistic in hand, we need to determine whether or not that
score is significant enough to reject the null hypothesis, and we can determine that significance in
one of two ways.
We can do it by looking at the p value, or we can do it by looking at the critical value.
So we have two options here.
If we use this p value method, then we're going to follow just three steps here.
So we're going to locate the T score our T test statistic in the T table, and we'll do that by navigating
to the appropriate row based on degrees of freedom and then scanning across the row until we locate
the T score.
Once we find the cell in the T table where we're positioning ourselves, we'll look at the corresponding
upper tail probability at the top of the t table.
And then based on the kind of test that we're running, we'll use that upper tail probability to determine
p value and then we'll compare that p value to the alpha value that we set out at the beginning when
we picked a confidence level.
And we'll go through these steps in detail with an example.
Otherwise, if we use the critical value approach, then we're following just two steps.
This time we use our degrees of freedom, remember, based on sample size and the confidence level to
locate a critical value in the body of the T table.
And then we compare that critical value to the absolute value of the T score or the T test statistic
that we calculated earlier.
And then based on what we find, here are the important conclusions that we can make.
If we use the p value approach, then if P is less than or equal to alpha, we reject the null hypothesis
and therefore lend support to the alternative hypothesis.
If we use the critical value approach, if the absolute value of t our t score we calculated when we
found the test statistic, if the absolute value of T is greater than the critical value that we get
from the body of the T table, then we reject the null hypothesis and therefore lend support to the
alternative hypothesis.
So that's a lot to take in.
It'll be much easier to understand if we go through an example.
So let's pull up here a T table and I've consolidated this table.
So we're just showing the rows four, 18, 19 and 20 degrees of freedom instead of looking at the entire
t table, because we're going to go through an example here where we choose a confidence level of 95%,
therefore an alpha value of 5% or 0.05, and we'll run a two tailed test.
And more specifically, we're going to say that we use a 20% sample or that our sample size is 20.
So because our sample size is 20, remember then that degrees of freedom is always the sample size minus
one.
In our case, that's 20 minus one or 19.
So that's why we're just looking at this section of the T table, because we're going to be looking
at this second row here where we have 19 degrees of freedom.
So to go back to the beginning here, what we're saying is that we are running a two tailed test.
We decided to run a two tailed test because we're not sure about the directionality of our hypothesis
statements, which means by definition, that the null hypothesis has to be that the population mean
is equal to our hypothesized value.
And we're going to say that the hypothesized value here is 14.
That means that our alternative hypothesis is that the population mean is not equal to 14.
In the last few lectures we've been using this hypothesized value where we say that we're running the
shipping department in a warehouse and we're investigating whether mean order processing time is 14
hours.
Let's say that the assumption is that mean order processing time is 14 hours.
We're going to run a two tailed test to investigate our alternative hypothesis here.
That mean order processing time is not 14 hours.
So we have these hypothesis statements.
We can see from the hypothesis statements that we're running a two tailed test because of the fact that
we have the equal sign and the not equal to sign.
Otherwise, if the alternative hypothesis was mu greater than 14 or MU less than 14, then that would
indicate a directional test and therefore a one tailed test.
But we have these hypothesis statements.
We're running a two tailed test.
We've chosen a confidence level of 95%.
That means that the alpha value is 100%, -95% or 5%.
We can also call that alpha value 0.05 if we convert to decimal form there.
And we're saying that we have taken a sample of 20 orders in our warehouse, we computed a sample mean
of 14.4 5 hours with a sample standard deviation of one hour.
And so our next step then is to calculate the t test statistic.
And so we have our formula.
We looked at this in the last lecture.
If we plug in everything that we have here, the sample mean we said was 14.4 5 hours.
We subtract the hypothesized value 14 hours, and then we divide that by sample standard deviation,
which is one hour divided by the square root of the sample size.
And in our case, the sample size here is 20 orders.
Now, if we use a calculator to find this value, we get a t test statistic of approximately 2.012 when
we round to three decimal places.
So at this point we have taken care of all three of these steps here.
And the whole first part of our hypothesis testing procedure.
And now we need to either use the p value approach or the critical value approach to make a conclusion
about whether or not this t score is significant enough to allow us to reject the null hypothesis.
So let's look at the p value approach.
If we use this approach, here's what we do.
Once we have our test statistic, we locate this test statistic in our t table and we do that based
on degrees of freedom.
So in this case, with a sample size of 20 degrees of freedom is 20 minus one or 19.
So we go to the row where we find 19 degrees of freedom and then we start moving our way across the
row looking for 2.012.
Now, keep in mind that it's very, very unlikely that we'll find exactly this value for the T score
that we calculated.
Almost certainly we'll find a T value here that lies in between two of the values in the table.
So looking across this 19 degrees of Freedom Row, we see that this score right here lies in between
these two values.
It's in between 1.729 and 2.093.
So since we're in between these two values and our next step is to locate the corresponding upper tail
probability, we want to look at the upper tail probability associated with both of these values, the
value to the left and right of the approximate location of our T score.
So if we go up to the top of our T table, we can see the upper tail probabilities associated with those
two values here.
0.05 and 0.025.
Now, usually what we'll do at this point, because we know that our T score is somewhere in between
these two values, we'll pick some value in between these two upper tail probability values, some value
between 0.05 and 0.025.
So let's just say for the sake of argument that we split the difference equally.
In other words, we take the halfway point between 0.05 and 0.025.
Well, the value exactly halfway between these two is 0.0375.
Now, once we found this value here, if we are running a two tailed test, which is what we're doing
here, we need to multiply this value by two.
So we would take two times 0.0375 and we get 0.075.
And this then is the P value.
The P value is equal to 0.075.
Now here's the reason that we multiply that value by two.
When you hear p value think probability value.
The value of P is essentially giving us the probability of rejecting the null hypothesis.
Or another way to put that would be the probability of falling within the region of rejection.
And another way to put that would be that it represents the amount of area under the distribution that
makes up the region of rejection.
And that's normally what we imagine Alpha to be, which means that if we get a P value that is smaller
than the alpha value, it means that we're going to fall within the region of rejection and therefore
that we can reject the null hypothesis.
But if we get a p value that is larger than the alpha value, it means we're falling outside the region
of rejection and therefore that we won't be able to reject the null hypothesis, will fail to reject
it, which is why we can compare the p value directly to the alpha value.
We want to look at them in direct comparison and that's why we double this value that we found here
when we're running a two tailed test.
Because from the T table we just get an upper tail probability value.
And so this estimate here is an.
Estimate of the amount of area we'd find in the region of rejection in the upper tail.
But if we're running a two tailed test, we expect this same amount of area in the lower tail.
And so to find P for a two tailed test, we have to double this value to capture the full region of
rejection from both tails.
So for a two tailed test, we double this value that we find and then we compare that double value directly
to Alpha.
In this case, alpha is 0.05 and P is 0.075.
So within this particular set of circumstances, P is greater than alpha, which means that we'll fail
to reject the null we can't reject.
The null hypothesis.
If instead of using the p value approach, we use the critical value approach, then our first step
is to locate the critical value in our t table.
What that means is that we look up degrees of freedom and our confidence level.
So here for this example, we know we're at 19 degrees of freedom at a confidence level of 95%.
So we come to 19 degrees of freedom and move across until we see that confidence level of 95%.
And that puts us here at this critical value.
We call this the critical value when we find the intersection of those two things, 2.093.
So 2.093 is our critical value and we want to compare the absolute value of the T score that we calculated.
Remember that absolute value just means taking the positive version of whatever value we have.
So even if here we had calculated RT is -2.01 to the absolute value of -2.012 is just positive 2.01
to the absolute value of a positive number is itself.
So all this means here to take the absolute value of RT is if we come up with a negative value for t
taking the absolute value just removes that negative sign and turns the negative number into a positive
number.
Positive numbers stay the same.
So here we have a positive number.
Taking the absolute value means it stays the same.
So we're comparing positive 2.012 to the critical value of 2.093.
What we're showing here is that the absolute value of T is the absolute value of 2.012 compared to the
critical value of 2.093.
Well, that is less than 2.093.
And because our RT score is less than our critical value, we fail to reject.
We can't reject the null hypothesis.
We need our RT score, the absolute value of our RT score to be greater than the critical value in order
to reject the null hypothesis.
So then in this scenario, the conclusion of our hypothesis test is to say that based on the sample
values we calculated, the sample mean in sample standard deviation at a sample size of 20 orders and
to be 95% confident running a two tailed test.
We fail to reject the null hypothesis.
We can't reject the null, which means that we can't lend support to our alternative hypothesis.
There's no evidence here or there's not enough evidence in this result to support the idea that mean
order processing time is something other than 14 hours.
And that would then be the conclusion of this hypothesis test.
But let's look at what happens if we run a one tailed test instead of a two tailed test.
So we keep the same confidence level and therefore alpha value.
We want to be 95% confident, but instead this time we're running a one tailed test, which means therefore
that we have to change our hypothesis statements.
We'll say that we're going to hypothesize that mean order processing time is greater than 14 hours.
Therefore, the null hypothesis would need to say that mean order processing time is not greater than
meaning less than or equal to 14 hours.
So we change our hypothesis statements, but we still took a 20 order sample.
We found a sample mean of 14.4 5 hours, a sample standard deviation of one hour.
And of course, this is still our hypothesized value, which means we're going to compute the same t
score, the same T test statistic of 2.012.
Now let's go back to our P value approach.
But first, when we look here at our t table, we need to be careful because this t table is really
set up for two tailed tests.
If you can see here the confidence level across the bottom.
Let's take this 90% confidence level here.
That means the alpha value would be 10% for this confidence level, which means that if we're running
a two tailed test will have 5% of the alpha value, that 10% alpha value will be divided between 5%
in the lower tail and 5% in the upper tail.
And you see here the upper tail probability that corresponds to 90% is a 5% upper tail probability,
which means that this t table by design is representing a two tailed test because this upper tail probability,
if we match it up to the confidence level by definition is showing that upper tail probability for a
two tailed test.
So we need to be aware of that, that this row here, this confidence level row that's given to us by
default is for a two tailed test.
If we're running a one tailed test, notice that these confidence levels shift over one column to the
left while upper tail probability stays the same.
So for that same 90% confidence level that was here, if we have a two tailed test, we know that that
10% alpha value gets divided into 5% in the lower tail and 5% in the upper tail, which we see right
there, but for a one tailed test.
That means the entire 10% alpha value is going to be put into one tail alone.
So we shift these confidence levels over one column to the left so that this confidence level of 90%
corresponds to the upper tail probability of 10%, because the entire 10% alpha value that's associated
with this 90% confidence level is pushed into one tail.
So we need to see 90% confidence with 10% alpha in a one tailed test versus 90% confidence with 5% alpha
in a two tailed test, which means then that if we're going to use this p value approach and follow
these steps again, if we again locate our T score in the T table.
So we calculated a T score of 2.012 and based on the degrees of freedom of 19, we locate that spot
in this row.
And again, just like before we find this spot right here in between 1.729 and 2.093, we locate the
corresponding upper tail probability.
So we come up here to the top because we're in between these two values.
Where in between these two upper tail probability values, 0.05 and 0.025.
So if we then pick a value that's exactly halfway between those two, we pick 0.0375.
That's exactly halfway between 0.05 and 0.025.
But because we're only running a one tailed test, we do not double this value like we did before when
we were running a two tailed test.
Now we keep the p value as just 0.0375.
So this time we get P equals 0.0375.
We compare that to our alpha value of 5% or 0.05.
And we see here in this case that P is less than alpha.
And based on that finding, we reject the null hypothesis.
So this is here the two tailed.
Scenario, and this is the one tailed scenario.
So in the one tailed scenario based on the p value approach, we're able to reject the null.
What about using the critical value approach with a one tailed test?
Well, here we again locate the critical value in the T table based on degrees of freedom and confidence
level.
So four degrees of freedom 19 and a confidence level of 95% using our one tailed test row for confidence
level.
So 19 degrees of freedom over to 95% confidence.
And we arrive here at 1.7 to 9.
So our critical value this time, remember last time it was 2.093, Now it is 1.7.
Two nine and let's put this one here in white to indicate that it was part of our two tailed test.
So for the one tailed test, we get 1.7 to 9 is the critical value we need to compare now the absolute
value of 2.012.
So absolute value of 2.012.
And we need to compare that to the critical value of 1.729.
Well, in this case, 2.012 is greater than 1.729.
And because we get this greater than value, we can again reject the null hypothesis, which means that
if we run this as a one tailed test, then we are successful at rejecting the null and therefore successful
at lending support to the alternative hypothesis.
So in this case we would say that we've found evidence for the idea that mean order processing time
is longer than 14 hours.
The conclusion of this particular hypothesis test with this particular sample that we found supports
that result, supports that conclusion, that mean order processing time is more than 14 hours.
So under the exact same set of circumstances, we failed to reject the null for the two tailed tests
and succeeded at rejecting the null for a one tailed test.
Remember, all the way back at the beginning when we talked about hypothesis statements and one and
two tailed tests that we said that the two tailed test was more conservative and that we should only
use a one tailed test when we had some kind of data, some kind of evidence to give us a reasonable
belief about the directionality of the test.
And that's because with the entire region of rejection shifted into one tail of the distribution, it
makes it easier for us to clear that bar and move out of the region of acceptance and into the region
of rejection.
And we are more likely to reject the null with a one tailed test.
The two tailed test is more conservative, and if we don't have a good reason, some strong suspicion
to expect the directionality of the test, we should use the two tailed test since it is more conservative
and harder for us to reject the null hypothesis, it's usually better to run a two tailed test and fail
to reject the null or find no significance than it is to run a one tailed test and reject the null when
we actually shouldn't, especially if the stakes are high like we talked about before.
Especially if our hypothesis testing procedure relates to something like health and safety and we need
to be really, really sure of our results.
We want to bump up this confidence level as high as we can and make sure that we don't make a wrong
decision here, especially in a scenario like that one.
It's better to be more conservative and run this two tailed test unless we really, really have a good
reason to state a specific direction in our hypothesis statements and run a one tailed test.
But either way, that is the conclusion of the hypothesis testing procedure.
This is the process we'll follow over and over and over again in inferential statistics.
And it always ends this way where we calculate our test statistic and then we use either the p value
approach or the critical value approach to determine whether or not that statistic is significant enough
to allow us to reject the null hypothesis and therefore lend support to our alternative hypothesis.