Find confidence level given a confidence interval I have a normally distributed dataset and an associated systematic error. I want to know the probability a measured value falls within this error range. 
So I think the I want to find the confidence level given a confidence interval on a normally distributed curve. 
I understand you would normally find a confidence interval given a confidence level but I cannot seem to find any pieces of code which work in the opposite direction.
Any advice is appreciated!
 A: If my comment is correct, then you don’t want to find the confidence interval. However, I think it would be valuable to find the confidence level, given the confidence interval.
Here is the formula for a usual confidence interval of the mean when the variance is unknown.
$$\bar{x}\pm t_{df, 1-\alpha/2} \dfrac{s}{\sqrt{n}}$$
Let’s call the confidence interval $(a, b)$.
First, notice that there is symmetry about $\bar{x}$. This means that we can focus on one side.
We know that half of the width of the confidence interval is $b-\bar{x}$, so: 
$$b-\bar{x} = t_{df, 1-\alpha/2} \dfrac{s}{\sqrt{n}}$$
We now do the algebra to solve for $t$.
We know that $df=n-1$, so we look up $\sqrt{n}(b-\bar{x})/s=t$ in a reference table. Software will do that for us. Here is R code:
pt(t, df)

We now have $1-\alpha/2$. Now solve for $\alpha$. 
$1-\alpha$ is the confidence level.
A: I don’t believe the Confidence Interval is giving you what you think. It doesn’t say that there is an XX % probability that any particular measurement is within the CI. It says that, if you repeated the entire process of forming the CI a large number of times, the correct true mean is within XX % of the intervals formed. 
To be able to say a single (future) measurement is within a particular range, you want to form a Prediction Interval. Or, if you want to to say a certain proportion of all future measurements are within a certain range, then you want a Tolerance Interval. 
Or, if you want to become a Bayesian, you can form a Posterior Predictive Interval. 
