Estimating Prevalence Using an Imperfect Test

The standard estimate of prevalence is the proportion of positive results obtained from the application of a diagnostic test to a random sample of individuals drawn from the population of interest. When the diagnostic test is imperfect, this estimate is biased. We give simple formulae, previously described by Greenland (1996) for correcting the bias and for calculating confidence intervals for the prevalence when the sensitivity and specificity of the test are known. We suggest a Bayesian method for constructing credible intervals for the prevalence when sensitivity and specificity are unknown. We provide R code to implement the method.


Introduction
The prevalence, θ, of a disease is the proportion of subjects in the population of interest who have the disease in question [1, page 46].A standard way to estimate prevalence is to apply a diagnostic test to a random sample of n individuals and use the estimator where T is the number of individuals who test positive.The sensitivity, se, of a diagnostic test for presence/absence of a disease is the probability that the test will give a positive result, conditional on the subject being tested having the disease, whilst the specificity, sp, is the probability that the test will give a negative result, conditional on the subject not having the disease.An imperfect test is one for which at least one of se and sp is less than one.An imperfect test may give either or both of a false positive or a false negative result, with respective probabilities 1−sp and 1−se.A similar issue arises in individual diagnostic testing.In that context, prevalence is assumed to be known and the objective is to make a diagnosis for each subject tested.Important quantities are then the positive and negative predictive values, defined as the conditional probabilities that a subject does or does not have the disease in question, given that they show a positive or negative test result, respectively.Even when both se and sp are close to one, the positive and negative predictive values of a diagnostic test depend critically on the true prevalence of the disease in the population being tested.In particular, for a rare disease, the positive predictive value can be much smaller than either se or sp.

Estimation of Prevalence
Suppose that an imperfect test is applied to a random sample of n subjects, T of whom give a positive result.The standard estimator θ given by ( 1) is now biased for θ.Let φ denote the expectation of θ.Then, the relationship between θ and φ is linear, and given by (2) [2].Under the reasonable assumption that se + sp > 1, that is, that the test is superior to the toss of a coin and φ is an increasing function of θ.It follows that if the values of se and sp are known a confidence interval, (a, b) say, for φ can be converted straightforwardly to a confidence interval (c, d) for θ by applying the pair of transformations ( See Figure 1 for an illustration.
Typically, when the true prevalence is low, φ > θ and the effect of the bias correction is to shift the interval estimate of prevalence towards lower values.For example, if se = sp = 0.9 and θ = 0.01, then φ = 0.108.As the true prevalence increases, the relative difference between φ and θ decreases; for example, if se = sp = 0.9 as before but now θ = 0.2, then φ = 0.26.

Unknown Sensitivity and Specificity
If se and sp are unknown, θ can still be estimated, albeit with reduced precision, using a Bayesian approach.This requires us to specify a prior distribution for θ and informative prior distributions for se and sp (informative, because the data give essentially no information about se or sp).Assume temporarily that se and sp are both known.The sampling distribution of T, the number of positive test results out of n individuals tested, given θ is binomial, with number of trials n and probability of a positive outcome φ = c 1 + c 2 θ, where c 1 = 1 − sp and c 2 = se + sp − 1.A convenient, uninformative prior for θ is the uniform distribution on (0, 1).The marginal distribution of T is then obtained as where is the incomplete beta function.The posterior distribution for θ given se and sp follows as where h(t) is given by (4).Finally, to allow for the uncertainty in se and sp, we substitute c 1 = 1 − sp and c 2 = se + sp − 1 on the right-hand-side of (6) and integrate with respect to the joint prior, p(u, v) say, for se and sp, to give the posterior distribution for θ as 1.96 2 θ(1 − θ) gives a 95% confidence interval for θ as (0.122, 0.278).If we assume that se = sp = 0.9, inversion of (2) gives the corrected estimate θ = (0.2 − 0.1)/0.8= 0.125, whilst (3) gives the corresponding 95% confidence interval as (0.042, 0.236).We now assume that se and sp are unknown and specify independent beta prior distributions, each with parameters α = β = 2 but scaled to lie in the interval (0.8, 1); hence, the prior for each of se and sp is unimodal wit prior expectation 0.9.A 95% Bayesian credible interval for θ is (0.003, 0.246), wider than and shifted to the left of the classical confidence interval.Incidentally, the corresponding 95% Bayesian credible interval for θ assuming known se = sp = 0.9 is (0.038, 0.230).This is much closer to the classical confidence interval, which is as expected since we have specified an uninformative prior for θ. Figure 2 shows the posterior distributions for θ assuming known or unknown se and sp.The greater spread of the latter represents the loss of precision that results from not knowing the sensitivity and specificity of the test.

Discussion
When both se and sp are close to one, the absolute bias of the uncorrected estimator defined in (1) is small but the relative bias may still be substantial.Also, in some settings, practical constraints dictate the use of tests with relatively low sensitivity and/or specificity.An example is the use by the African Programme for Onchocerciasis Control of a questionnaire-based assessment of community-level prevalence of Loa loa in place of the more accurate, but also more expensive and invasive, finger-prick blood-sampling and microscopic detection of microfilariae [3].
The simple method described here to take account of known sensitivity and/or specificity less than one is rarely described explicitly in epidemiology text books.For example, [4, Section 4.2] note that it is "possible to correct for biases. . .due to the use of a nonspecific diagnostic test" but give no details, perhaps because their focus is on comparing efficacies of different treatments rather than on estimating prevalence.
Exactly the same argument would apply to the estimation of prevalence in more complex settings.For example, where prevalence is modelled as a function of explanatory variables, say θ = θ(x), an interval estimate for θ(x) can be calculated at each value of x by applying (3) to the corresponding interval estimate of φ(x).
The Bayesian method for dealing with unknown se and sp does not yield explicit formulae for point or interval estimates of prevalence, but the required computations are not burdensome; an R function is listed in the Algorithm and can be downloaded from the author's web-site (http://www.lancs.ac.uk/staff/diggle/prevalence-estimation.R/).

Appendix
For more details, see Algorithm 1.

Figure 1 :Figure 2 :
Figure1: Converting an interval estimate of φ, the probability of a positive test result, into an interval estimate of θ, the true prevalence, for a test with sensitivity 0.9 and specificity 0.75.The vertical and horizontal arrows denote the interval estimates of φ and θ, respectively.