# Computing 95% confidence interval

The question:

The gas in bubbles within amber should be a sample of the atmosphere at the time the amber was formed. Measurements on specimens of amber 75 million years ago give these percents of nitrogen: 63.4, 65.0, 64.4, 63.3, 54.8, 64.5, 60.8, 49.1, 51.0. Construct a 95% confidence interval for the true average % nitrogen in the atmosphere at this time.

My attempt:

I used the following formula for confidence intervals from my textbook:

"A 100(1-$$\alpha$$)% confidence interval for $$\mu$$ is $$(\bar{X} - t_{n-1, 1-\frac{\alpha}{2}} \frac{S}{\sqrt{n}}, \bar{X} + t_{n-1, 1-\frac{\alpha}{2}} \frac{S}{\sqrt{n}})$$."

I know $$\bar{X}$$ is 59.6, and $$n$$ is 9. But there are 2 things I'm having trouble with:

Firstly, in the answers they say that $$S$$ is 6.25 when I am calculating it to be 5.89.

Secondly, I'm having trouble finding $$t_{n-1, 1-\frac{\alpha}{2}}$$. According to the solutions, it is 2.31. But I'm not sure where they got that number from, or how to find $$t_{n-1, 1-\frac{\alpha}{2}}$$ in general? I thought it was supposed to be 1.96 but that's incorrect. Any help is appreciated.

• 1.96 is $z_{0.975}$, but you’re apparently using $t$ instead of $z$. A z-score uses the normal distribution, but $t$ comes from Student’s t distribution. – Joe Aug 29 at 12:23
• Got it, thanks. I also now understand where I went wrong in calculating S - I accidentally calculated the population standard deviation instead of the sample one. – scott Aug 29 at 12:33
• My (unbiased) estimated standard deviation is $6.255286653$. Rounded to two decimal places it is $\hat \sigma=6.26$ – callculus Aug 29 at 12:49
• How do we know when to use the sample standard deviation vs the population standard deviation, and the t distribution rather than a normal distribution, when calculating confidence intervals? – scott Aug 29 at 13:10

Values of the $$t$$-distribution are read from a table, for example here: http://www.sjsu.edu/faculty/gerstman/StatPrimer/t-table.pdf
Since you have nine samples, the degrees of freedom is equal to $$n-1 = 8$$.
You are using the two-tails confidence interval with $$\alpha=0.05$$ and therefore one half of the tail is equal to $$1-0.025$$.
Therefore, you must read off the value $$t_{8,0.025}$$, which, according to the table, is approximately equal to $$2.306$$.
• Thanks, I understand that now. Just a quick question - how do i know when to use $t_{n-1, 1-\frac{\alpha}{2}}$ and when to use $z_{1 - \frac{\alpha}{2}}$? – scott Aug 29 at 13:04
• The $t$-distribution applies to cases where you are trying to find out the true mean of a population for which you don't know the true variance. But if the number of samples is large (let's say, more than 30), the $t$-distribution approximates the $z$-distribution quite well. So in summary, if you don't know the true variance AND the number of samples is small, use $t$; otherwise use $z$. – Matti P. Aug 30 at 5:16