馃攳
Calculating Power and the Probability of a Type II Error (A One-Tailed Example) - YouTube
Channel: unknown
[2]
Let's look at an example of calculating power
[4]
and the probability of a type II error,
which we often called beta.
[7]
This example is done in the setting
of a one-sample Z test on a mean
[11]
but similar logic holds for other types of tests.
[16]
Suppose we are about to randomly sample
36 values from a normally distributed population,
[21]
where the population standard deviation sigma is known to be 21,
[25]
but the population mean mu is unknown.
[27]
And we wish to test the null hypothesis that the population mean is 50
[32]
against this one-sided alternative hypothesis
[35]
and we feel that a significance level of
0.09 is appropriate for our test.
[41]
Since we are sampling from a normally distributed population,
[45]
and the population standard deviation sigma is known
[49]
then the appropriate test statistic is
this Z test statistic.
[54]
If the null hypothesis is true, this Z test statistic
will have the standard normal distribution.
[59]
And the first question, is for what values
of Z will we reject the null hypothesis?
[68]
Here I've plotted out the standard normal curve.
[70]
Our alpha level is 0.09 and our
alternative hypothesis is that mu is less than 50,
[76]
so we're going to put the entire alpha
level in the left side of the distribution.
[82]
If we go to software or the standard normal table
[86]
we can find that the Z value with an
area of 0.09 to the left is, to 2 decimal places, -1.34.
[94]
And so we are going to reject the null hypothesis
[97]
If the Z value that we get in our
sample is less than or equal to -1.34.
[107]
Now we're going to reexpress the
rejection region in terms of the sample mean
[112]
because that's going to help with
our power calculations later on.
[115]
So, for what values of X bar
will we reject the null hypothesis?
[119]
Here's our information from before,
[122]
and we said that we are going to reject
the null hypothesis
[126]
if the observed value of Z is less than or equal to -1.34.
[130]
Well this this is our Z test statistic here,
and we can isolate X bar,
[136]
just multiply by sigma over the
square root of n and add mu_0.
[139]
and we get that X bar is equal to mu_0
plus sigma over the square root of n times Z.
[148]
Well in this case
[150]
that's going to be 50 plus 21
over the square root of 36 times -1.34,
[160]
and this works out to 45.31.
[165]
So we had this rejection region
expressed in terms of Z before,
[170]
but now we can express it in terms of X bar.
[173]
We're going to reject the null hypothesis
if X bar is less than or equal to 45.31.
[184]
Visually that looks like this.
[187]
I've plotted out the sampling distribution of X bar
if the null hypothesis is in fact true.
[193]
And we are going to reject the null hypothesis
[196]
if the value of our sample mean is less
than or equal to 45.31.
[201]
And this area here is the given alpha level of 0.09.
[209]
And that is the probability that we reject
the null hypothesis if it is in fact true.
[214]
Or in other words, the probability of committing a type I error
when the null hypothesis is actually true.
[225]
If the true value of the population mean is 43,
what is the probability we commit a type II error?
[231]
If you recall, a type II error is not rejecting
the null hypothesis when it is false.
[237]
Our null hypothesis here is that mu is 50,
[240]
and our null hypothesis is in fact false
[243]
because we're saying the true mean is 43.
[246]
So the probability of a type II error in this setting
[250]
is the probability that we do not reject
the null hypothesis if mu is actually 43.
[256]
If you recall, we reject the null hypothesis
if X bar is less than or equal to 45.31,
[266]
and so we're not going to reject the null hypothesis
when it's greater than that
[270]
and so the probability of a type II error is going to be
[273]
the probability that X bar
takes on a value bigger than 45.31,
[279]
given the true value of mu is actually 43.
[284]
Let's see what that looks like visually.
[291]
In white I have the sampling distribution of X bar
if the hypothesized value is correct.
[298]
And in blue I have the sampling distribution
of X bar if mu is actually 43
[303]
which we're assuming it to be for this question.
[306]
So this distribution in blue is centered here at 43.
[313]
We are rejecting the null hypothesis
[316]
if the sample mean is less than or equal to 45.31
[321]
and we're going to not reject the null
hypothesis if it's greater than 45.31,
[328]
so the probability of a type II error in this spot
[330]
is going to be the area to the right of this value,
given mu is actually 43.
[338]
Let's shade that area in.
[343]
I'm shading that area in red here because it's an error.
[347]
It is the probability of committing a type II error
if the true value of mu is actually 43 ,
[355]
the probability of not rejecting
the null hypothesis when it is wrong.
[361]
To find that area, we want to find the probability that X bar
takes on a value bigger than 45.31,
[370]
given the true value of mu is 43.
[375]
X bar in this setting is a normally
distributed random variable
[379]
and we're going to standardize this in the usual way.
[382]
And we standardize this by saying that
[386]
Z is equal to X bar minus the true value of mu
over sigma over the square root of n.
[392]
So to do this probability calculation
over here we're simply going to standardize it.
[397]
We're going to say that this is equal to
[400]
the probability that Z takes on a value that's bigger
[403]
than 45.31 minus the true value of mu, which is 43,
[410]
divided by sigma, which you may recall was 21, that was given earlier.
[415]
And our sample size n was 36.
[418]
And so this is going to be the probability
[421]
the random variables Z takes on a value
that's bigger than 0.66.
[429]
And if we go to the standard normal curve,
[432]
we can see that the area out
to the right of 0.66 is approximately 0.255.
[442]
And so our probability of a type II error
in this spot is approximately 0.255.
[449]
And we call that beta, the probability of a type II error.
[456]
The power of a test is the probability
of rejecting the null hypothesis when it is false.
[462]
And that's simply going to be 1-beta.
[466]
And in this setting that's 1-0.255, or 0.745.
[478]
Let's take a look at another example of a power calculation.
[482]
Suppose this time mu is actually 40,
[485]
so the null hypothesis is still wrong
but the population mean is now 40.
[490]
What is the power of the test?
[493]
What is the probability of rejecting the null hypothesis,
[496]
given that it is false, as it is in this scenario.
[501]
So here our power is the probability
of rejecting the null hypothesis given the true value of mu is 40,
[508]
and recall that we're rejecting the null hypothesis
[511]
when X bar is less than or equal to 45.31
[517]
so we could express power in terms of
the probability of a type 2 error, but we don't have to.
[523]
Its easier typically to just leave it in this fashion.
[526]
Power is the probability of rejecting the null hypothesis
[530]
and we're rejecting the null hypothesis when
X bar is less than or equal to 45.31,
[538]
given the true value of mu is actually 40.
[544]
Let's see what that looks like visually.
[549]
Here again I've plotted out the sampling distribution
of X bar if the null hypothesis is true,
[555]
and the sampling distribution of X bar
when mu is actually 40, which is our current situation.
[561]
So the sampling distribution of X bar now is centered over here at 40.
[569]
We are rejecting the null hypothesis if
we get a sample mean that's less than or equal to 45.31,
[576]
so let's shade that area in.
[581]
I've shaded this area in green this time
because this is the power,
[585]
and power is the probability of rejecting
the null hypothesis when it's false,
[589]
and that's a good thing.
[592]
And so here power is going to be
[595]
the probability that we get a sample mean
that's less than or equal to 45.31,
[601]
given the true value of mu is actually 40.
[605]
And we're going to standardize this
again in the usual way,
[608]
and say that Z is equal to X bar minus the true mean
[611]
over sigma over the square root of n
[614]
and come down here and say this is going to be equal to the probability
[618]
that Z takes on a value less than or equal to
45.31 minus the true mean, 40,
[626]
over sigma which was 21
[629]
and the square root of n and n was 36.
[633]
This is going to be equal to the probability
[636]
that a random variables Z takes on a
value that's less than or equal to 1.517.
[643]
And if we go to our standard normal curve
[647]
we can find that the area out to the left of 1.517 is approximately 0.935,
[657]
and that is the power of the test in this situation.
[663]
Here we did all of the power calculations
[665]
under the alternative hypothesis that mu is
actually less than the hypothesized value.
[671]
The same logical arguments hold for other alternatives
[674]
like it's greater than the hypothesized value or not equal to,
but the required areas will change.
[680]
So when faced with one of these power calculations,
[683]
it's important to think through it and
make sure you're coming up with the correct areas.
Most Recent Videos:
You can go back to the homepage right here: Homepage





