There are two reasons why hypothesis tests may be easier than confidence intervals:
In these situations, good approach to finding a confidence interval may be through hypothesis tests.
Binomial probability
The earlier confidence intervals that we showed for the binomial distribution's parameter \(\pi\) were based on normal approximations to the number or proportion of successes. However a hypothesis test can be performed using binomial probabilities without the need for this normal approximation.
A \((1 - \alpha)\) confidence interval for a parameter \(\theta\) can be found as follows:
Exact confidence interval for \(\pi\) when \(n = 20\) and \(x = 7\)
For a 2-tailed hypothesis test with H0: \(\pi = \pi_0\), we can use the test statistic
\[ X \;\;\sim\;\; \BinomDistn(n=20, \pi_0) \]For any value of \(\pi_0\), the p-value is double the smaller tail probability from this binomial distribution,
\[ 2 \times P(X \le 7 \mid \pi = \pi_0) \spaced{or} 2 \times P(X \ge 7 \mid \pi = \pi_0) \]For a test at significance level \(\alpha = 5%\), we reject H0 if the p-value is less than 0.05.
A 95% confidence interval for \(\pi\) consists of the values \(\pi_0\) that are not rejected in this test. By trial-and-error with different values of \(\pi_0\), we find the following p-values,
H0 is only accepted at the 5% significance level for values of \(\pi_0\) between these, so the exact 95% confidence interval is
\[ 0.154 \;\;\lt\;\; \pi \;\;\lt\;\; 0.592\]