Student t-distributions are very important in statistics, but what do they actually mean.
You probably heard that they're a family of curves where we've got t(1), where they're
defined by the number of degrees of freedom where we say the number of degrees of freedom,
use the symbol nu, is equal to the sample size, n-1. So here's a t-distribution with
one degree of freedom, and then here is a t-distribution with an infinite number of
degrees of freedom. This would be like taking an infinite number of measurements for example,
and as it turns out the larger the number of degrees of freedom the closer these things
get to a normal distribution. So one question I've always had is where do these distributions
come from, or what do they mean, or what can we do with it, so in a book we'd say you could
look up the ratio, the sample mean minus the population mean divided by the sample standard
deviation s, divided by the square root of n is t-distributed, and as the number of samples
gets larger and larger, we start out with a sample size of two, and a sample size of
three for example, if I crudely drew another curve in here, would looking something like
this, and as the sample size gets bigger the t-distributions become more and more normally
distributed, and one thing to take away from this as well, one thing to pay attention to
is the width of the tails in the t-distribution become shorter and shorter. And that is really
important later on when we use the t-distributions for statistics. And to try to figure out where
these distributions come from I've developed some simulations where we can see how they
naturally arise. The first thing that we need to assume is that all of the measurements
that we're collecting come from a normal distribution, so in this case for this we have on the x-axis
is whatever we're measuring, it's going to be weight for example in kilograms, if we
were dealing with circuits it might be amperage or voltage, or if we were pulling parts apart
it might be the breaking strength in Newtons or maybe chemical conversion if we were doing some
chemistry, but the x-axis here is measured in whatever appropriate units you are working
with. And for my simulation I've elected to use a population mean of 12, and a population
standard deviation of 2. In this simulation I have a sample size of two, so I am going
to collect one sample of two measurements, and what I am showing here is in the red line
is the sample mean, and the two x's at the bottom are the two values of the sample, and
the width of that horizontal bar is the sample standard deviation. And in my simulation let's
collect another sample of two measurements, and another one, and as I keep running through
this one thing you'll notice is that the sample mean will change, the red bar moves left
and right, but so does the sample standard deviation, and this depends on how far apart
the measurements are from one another, so here we see a small sample standard deviation,
here's a relatively large one, and for each one of the simulations I can calculate a value
for t. So here is a simulation in which I collected one measurement, and that value
was 8.59 for this one, and for this one I collected a measurement randomly of 12.61, and the average
of these two is my sample mean, so x bar is equal to 10.60, and I also calculated the
sample standard deviation, which is s, and for this one s is equal to 2.85. So let's
calculate a value of t for this simulation, its sample mean of 10.61 minus the population
mean of 12, I'll get a negative value for t, divided by the sample standard deviation
of 2.85 divided by the square root of n, the square root of the sample size of 2, and when
I calculate this I get a value of t of negative 0.695. So from here what I am going to do
is run multiple simulations, and I am going to collect multiple values of t, and I am
going to make a histogram of all of these values of t. So here is my simulation I am
showing the exact same normal distribution on the left, and what I am showing on the
right is a t-distribution with one degree of freedom. So I'll run my first simulation.
I collected two measurements, so one sample, here is my sample mean and my population mean,
so I am going to get a positive value of t, and here is my sample standard deviation.
So here is my value of t right here, and I am making a histogram of all my values of
t. So I'll run it again, and I get another value of t, it's negative in this case, and as I
make multiple runs I start collecting a histogram, and what I expect is over a long period of
time, or with sufficient number of iterations of this, I'll eventually build up to a t-distribution,
or what we would expect. So as I continue running it I'll run it 300 times for example,
and this is like collecting 300 different measurements, and what I see is something
that beings to look like a t-distribution. Note that one thing that we observe are the
width of these tails for a small number of degrees of freedom, and the reason these tails
are so much wider than they are in a normal distribution is because the sample deviation
can also vary, so the sample standard deviation is in the denominator, and a small value for
sample standard deviation tends to push our value of t off to the left and off to the
right. So what I am going to run now is a simulation, but still have each sample size
will consist of two, but will run it a whole bunch of different times, I'll run it upwards
of 10,000 different iterations on this, and when I run the simulation what we observe
is the buildup of the distribution of t-values that eventually reaches a t-distribution with
one degree of freedom, which is a sample size of two. Or if I want to run it even more precisely
here, I am running a simulation with a 1,000,000 iterations, so a 1,000,000 samples with sample
sizes of two measurements each, and we see once I run it with a large number of simulations
I get a very, very close representation of the student t-distribution. In reality you
probably will collect more than two measurements for your sample, usually about, I would say
three to five measurements, or something like that would be more typical. So let's run this
with five different measurements, and here I've calculated a sample mean that is just
shy of the population mean, calculated the value of t for that and put that into my histogram.
One thing to pay attention to is now I am showing the t-distribution, with n minus one,
or five minus one, equal to four degrees of freedom, you see how the tails for that t-distribution
came in a little bit, and the reason for that is if I keep running these, take a look at
the sample standard deviation, and they tend to be, they tend to be closer to the population
means, simply because we collected more measurements for one particular sample, so as I keep running
this thing my histogram tends to approach a t-distribution with four degrees of freedom.
And if I wanted to I could simulate a case in which I collected 100 measurements from
my sample. So I've got 99 degrees of freedom, there are my 100 samples on the left, and one
thing when I keep, continue running this, look at how close this sample mean is in general
to the population mean, and look at the consequence of that in terms of the t-distribution, I
am showing a t-distribution now with 99 degrees of freedom, how tightly those tails come in,
mainly because the sample mean is so close to the population mean in general. So if I
continue running this I get a t-distribution with 99 degrees of freedom. And if I want
to refine that simulation further, here is a simulation with a million different replication
of that, and I see it building to a t-distribution of 99 degrees of freedom, which incidentally
is essentially a normal distribution. So for a very large sample size we begin to converge
to something that looks like a normal distribution on the right, and again when I zoom in on
this I see a very good representation of a t-distribution with 99 degrees of freedom,
even way out in the tails. So the take away message from this is that this ratio, the sample
mean minus the population mean divided by the sample standard deviation divided by the
square root of the sample size is t-distributed, and that has important consequences for other
areas of statistics.