>>Dr. Kash Barker: Let’s take a look at one more example. A machine produces metal
rods used in an automobile suspension system. A random sample of fifteen rods is selected
and for each of those in the sample the diameter in millimeters is measured. Some amount of
variability is acceptable. A variability that is too great results in unstable rods, a variability
that’s too small is probably taking too long to machine to exact specifications. As
a quality control engineer you might want to know whether or not the standard deviation
is 0.02 millimeters. Let’s draw conclusions with ninety-five percent confidence. Okay. So we
want to know something about the variability of this machining process and the variability
can’t be too great, or it can’t be too small. Too great is a bad situation, too small
is taking to long to get things really exact. We can accept some amount of variability. Okay.
So, we’ve got an equality kind of statement about our variability. So is it equal to some
value? Is it equal to a standard deviation of 0.02? So the variability would be 0.02
squared, variance would be 0.02 squared? Or is it not equal to 0.02 squared, okay? We
go and collect a sample of size twelve and we find that the sample standard deviation
is 0.0253. Therefore the variance would be 0.0253 squared. Okay? And we want to draw
conclusions with ninety-five percent confidence. So let’s take a look at this chi square
test statistic. It would be n minus one times s squared over the hypothesized value sigma
not squared. Okay. That is twelve minus one times s squared, which is 0.0253 squared divided
by the hypothesized value 0.02 squared. Okay? If we work this out, just arithmetic, we get
a test statistic of 17.6. Okay? Critical value approach, let’s do that one first. Okay,
we’ve got a chi square axis with degrees of freedom eleven. So here is our distribution
for the chi square test statistic and this is a two tail test. So we want 0.025 up here
and we want alpha over two, 0.025 down here. Okay. This chi square 0.025 degrees of freedom
eleven. If we go look that up in the table, very straightforward to find. Go down to the
degrees of freedom eleven row, over to the 0.025 in the upper tail column and we get
21.92. Okay? For this value down here we want 0.025 in the lower tail, but the chi square
always gives us the upper tail. So we want chi square of 0.975 in the upper tail. Okay?
Go down to the eleven, degrees of freedom eleven row, over to the 0.975 column and we
get a value of 3.81575. So we’ve got our critical value, our test statistic, our test
statistic lies right about there. Okay? Lies in the non rejection region. So we don’t
reject the null with ninety-five percent confidence. And we conclude that the variability is just
right. It’s not too big, it’s not too small, it’s right where we want it to be. Okay?
So we don’t reject the null with ninety-five percent confidence. Okay. Now let’s say
we want to use the p value approach instead. So with the p value approach as always we
plot the test statistic directly and we find the area in the smaller tail multiply that
area by two and that gives us the p value. Okay? So we go see what we have in the book.
And what we have in the book would be this tail. Okay. So this is chi square degrees
of freedom eleven. We have this, we have 17.2750. If you go look in the chi square table down
to row eleven, row degrees of freedom eleven, you’ll find this value hanging out in there
associated with an upper tail value of 0.1. But that’s not this exactly, so let’s
see what else we have. Okay, go back to the table, the degrees of freedom eleven row,
and we find this. We find this value on the axis. 19.6751, that area is 0.05. Okay. So
this value and this value on the chi square axis bound this thing. Bounds this value right
here. So that must mean that this p value. Well, this is just an area first we have a
two tail test so this is just the area above the test statistic. That area must be bounded
by 0.05 and 0.1. Okay. We don’t know what it is exactly but it’s bounded by these two values.
Okay? So the area above the test statistic is bounded by 0.05 and 0.1. Okay? We’ve got
a two tail test, that means that we multiply that area above the test statistic by two
to get the p value. So the area by two gives us the p value. That would be this times two,
0.1. This times 2, 0.2. Okay. So our p value associated with this test statistic lies somewhere
between, but we don’t know exactly where, 0.1 and 0.2. Okay. That’s a pretty big range
and the lower bound is bigger than our value of alpha. Okay, lower bound bigger than our
value of alpha. And really it’s bigger than any kind of convincing p value that we would
ever choose. P value greater than alpha, therefore we do not reject the null hypothesis okay.
We only reject the null if the p value is less than alpha, here it’s not. Okay, p
value quite large. We’re not, we’re not in any way compelled to reject the null with
ninety-five percent confidence. Okay. But here we have to bound the value. Let’s say
we wanted that p value exactly just because we’re stats nerds and we just want to know exactly
what that thing is. So let’s use Excel. Okay we can use the chisq.dis function in
Excel. Okay. It wants the value on the axis here, it wants the degrees of freedom, and
it wants whether or not this distribution is cumulative. Okay, so let’s just say we
want the cumulative distribution. That will give us all of this area up to that value.
So let’s read in 17.6, degrees of freedom eleven, true. Okay so if we implement this
equation in Excel we should get something that looks like this. 0.9087. Okay, that’s
the cumulative area , we say cumulative true, that’s the cumulative area between the lower
bound zero up to the value on this axis 17.6. Okay, but that’s not the area we want. We want
this upper tail area. Okay. That upper tail area would be the complement of this, one
minus 0.9087. So the area, area, is one minus 0.9087 which is 0.0913. Okay, so that just gives
us the area. Remember for a p value calculation when we have a two tailed test, we have to
find the area and multiply it by two. Okay so the p value in this case is this area,
0.0913 multiplied by two and that is 0.1826. Okay, 0.1826 big p value. Way bigger than
alpha 0.05. Don’t reject the null. Note here 0.1826 is in between these two bounds that
we found earlier. If that’s not, if that didn’t happen then we did something wrong
somewhere. Okay, and if we didn’t draw the same conclusion that we did over here then
we did something wrong. I should also point out that, yes. So if we would have just said.
So if we’re unsure which area to multiply by two. Do we take the upper tail or the lower
tail. Okay. The way to figure this out is if we had taken this area which was 0.9087
and we multiplied that by two to get our p value? Multiplying that by two gives
us a value of 1.8 something. Okay. We can’t have a probability. P value is a probability, we can’t have
a probability of something greater than one. So this area is the one we needed to find
and that was 0.0913. When you multiply that by two you get something reasonable that sounds
like it would be a p value, that sounds like it would be a probability. Okay. So here p
value 0.1826. It lies between 0.1 and 0.2. We could use Excel, we could use the book.
For the p value approach, we could use the critical value approach and still we come
up with the same conclusion about the set of hypotheses dealing with population variances.