Connecting hypothesis testing and confidence intervals
1 Hypothesis testing
Consider the two-sided hypothesis testing case
\[H_0 : \mu = \mu_0\] \[H_1 : \mu \neq \mu_0\]
Where the test statistic used in order to test the above claim is:
\[ t = \frac{\bar x - \mu_0}{s / \sqrt{n}} \]
At the 5% significance level:
- we reject the null hypothesis \(H_0\) whenever the observed t-statistic lies beyond the critical values:
\[t \leq -t^* \qquad \text{or} \qquad t \geq +t^*\]
- we do not reject the null hypothesis \(H_0\) whenever the observed t-statistic lies within the critical values:
\[-t^* < t < +t^*\]
2 Confidence interval
A 95% confidence interval for the population mean is given by
\[\left[ \bar x - t^* \times \frac{s}{\sqrt n}, \ \ \bar x + t^* \times \frac{s}{\sqrt n} \right]\]
This is often written as
\[ \bar x \pm t^* \times \frac{s}{\sqrt n} \]
where \(\pm t^*\) are the quantiles of a t-distribution jointly cutting an overall probability of \(\alpha\) in the tails.
3 From HT to CI
In the hypothesis test, we do not reject the null hypothesis at the 5% significance level whenever \(\mu_0\) lies inside of the 95% CI:
\[ \begin{aligned} \textbf{Do not reject } H_0 : \mu = \mu_0 \textbf{ if} \\ \quad \\ -t^* &< t < +t^* \\ -t^* &< \frac{\bar x - \mu_0}{\frac{s}{\sqrt n}} < +t^* \\ -t^* \times \frac{s}{\sqrt n} &< \bar x - \mu_0 < +t^* \times \frac{s}{\sqrt n} \\ -\bar x -t^* \times \frac{s}{\sqrt n} &< - \mu_0 < -\bar x +t^* \times \frac{s}{\sqrt n} \\ \bar x + t^* \times \frac{s}{\sqrt n} &> \mu_0 > \bar x - t^* \times \frac{s}{\sqrt n} \\ \bar x - t^* \times \frac{s}{\sqrt n} &< \mu_0 < \bar x + t^* \times \frac{s}{\sqrt n} \\ \mu_0 \text{ inside of } &\left[ \bar x - t^* \times \frac{s}{\sqrt n}, \ \ \bar x + t^* \times \frac{s}{\sqrt n} \right] \\ \mu_0 \text{ inside of } &\text{95\% CI} \end{aligned} \]