The t-Statistic: Purpose, Mechanics, and Small-Sample Inference
Statistics & ExperimentsModel answerLast updated
Explain how and why the t-statistic differs from a z-score, what degrees of freedom represent, and how this matters when comparing two strategies on limited data.
Testing a Mean When You Don't Know the Population Spread
In practice, when you want to test a claim about a population mean, you almost never have access to the true population standard deviation — only the data in front of you. The t-statistic was designed precisely for this situation.
What to address
1. How it's built Write out the formula for the t-statistic and contrast it with the z-score. The formulas look nearly identical — what is actually different, and why does that difference matter for the shape of the sampling distribution?
2. Degrees of freedom Where does the value $n - 1$ come from? Explain what it captures conceptually, and describe how the t-distribution changes as that value grows.
3. Reaching a decision Walk through how the t-statistic is used to accept or reject a null hypothesis. In what sense is this procedure well-calibrated even with very few observations?
Scenario to analyze
You have 15 days of daily return data for two algorithmic trading strategies and want to know whether one significantly outperforms the other. A colleague proposes using a z-test with the standard normal critical value of 1.96.
- What goes wrong if you follow that suggestion?
- What test should you actually run, and how should the data be structured before you run it?
- What does the result tell you about whether 15 days is even enough data to draw conclusions?
Hints
Hint 1
The z-score treats the denominator as a fixed constant. Ask yourself: what happens when that denominator is itself a random quantity estimated from the same small sample?
Hint 2
The n − 1 degrees of freedom come from a constraint hidden in the residuals. Think about how many of the values x_i − x̄ you can freely choose once you know the sample mean.
Hint 3
The two strategies were both running during the same 15-day window, so their returns share common market-wide moves. That structure should directly inform your choice of test.
Model answer
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Why the t-Statistic Exists
The core distinction: a random denominator
For a sample $x_1, \dots, x_n$ with mean $\bar{x}$ and sample standard deviation $s$, testing $H_0: \mu = \mu_0$ gives two options depending on what you know.
z-score (population $\sigma$ known): $$z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}} \sim N(0,1) \text{ under } H_0$$
t-statistic ($\sigma$ unknown, replaced by $s$): $$t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}} \sim t_{n-1} \text{ under } H_0$$
The formulas differ by exactly one symbol: $\sigma$ becomes $s$. That swap has real consequences. In the z-score, the denominator is a known constant — the only randomness is in $\bar{x}$. In the t-statistic, the denominator is itself estimated from the data, so it carries its own sampling variability. When $s$ happens to come out smaller than $\sigma$ (which it will sometimes, especially with few observations), the t-statistic gets inflated. This is what produces the t-distribution's heavier tails relative to the normal.
Where degrees of freedom come from
Under the assumption that the $x_i$ are i.i.d. normal, two facts hold simultaneously and independently:
- $Z = (\bar{x} - \mu) / (\sigma / \sqrt{n}) \sim N(0,1)$
- $V = (n-1)s^2 / \sigma^2 \sim \chi^2_{n-1}$
Because $\bar{x}$ and $s^2$ are independent under normality (Cochran's theorem), the t-statistic can be rewritten as:
$$t = \frac{Z}{\sqrt{V / (n-1)}}$$
This is exactly the definition of Student's t-distribution with $\nu = n - 1$ degrees of freedom.
The value $n - 1$ rather than $n$ appears because the $n$ residuals $x_i - \bar{x}$ must sum to zero — once you know $\bar{x}$ and $n-1$ of the residuals, the last one is determined. Estimating the mean consumes one degree of freedom, leaving $n-1$ independent pieces of information to estimate variance.
As $\nu$ grows, $s$ concentrates closer to $\sigma$, the extra noise in the denominator shrinks, and $t_\nu$ converges to $N(0,1)$. The tails get lighter as you can see in the critical values:
| $\nu$ | $t_{0.975,\nu}$ |
|---|---|
| 2 | 4.30 |
| 5 | 2.57 |
| 14 | 2.145 |
| 30 | 2.04 |
| ∞ | 1.96 |
Making a decision
The procedure is straightforward: compute $t$ from the sample, compare $|t|$ to the critical value $t_{1-\alpha/2,, n-1}$, and reject $H_0$ if the threshold is exceeded (equivalently, if the p-value $2P(T_{n-1} > |t|)$ falls below $\alpha$). The matching confidence interval is $\bar{x} \pm t_{1-\alpha/2,, n-1} \cdot s/\sqrt{n}$.
Under normality this test is exact at every sample size — not approximately correct, exactly correct. Its Type I error rate is exactly $\alpha$ because the reference distribution fully accounts for uncertainty in $s$. The common shorthand that "you use t when $n < 30$" misidentifies the reason. The real trigger is that $\sigma$ is unknown and estimated, regardless of sample size.
The 15-day trading scenario
What goes wrong with z. Using the standard normal critical value 1.96 when the true null distribution is $t_{14}$:
$$P(|T_{14}| > 1.96) \approx 0.07$$
A test you believe runs at 5% actually runs at roughly 7%, about a 40% excess in false positives. Confidence intervals are also too narrow by a factor of $2.145 / 1.96 \approx 1.09$. When you are screening many strategies, this inflation compounds and you start attributing alpha to draws where $s$ simply came out small.
The right test structure. Both strategies ran over the same 15 days, so their daily returns share common market noise. Treating them as two independent samples ignores this and wastes power. Instead:
- Compute daily differences $d_i = r_{A,i} - r_{B,i}$ for each of the 15 days.
- Run a one-sample t-test on ${d_i}$ with $H_0: \mu_d = 0$ and $\nu = 14$.
Pairing removes the shared systematic component and typically narrows the standard error considerably. If the samples genuinely were independent, Welch's t-test is the right choice — it handles unequal variances and computes an effective degrees of freedom via the Welch–Satterthwaite formula rather than assuming a common variance.
Is 15 days enough? Probably not. The t-statistic for a mean return equals $\hat{SR} \cdot \sqrt{n}$, where $\hat{SR}$ is the per-period Sharpe ratio. A daily Sharpe of 0.1 (roughly 1.6 annualized, which is very good) gives $t \approx 0.39$ — nowhere near significance. Detecting realistic strategy differences requires either much more data or a very large edge. Also worth flagging: daily returns exhibit autocorrelation. Positive serial correlation makes $s/\sqrt{n}$ understate the true standard error, inflating the t-statistic beyond what the degrees of freedom correction already fixes. For financial return series, Newey–West standard errors or a block bootstrap are more appropriate.
Common mistakes to avoid
- Citing the $n < 30$ rule as the reason to use t. The actual reason is unknown $\sigma$.
- Forgetting that the derivation of the t-distribution requires $\bar{x}$ and $s^2$ to be independent, which holds specifically under normality.
- Using a two-sample test on paired data — you lose the power that pairing provides.
- Claiming the t-test is robust to any distribution at small $n$. It is robust to mild, symmetric departures from normality; it is not immune to heavy skew or fat tails with 15 observations.
- Ignoring autocorrelation in time series data, which invalidates the i.i.d. assumption underlying the standard error formula.
When normality doesn't hold
For small samples with clearly non-normal data, reasonable alternatives include a bootstrap-t or BCa interval, a permutation test on the paired differences, or Yuen's trimmed-mean test. For large samples the CLT makes normality less critical, though heavy skew slows the convergence.