This video is more about the confidence interval.
The confidence interval seems like a fairly artificial statistical tool to find the range
within which a population parameter lies.
I'm hoping to show you soon that this confidence interval is extremely useful
in engineering work.
In the prior video we left our derivation
by learning something new about the central limit theorem.
We learned that the mean that we calculate from our independent samples is also
from a normal distribution, with the same mean as the original sample data.
The other interesting thing that we learned is
that the calculated average has the same variance as the raw,
sampled data, but divided by a factor of "n".
Practically speaking, that meant, that if our original data come
from the broad histogram shown here, then the distribution of the average comes
from this much narrower distribution.
The interpretation is that if we take many samples and average them,
we get a better estimate of the mean, with less error.
The one issue we had though for calculating that confidence interval was that we required
to know the true population standard deviation.
This is not something we know in practice.
This video shows how we can relax that requirement.
So what we do is to use an estimate of the standard deviation, which we will now call "s".
We will replace sigma with this "s" here in the denominator.
The z-value for x-bar however is modified.
It is no longer normally distributed, rather it is now t-distributed.
Compare these two equations to see the change.
There is however one assumption required to make this work: the raw data used now have
to come from the normal distribution.
That's a fairly strong assumption.
But, we have a tool in place to check for that: the q-q plot.
Previously our assumption was that the x_i values come
from any distribution of finite variance.
Since we are introducing a new distribution here, the t-distribution,
we should examine it a little more closely, to understand its properties.
The t-distribution is also symmetric, and it has a similar shape to the normal distribution.
It is shown here in the thin line.
It is slightly lower at the peak, but a little broader in the tails.
It also has a cumulative area of 1.0 under the thin curve.
Because areas are related to probability, we can look at tables
to find the fractional area under the curve.
I will introduce these tables shortly.
The t-distribution only has one parameter that we have to specify:
the number of degrees of freedom.
Contrast that to the normal distribution where we have
to specify two parameters: the mean and standard deviation.
The degrees of freedom alters the shape of that distribution.
With higher degrees of freedom,
the t-distribution approaches the normal distribution's shape.
So back to our confidence interval: as long as we take samples from a normal distribution,
where the mean is "mu" and the variance is "sigma" squared,
then we can take "n" samples and calculate the average.
As before we can standardize that average, the x-bar, and find a z-value for it.
It is that z-value now that is now t-distributed, with n-1 degrees of freedom.
That z-value has lower and upper critical limits.
We find our critical values
from the t-distribution instead of the normal distribution.
Written here mathematically, we say there is a lower c_t value and an upper c_t value
that will contain z, with a certain degree of probability.
These c_t values are found from a table.
Take a look at this table now.
We know our degrees of freedom, so let's use, for example,
a value of degrees of freedom of 15.
That implies that n=16.
It we were calculating a 95% confidence interval, we would like 2.5%
in the left tail, and 2.5% in the right tail.
So in the column for 0.025 we can read down and see the critical value is 2.13.
We are doing, like we did before, finding the z-value on the horizontal axis
that has a cumulative area of 2.5% under the curve.
In R, you would use the qt(...)
function, as follows: say qt(0.025, df=15).
The answer is -2.13, because it is the lower tail.
If you wanted the upper tail, where the cumulative area is 97.5%, leaving 2.5% remaining
on the right, then say qt(0.975, 15) and that gets you the same answer, with the sign flipped.
So let's return to the example from the earlier video: we had these 9 measurements,
and our goal is to find a confidence interval for the true mean.
We don't know the standard deviation, but we can estimate it from the data as s=3.81.
If we want to use the new concepts we just learned,
we also have to ensure these 9 raw data samples are normally distributed.
We have the q-q plot to test that, and the plot here shows that it is normal.
Now on to the calculations.
The z-value, as we said earlier, is from the t-distribution.
We can say, that with 95% probability, that the z-value, if we were able to calculate it,
can be found between lower and upper critical values of c_t.
Pause the video, and read the c_t values from the table for this problem,
and then also use R to calculate them.
You must be comfortable with both options.
Did you find a value of about plus/minus 2.3?
If you use the table, you can use a rough visual interpolation between the rows of 5
and 10, to find an approximate value.
That's because there isn't a row with 8 degrees of freedom.
Don't worry about an exact interpolation.
In R, you would have used qt(0.975, 8).
Now substitute, as we did in the prior video, the equation for z. Rearrange the inequality,
leaving the parameter "mu" in the middle.
This gives a lower and upper bound.
We know all the terms in here: the x-bar and s values are calculated, the c_t values are plus
and minus 2.3, and the number of samples is 9.
Subbing in those numbers gives bounds of 17.1 and 22.9.
That gives us bounds that we have a confidence of 95% of containing the true mean.
I would like to compare this to the bounds from the earlier video: 17.7 to 22.3.
Those bounds were from when we happened to know the true standard deviation.
Our revised bounds of 17.1 to 22.9, in this video, are a little wider.
That is because we have used imperfect knowledge of the standard deviation:
we have only estimated the standard deviation.
That error in the estimation propagates itself into the calculation for the bounds:
the bounds must be wider, to get the same level of confidence.
Not knowing the true standard deviation implies that our confidence interval must be wider
to account for that lack of certainty.
And perhaps you might also see now why it makes sense
that the t-distribution approaches the normal distribution
with a large number of degrees of freedom.
If you measured many samples, your estimate of the standard deviation improves;
so much so, that you essentially know it.
Then, you are back to the case where the z-value is normally distributed,
instead of t-distributed.
If that last part isn't clear to you, also watch the next video
where it is explained in a different way.