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:
- sample size = 21, std = 3, mean = 99.1
- samples are normally distributed
- 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?