>> Here's a quick tutorial on hypothesis testing and we're going to learn two different ways
to do hypothesis testing in this class.
We're going to learn the classical method and the P value method.
So I'll do examples of both here.
I'm not going to talk you through all the subtleties of what's going on, I'll kind of
just illustrate an example to give you an idea to reinforce some of the topics that
we'll learn in class.
We're going to do lots of different hypothesis testing.
We're going first do Z testing which is quantitative data when sigma is known, and then later,
we'll see the same idea in different settings.
Okay.
So the idea when you're doing hypothesis testing maybe the first thing you want to do is go
through, read the problem, and pull out the important information.
So in this case, it says suppose we know that the average baseball player hits 25 home runs
with the standard deviation of 10.
Okay.
We're talking about all baseball players here.
We're talking about population values.
The population average is 25 and the population standard deviation is 10.
For population standard deviation, we've been using this symbol sigma and we will continue
do so.
For the population average, we've been using the symbol mu, however, we want to use the
symbol mu for something else in this problem, so we're going to create a new symbol mu not
with the little zero next to it, and that's what we will use for our population values.
Then we have a sample of 50 players that we're talking about here.
As we've been doing, we'll use the letter N to represent the number of observations
in our sample.
And for those 50 players, on average, 29 home runs were hit.
The sample average is 29.
As we've been doing, we'll use X bar to represent that.
And then what we want to do is test the claim that HGH increases home runs and we want to
have 95 percent confidence.
You may recall that alpha is 1 minus our level of confidence.
Alpha will be something that's important in these problems, so I'm going to go ahead and
write out that alpha is equal to 0.5 in this case.
And then one more symbol, I don't know if you need to write this out every time, but
it might be helpful, is mu.
I said we're saving mu for something different.
What mu is going to represent in this problem is a population average.
[ Pause ]
But it's not the same as this one.
So this was the population average of all baseball players.
This is the population average of all players if they're on HGH.
So all players on HGH.
The idea there is this is the thing that we want to compare to the 25.
Yeah, we know that our sample value is greater than 25, but the question is, is the population
value greater than 25?
A sample could be greater than 25.
I mean, in this case, it's 29 just out of damn luck, could just be better hitters out
of these 50 players.
But if the population average of all players on HGH is higher than the population average
of all players, then we know that HGH is increasing home runs.
All right.
So what you do in these problems is you're always going to, first, state your null and
alternative hypotheses.
For the null hypothesis, we'll use H0 or H-naught is the way you say it, and you alternative
hypothesis down here is H1.
Your alternative hypothesis is what your claim is.
And so sometimes it's easier to start with your alternative hypothesis.
In this case, we claim that HGH increases home runs.
So to write that in terms of formulas, we're saying that this thing, the population average
of all players on HGH, is greater than the population average of all players, that mu
is greater than mu-naught.
In other words, mu is greater than 25.
If I said test the claim that HGH decreases home runs, then this would be mu is less than
25.
But whether it's greater than or less than, it's a one-tailed example.
If it's greater than, it's a right-tailed.
I'll go and even write that here.
If it were less than, if I said test the claim that HGH decreases home runs, it will be left-tailed.
And down here, we'll see something completely different word, it's two-tailed.
You know hypothesis, so you know hypothesis is kind of saying that a minute away is that
your claim is wrong, but it's not quite that because if they were just that your claim
is wrong, we put that mu is less than or equal to 25, but that's not what we want, we want
that mu is equal to 25.
What you'll see is your null hypothesis will always have equality here.
What your null hypothesis is saying is HGH doesn't matter one way or another, that mu
equals 25, that the population average of all players on HGH is just the same as the
population average of all players, makes no difference if you take an HGH.
All right.
Once you stated your null and alternative hypotheses, in order to make this similar
to our other problems, we're going to state--shape the center and the spread of our distribution.
And the nice thing is this will be pretty similar to what we've seen in prior problems.
For the shape of our distribution, just like in every single example we've had in this
class, it will be approximately normal, which we always want to say why it's approximately
normal, in this case, it's approximately normal because N is greater than or equal to 30.
Our cutoff for putting--for using the central limit theorem in our focus that N is greater
than or equal to 30, we have a value of N of 50, cool, it's approximately normal.
I'm going to draw my picture.
I'm going to draw it approximately normal.
Go ahead and draw my picture over here, why not?
I'm going to draw my distribution.
It's pretty good one.
I'm going to try to make it approximately normal.
Center, center of our distribution is mu-naught which is equal to 25.
The idea there is really our center is mu, but we don't know mu.
So what we're going to do is we're going to assume that our null hypothesis is correct.
We're going to assume that mu is equal to 25.
We're going to assume that this thing is 25, and then we're going to figure out how unlikely
would it be to get this kind of a sample if mu really were 25.
And then our spread, something we've seen before.
Spread of the sampling distribution, it's sigma divided by the square root of N. Sigma
in this case is 10, and in this case is 50.
And if you do 10 over root of 50, you got 1.4 something.
10 divided by square root of 50, we get 1.41, we'll call it something like that.
Shape center spread.
All right.
Now, we're going to go over here and draw our picture.
Picture is going to be a little different.
One thing that will be different about it is we're going to have both X values and Z
values.
So what I'm going to do here is I'm going to draw my X values on this line, and then
below it, I'm going to put my Z values.
So, put one of them in parentheses if you want.
You could say X equals and Z equals, or you could write it just like this and we'll see
what it means.
And then what we want to do is create what's called a critical region.
I like to call it a rejection region, but your book uses the word critical region.
And so the way you do that is you look up at alpha and alpha equals 0.5, alpha is always
the total area--
[ Pause ]
--of our rejection region, or regions of our rejection.
[ Pause ]
So in this case, there's just one region, but what we'll see in the next examples, there
could be more than one region and we'll talk through that.
And alpha is always the total area of it.
And in this case, since we're doing a right-tailed test, we want our rejection region to be on
the right.
In other words, I want to draw something over here, we'll shade in this area, and I want
that shaded in area on the right side to be 5 percent or this value right here, 3.05.
Okay.
So I guess we should figure out what that value is, your calculator has a function that
will figure out what that value is.
You can figure out the X value or the Z value for that.
Really, what we'll use is the Z value, that will be what's most important, although you
can figure them both out on your calculator and the way you figure them out is under this
distribution menu if you go to secant variables and then if you go to inverse norm.
What inverse norm does as a function is it takes in the area below the point in question.
So if I'm trying to find this point right here at the area below that point which in
this case is 0.95.
Then since I want the Z value, I'm going to put 0 and 1 in for my center and my spread,
and I'm going to get 1.645 down here.
You could also figure out this value if you wanted to, although, you don't have to figure
out this value here.
So there were go, the critical value, the value on the edge of our critical region or
our rejection region is 1.645 in this case.
All right.
So, this picture will work.
We only need one more thing.
We just need to know what our test statistic is, and what our test statistic is, is it's
kind of saying, "Where does this 29 fall in this picture right here?
Where is 29?"
We can figure out where 29 is in our picture using our calculators.
And so if you hit stat and then go over to tests and then do a Z test, the first one,
it will ask you for all the information.
It will first ask you if you have data or statistics.
In this case, we don't have the amount of home runs hit by player, we just have statistics
about those.
It asks you for a bunch of stuff that we have, mu-naught, it's nice that it uses the same
symbol we used, it's 25.
Sigma, again, it uses the same symbol we used, it's 10.
Be careful about putting in 1.41, it doesn't want to know sigma sub X bar, it wants to
know no sigma which is 10.
X bar, we figured out that was 29.
N, we figured out that was 50 or it was given that was 50.
And now here, what it's asking you for is your alterative hypothesis.
It's saying, "Is mu not equal to mu-naught?
Is mu greater than mu-naught?
Or is mu less than mu-naught?"
So not equal to, less than, greater than.
In our case, it's this one, it's that mu is greater than mu-naught because mu-naught is
the 25.
So our alternative hypothesis is this third one here.
So you highlight that and then you calculate.
And what it will do is give you some information.
The most important piece of information in here for classical hypothesis testing is this
Z value here.
And what that Z value does is it tells you where these 29 home runs is on our picture.
In other words, 29 home runs is way the hell out here in a Z score of 2.83.
So what that's saying is--so maybe I'll go ahead and draw my conclusion.
What's important to figure out is whether the Z score is in the rejection region or
not in the rejection region, but because 2.83 is greater than 1.645, it's in the rejection
region here.
So then our conclusion will be because--let's try that again.
Because our test statistic--
[ Pause ]
--of 2.83 is in the rejection region--
[ Pause ]
--there is sufficient evidence--
[ Pause ]
--to reject the null hypothesis and conclude
that HGH--and conclude basically that our claim is correct, that HGH increases home
runs.
[ Pause ]
This might seem like a lot to remember but it will turn out there's really only two conclusions
we can draw.
If the test statistic is in the rejection region, we reject the null hypothesis and
therefore conclude that the alternative hypothesis is right.
And if the test statistic is not in the rejection region, we just say there wasn't not enough
evidence to reject the null hypothesis, and that's it.
We don't conclude that HGH doesn't increase home runs, we just say there wasn't enough
evidence to conclude that it did increase home runs.
But in this case, the test statistic was in the rejection region as this picture illustrates,
so we conclude that there is sufficient evidence to conclude, with 95 percent confidence, that
HGH increases home runs.
Whew!
I guess that's the end.
I'm going to stop this vide and make a new one to show the P value hypothesis testings
because I don't want this to get too long.
So I'll make another video showing you how do this P value.
In this case, we'll have the two-tailed example, so that will show a slightly different picture
and illustrate a few more of these ideas.