Calculating confidence interval for cross-sectional study with dichotomous variables I am conducting an epidemiological study and will have results that tell me which proportion of my population will have immunity to a certain disease. The results here will be immune / not immune with no gray area. A positive ELISA will indicate "immune" 
I have the values for the specifity (99,81%) and sensitivity (86%) of the ELISA I am using but I don't know how to get to the 95% confidence interval from my "X% of the population is immune". 
Thank you for your help!
 A: I'm guessing that statements in my Comment are true, and supposing
that you have results from $n$ tests of which $a$ give positive results. Then you have an estimate for $\tau,$ the number of
positive tests: $\hat \tau = t = a/n.$
Confidence interval for proportion testing positive. Also assuming that the sample size $n$ is large enough for a Wald confidence interval to be valid, you would have the 95% CI for
$\tau$ as follows:
$$t \pm 1.96\sqrt{\frac{t(1-t)}{n}}.$$
But the proportion testing positive is not the prevalence (or in your terminology the percentage immune).
Confidence interval for proportion immune. Letting $\pi = P(\mathsf{Immune})$ and $\eta =$ Sensitivity,
$\theta =$ Specificity (both as in my Comment), one has
from the Law of Total Probability that
$$\tau = \pi\eta + (1-\pi)(1-\theta).$$ 
Solving for $\pi$ one has
$$\pi = \frac{\tau + \theta - 1}{\eta + \theta - 1}.$$
So you can get a point estimate for $p$ for $\pi$ from the point estimate $t$ for $\tau$ by substitution:
$$p = \frac{t + \theta - 1}{\eta + \theta - 1}.$$
However, the estimate $p$ does not arise from binomial sampling,
so one cannot use $t$ to make a Wald interval directly.
A 95% confidence interval for $\pi$ results from using the displayed equation just above to transform the endpoints
of the Wald interval for $\tau.$
For example, suppose $t = a/n = 700/1000 = 0.7$ and the Wald interval is $(0.672, 0.728).$  Then the corresponding 95% CI
for $\pi$ is $(0.781, 0.846).$
(c(0.672, 0.728) + .9981 - 1)/(.86 + .9981 - 1)
[1] 0.7809113 0.8461718

Notes: In cases where $t$ is near $0$ or $1$ and sensitivity and/or
specificity are poor, the 95% CI for $\pi$ found by this method
may not be contained in $(0,1).$ Then the Gibbs Sampler in the link of my Comment can provide a way to get a reasonable
Bayesian posterior probability interval ('credible interval').
If a beta prior distribution [which has support $(0,1)]$ is used for the parameter $\pi,$ then the posterior distribution must
also have support $(0,1)$ and the Bayesian interval estimate
must be contained in the unit interval.
(2) If your $n$ is in the low hundreds or below, then use the
Agresti-Coull confidence interval for $\tau$ instead of the Wald interval.
(3) Reference: Suess & Trumbo (2010) Introduction to probability simulation and Gibbs sampling with R, Ch. 5. 
