# Upper & lower bound of confidence interval of mean

Let's say that I want to compute confidence interval of mean for a purity of crystal. I know for fact that purity of any chemical substance cannot exceed 100%. How can I construct confidence interval of mean, which a statistic that has upper, or lower bound?

Assume the following:

1. sample size = 21, std = 3, mean = 99.1
2. samples are normally distributed
3. upper bound of mean is 100

With Scipy, I can construct its 95% confidence interval like this:

stats.t.interval(1 - 0.05, 21 - 1, loc=99.1, scale= 3 / np.sqrt(21))
>>> (97.73441637228476, 100.46558362771523)


The calculated upper bound for the confidence interval of mean exceeds 100, which is not physically possible in real life.

How do I deliver my conclusion in this case? Is truncating my interval above 100 good, like this?

>>> (97.73441637228476, 100)

Or is there any special modification that I need to make?

• I'd try a logistic regression or beta regression. See this post. Commented Jun 30, 2019 at 9:17