Introduction
Welcome to your next lesson in our journey through statistical inference. In our previous discussions on hypothesis testing, particularly when constructing likelihood ratio tests and analyzing statistical power, we frequently used the Z-statistic:
A critical, and often unrealistic, assumption for using this statistic is that we know the true population standard deviation, . In most real-world scenarios, from R&D in an EV company to analyzing scientific data, is unknown and must be estimated from the data itself.
This lesson tackles this exact problem. We will investigate what happens when we replace the constant with its estimate, the sample standard deviation . This seemingly small change has profound consequences: it gives rise to a new test statistic, the one-sample t-test statistic, which follows a different probability distribution known as Student's t-distribution.
Our learning objective is to derive the one-sample t-test statistic from its definition. This will involve a detailed mathematical proof that connects the normal distribution, the chi-squared distribution, and this new t-distribution, fulfilling your preference for rigorous derivations.
1. From Z-statistic to t-statistic: An Intuitive Leap
Let's begin by building an intuition for why a new distribution is necessary. The Z-statistic has only one source of randomness: the sample mean, . The population parameters and , and the sample size , are all constants.
Now, consider the new statistic we form by substituting the sample standard deviation for :
Here, we have two sources of randomness: and . The value of will vary from one sample to the next. This additional uncertainty, especially when our sample size is small, means that our new statistic will have more variability than a standard normal variable. Its distribution will be wider and have "heavier" tails.
The following video provides an excellent overview of this concept, introduces the historical context of the t-distribution, and sets the stage for our derivation.
What is the t-distribution? An extensive guide!
This video from zedstatistics explains the scenario where the t-distribution is needed and contrasts the t-statistic with the Z-statistic, highlighting the role of the unknown population standard deviation.
Please watch from 00:45 to 12:19. Focus on the core problem: what to do when the population standard deviation is unknown and the sample is small. Pay attention to the comparison between the Z-statistic and the t-statistic and the explanation of why the sample standard deviation introduces additional uncertainty.
As the video explains, the distribution of this new statistic is the Student's t-distribution. It is characterized by a parameter called "degrees of freedom," which is related to the sample size. As the sample size increases, our estimate becomes more reliable and closer to . Consequently, the t-distribution converges to the standard normal distribution.

2. Formal Definition of the t-Distribution
Before we can prove that our statistic follows a t-distribution, we need to formally define it. This definition is based on two well-known distributions: the standard normal and the chi-squared () distribution.
A random variable is said to follow a Student's t-distribution with (the Greek letter 'nu') degrees of freedom if it can be constructed as follows:
where:
- is a standard normal random variable, .
- is a chi-squared random variable with degrees of freedom, .
- and are independent.
This abstract definition is the mathematical key to our derivation. The following short video states this definition concisely.
An Introduction to the t Distribution (Includes some mathematical details)
This clip from jbstatistics presents the formal mathematical definition of a random variable that follows the t-distribution.
Watch the segment from 00:26 to 01:14 to see the formal definition. We will spend the rest of the lesson showing how our one-sample statistic fits this exact structure.
3. Deriving the One-Sample t-statistic
Our goal now is to show that the statistic perfectly matches the formal definition of a t-distributed random variable. Our derivation will proceed in three steps:
- Construct the standard normal part () from the numerator.
- Construct the independent chi-squared part () from the denominator.
- Combine them algebraically to show they form the required ratio.
Throughout this derivation, we assume we have a random sample drawn from a normal distribution .
Step 1: Constructing the Standard Normal Numerator
This step is straightforward and should be familiar. We know that the sample mean of i.i.d. random variables from is also normally distributed:
Standardizing gives us a standard normal random variable, which will be our :
Step 2: Constructing the Independent Chi-Squared Denominator
This is the most involved part of the proof. It rests on a cornerstone result in mathematical statistics known as Cochran's Theorem. For a random sample from a normal distribution, the theorem implies two crucial facts:
- The sample mean and the sample variance are independent random variables.
- The quantity follows a chi-squared distribution with degrees of freedom.
Proving these facts requires a bit of linear algebra and manipulation of moment-generating functions, which should align well with your mathematical background. The following resource provides the necessary proofs.
[PDF] Distributions Derived From the Normal Distribution
These lecture slides from MIT OpenCourseWare provide a rigorous derivation of the properties of sample statistics from a normal distribution, which are essential for our main proof.
Please study slides 8 through 13. Slide 9: Shows that ar{X} is normally distributed. Slides 10-11: Provide a proof for the independence of ar{X} and s^2. This is a key step, as the formal definition of the t-distribution requires independence. Pay attention to how the joint moment generating function is used. Slides 12-13: Show that (n-1)S^2/\sigma^2 follows a \chi^2_{n-1} distribution. Follow the logic using the moment-generating functions.
So, we have found our chi-squared variable: , with degrees of freedom. We have also established that it is independent of our variable (since is a function of , which is independent of ).
Step 3: Assembling the t-statistic
Now we have all the components. We just need to perform some algebra to show that can be arranged into the required form.
The following resource provides a very clean and direct presentation of this final algebraic step.
[PDF] Sample Mean - Hiroyuki Kasahara
This PDF note from Prof. Hiroyuki Kasahara at UBC clearly walks through the final algebraic manipulation to construct the t-statistic.
Read page 8 of the document, starting from the sentence 'To see the connection between (10) and t-statistic defined in (9)...' and ending just before 'A few comments:'. Follow the rearrangement of the t-statistic formula closely.
Let's walk through that algebra here as well. We start with our statistic:
Divide the numerator and the denominator by the constant :
We immediately recognize the numerator as our .
Now, let's rewrite the denominator:
To get this into the form , we multiply the inside of the square root by :
We recognize the numerator inside the square root as our and the denominator as our degrees of freedom .
Substituting everything back, we get:
This expression exactly matches the formal definition of a Student's t-distribution with degrees of freedom. This completes the derivation.

Conclusion
In this lesson, you have rigorously derived one of the most fundamental tools in statistics. By starting with the intuitive problem of an unknown population variance, you have navigated the mathematical details to prove why the one-sample t-test statistic follows the distribution that bears Student's name.
Key Takeaways:
- When the population variance is unknown, we use the sample variance as an estimate.
- Substituting for in the Z-statistic introduces additional randomness, leading to a new statistic: .
- This t-statistic follows a Student's t-distribution with degrees of freedom, which has heavier tails than the standard normal distribution for small .
- The derivation rests on Cochran's Theorem, which establishes that for a normal sample, is independent of and that .
- The proof is completed by algebraically arranging the t-statistic into the ratio of a standard normal variable and the square root of an independent, scaled chi-squared variable.
Preview of the Next Lesson:
You have now built a solid theoretical foundation for this module. You've explored hypothesis testing frameworks, understood error trade-offs, and derived the crucial t-statistic. In the next lesson, we will put all this knowledge into practice. You will tackle the final project for this module: Perform an A/B test analysis on a sample dataset, from hypothesis formulation to p-value interpretation, using Python's SciPy library. This will be a hands-on application of the t-test you've just derived.