# Questions about Confidence Interval

could somebody please help me with this question.
"What will happen to Confidence Interval if you change from using sample SD to population SD? Would the CI you calculated previously increase, decrease or remain?" As I think the replacement of population SD will make the confidence interval more accurate but not sure why. Please help me if you know the answer.

• That depends on tail heaviness and length. – Carl May 5 '20 at 3:24

## 1 Answer

If the population variance $$\sigma^2$$ is known, then you should use it. Then a 95% CI for the unknown normal population mean $$\mu$$ would be a z interval of the form $$\bar X \pm 1.96\frac{\sigma}{\sqrt{n}}.$$

If you decided to ignore the known value of $$\sigma$$ estimating it by the sample standard deviation $$S,$$ then a 95% t interval would be of the form $$\bar X \pm t^*\frac{S}{\sqrt{n}},$$ where $$t^*$$ cuts probability 0.025 from the upper tail of Student's t distribution with $$n - 1$$ degrees of freedom.

For small $$n,$$ the value $$t^*$$ is noticeably larger than $$1.96,$$ so the CI would tend to be larger on that account. However, there is no way to know whether the estimate $$S$$ is larger or smaller than $$\sigma.$$ For large $$n,$$ you'd have $$t^* \approx 1.96,$$ but but $$S$$ can still be either larger or smaller than $$\sigma.$$

The bottom line is that you don't know the relationship between $$S$$ and $$\sigma,$$ so it is not possible to know whether the z or t interval is longer.

Consider the example below with $$n=50$$ observations from $$\mathsf{Norm}(\mu=100,\sigma=15).$$

set.seed(2020)
x = rnorm(50, 100, 15);  mean(x);  sd(x)
 101.8843
 16.67984


So $$S = 16.68 > \sigma = 15.$$ The 95% t confidence interval $$(97.144, 106.625)$$ from R is shown below. Its length is $$9.481.$$ If you want to check it by hand (within rounding error), then use $$t^* = 2.01$$ and $$S = 16.68.$$

t.test(x)$conf.int  97.14397 106.62469 attr(,"conf.level")  0.95 qt(.975, 49)  2.009575  And the 95% z interval is $$(97.727, 106,042),$$ which happens to be shorter (length $$8.316)$$ because $$\sigma < S.$$ pm = c(-1,1) mean(x) + pm*1.96*15/sqrt(50)  97.72654 106.04212  The expected length of a 95% t confidence inter for a sample of size $$n=50$$ from $$\mathsf{Norm}(\mu=100,\sigma=15)$$ is about $$8.48,$$ based on the simulation below---shorter than for the t interval in the example above. Because the length of the z interval with $$\sigma=15$$ and $$n = 50$$ is not random, we can say that in this case the average 95% t interval is (a little) longer than the z interval. set.seed(2020) len = replicate(10^5, diff(as.numeric(t.test(rnorm(50,100,15))$conf.int)))
mean(len)
 8.481077