Index: The Book of Statistical ProofsStatistical Models ▷ Univariate normal data ▷ Univariate Gaussian ▷ One-sample t-test

Theorem: Let

\[\label{eq:ug} y_i \sim \mathcal{N}(\mu, \sigma^2), \quad i = 1, \ldots, n\]

be a univariate Gaussian data set with unknown mean $\mu$ and unknown variance $\sigma^2$. Then, the test statistic

\[\label{eq:t} t = \frac{\bar{y}-\mu_0}{s / \sqrt{n}}\]

with sample mean $\bar{y}$ and sample variance $s^2$ follows a Student’s t-distribution with $n-1$ degrees of freedom

\[\label{eq:t-dist} t \sim \mathrm{t}(n-1)\]

under the null hypothesis

\[\label{eq:ttest1-h0} H_0: \; \mu = \mu_0 \; .\]

Proof: The sample mean is given by

\[\label{eq:mean-samp} \bar{y} = \frac{1}{n} \sum_{i=1}^{n} y_i\]

and the sample variance is given by

\[\label{eq:var-samp} s^2 = \frac{1}{n-1} \sum_{i=1}^{n} (y_i - \bar{y})^2 \; .\]

Using the linear combination formula for normal random variables, the sample mean follows a normal distribution with the following parameters:

\[\label{eq:mean-samp-dist} \bar{y} = \frac{1}{n} \sum_{i=1}^{n} y_i \sim \mathcal{N}\left( \frac{1}{n} n \mu, \left(\frac{1}{n}\right)^2 n \sigma^2 \right) = \mathcal{N}\left( \mu, \sigma^2/n \right) \; .\]

Again employing the linear combination theorem and applying the null hypothesis from \eqref{eq:ttest1-h0}, the distribution of $Z = \sqrt{n}(\bar{y}-\mu_0)/\sigma$ becomes standard normal

\[\label{eq:Z-dist} Z = \frac{\sqrt{n}(\bar{y}-\mu_0)}{\sigma} \sim \mathcal{N}\left( \frac{\sqrt{n}}{\sigma} (\mu - \mu_0), \left(\frac{\sqrt{n}}{\sigma}\right)^2 \frac{\sigma^2}{n} \right) \overset{H_0}{=} \mathcal{N}\left( 0, 1 \right) \; .\]

Because sample variances calculated from independent normal random variables follow a chi-squared distribution, the distribution of $V = (n-1)\,s^2/\sigma^2$ is

\[\label{eq:V-dist} V = \frac{(n-1)\,s^2}{\sigma^2} \sim \chi^2\left(n-1\right) \; .\]

Finally, since the ratio of a standard normal random variable and the square root of a chi-squared random variable follows a t-distribution, the distribution of the test statistic is given by

\[\label{eq:t-dist-qed} t = \frac{\bar{y}-\mu_0}{s / \sqrt{n}} = \frac{Z}{\sqrt{V / (n-1)}} \sim \mathrm{t}(n-1) \; .\]

This means that the null hypothesis can be rejected when $t$ is as extreme or more extreme than the critical value obtained from the Student’s t-distribution with $n-1$ degrees of freedom using a significance level $\alpha$.

Sources:

Metadata: ID: P204 | shortcut: ug-ttest1 | author: JoramSoch | date: 2021-03-12, 08:43.