# Hypothesis testing using the 95% Confidence Interval of Sample Mean

I have a population mean of 120 (mu). I have a sample distribution with a mean of 131.05 and a standard-deviation of 11.00945. I have a sample size of 20, 19 degrees of freedom (n-1). I am performing a one-sample t-test.

When I calculate the 95% confidence interval using my sample mean (131.05), can I use that interval to reject the null hypothesis or to not reject the null hypothesis that the difference between the population mean and sample distribution mean is 0 (or that there is not a difference between the two means?

I had read that if my 95% confidence interval includes 0, then I do not reject the null hypothesis that the mean difference is 0. However, the confidence interval that I calculated does not contain 0. My professor for biostatistics has also said this. Source: http://www.jerrydallal.com/lhsp/ci.htm

95% Confidence Interval Equation: SampleMean +/- 2*StandardError

[131.05-4.9235] = 126.13

[131.05+4.9235] = 135.97

The hypothesis that I am testing is, is there a difference between the population mean (mu = 120) and the sample distribution mean (y bar = 131.05).

Can I deduce that, since the population mean (120) is not within the 95% interval (126.13 to 135.97), that the null can be rejected? I did obtain a low p-value which agrees with this. My interval does not contain 0, so I am confused in that regard.

• I suspect you do not know that the population mean is $120$ but you may have a null hypothesis that it is $120$ and an alternative hypothesis that it is not $120$. If so, you can use the confidence interval in the way you suggest Commented Jan 9, 2019 at 23:38
• I believe that I had a misunderstanding of what the null hypothesis was to begin with. My null would be that mu = 120 in this case. When would I use a null hypothesis that the difference between the sample and population mean is 0? For example, if I obtained a data statistic from the population bureau that 5ft8 is the average height of an adult in the U.S, I do not have that distribution. Suppose I want to see if the average height at my college is different from the U.S average. How would my interpretation of the 95% Confidence Interval change? @Henry Commented Jan 9, 2019 at 23:49
• The distribution of heights in the US is sometimes said to be roughly normally distributed with mean about 68 in and SD about 3.5 in. Men are a little taller and women a little shorter. There are somewhat different ethnic mixtures in different parts of the US and that is another source of variability. But for the connection between hypothesis testing and confidence intervals, it may be better to stay closer to your original question. Commented Jan 10, 2019 at 6:33

In inferential statistics, the population mean is unknown and it must be inferred from the sample data. In the referenced source it is stated at the beginning:

Confidence Intervals are a way of taking data from a sample and saying something about the population from which the sample was drawn.

I have a population mean of 120 (mu).

I am performing a one-sample t-test.

The hypothesis that I am testing is, is there a difference between the population mean (mu = 120) and the sample distribution mean (y bar = 131.05).

Although the referenced source does not perform hypothesis test and does not use the phrases "reject" or "fail to (or not) reject", you can still use the confidence intervals for this purpose.

The first step in the hypothesis testing process is to state the null and alternative hypotheses. Note that it is always stated with respect to the population parameter (not the sample statistic): $$H_0:\mu=120\\ H_a: \mu\ne 120$$ Just to make sure where in your confidence interval the critical value $$2$$:

95% Confidence Interval Equation: SampleMean +/- 2*StandardError

comes from. The formula is: $$\mu=\bar{y}\pm \color{red}z_{\alpha/2}\cdot \frac{\sigma}{\sqrt{n}} \ \ \text{or} \ \ \mu=\bar{y}\pm \color{red}t_{\alpha/2}\cdot \frac{s}{\sqrt{n}}$$ You must use $$z_{0.025}=1.96 \ (\approx 2)$$, when $$\sigma$$ is known and $$n\ge 30$$ and $$t_{0.025,19}=2.0930 \ (\approx 2)$$, otherwise. Since in your problem $$\sigma$$ is unknown and $$n=20<30$$, you are supposed to use $$t$$.

Can I deduce that, since the population mean (120) is not within the 95% interval (126.13 to 135.97), that the null can be rejected?

The confidence interval is: $$131.05-2.09\cdot \frac{11.00945}{\sqrt{20}}\le \mu \le 131.05-2.09\cdot \frac{11.00945}{\sqrt{20}}\\ 125.9\le \mu \le 136.2$$ Yes, you can reject the null hypothesis $$H_0:\mu=120$$ at the significance level $$\alpha=0.05$$, because $$120$$ falls outside of this confidence interval.

I did obtain a low p-value which agrees with this.

The test statistic is: $$t=\frac{\bar{y}-\mu}{s/\sqrt{n}}=\frac{131.05-120}{11.00945/\sqrt{20}}\approx 4.49;\\ p(t>4.49)=0.0001<0.025=\alpha/2 \Rightarrow \text{Reject H_0}.$$

To me, the statement of your Question seems imprecise and I can't get exactly the results you show. Let me give you some information on what you can and cannot say based on the data you provide.

From Minitab, a hypothesis test of $$H_0: \mu=120$$ vs $$H_a: \mu \ne 120$$ and a 95% confidence interval for $$\mu,$$ based on the information you provide, are as follows:

One-Sample T

Test of μ = 120 vs ≠ 120

N    Mean  StDev  SE Mean       95% CI          T      P
20  131.05  11.01     2.46  (125.90, 136.20)  4.49  0.000


First, you can reject $$H_0$$ at a level below $$\alpha = 0.001 = 0.1\%.$$ So you can also reject at the 5% level. This is from the t statistic and the P-value in the output.

Second based on the confidence interval, you can reject any null hypothesis $$H_0: \mu = \mu_0$$ at the 5% level against the two-sided alternative, provided that $$\mu_0$$ does not lie in the 95% CI $$(125.9, 136.2).$$

So, for example, you can reject $$H_0: \mu = 124$$ vs. $$H_a: \mu \ne 124$$ at the 5% level (124 lies outside the interval). And once again, you can also reject $$H_0: \mu = 120$$ (120 also lies outside the interval).

However, you cannot reject $$H_0: \mu = 128$$ vs. $$H_a: \mu \ne 128$$ (128 lies inside the interval). In this sense, you may view the 95% CI as an interval of values $$\mu_0$$ that lie so close to $$\bar X = 131.05$$ that they are "not rejectable."

Note: I have no way of knowing whether the discrepancy between my CI and yours is based on a typo in the information provided or on an error in computation. I hope you can begin by proofreading and re-computing as necessary.