Learn R Programming

BayesianFROC (version 0.2.3)

CoronaVirus_Disease_2019_prevalence: Who should be inspected?

Description

Even if we test all people, the result is true with very low probabilties.

Usage

CoronaVirus_Disease_2019_prevalence(pre, se, sp)

Arguments

pre

Prevalence of population

$$Prob(Truth = diseased | Diagnosis = Positive) = \frac{Se\times pre}{Se \times pre + (1-pre)\times(1-sp)} $$

se

Sensitivity of a diagnostic test

sp

Specificity of a diagnostic test

Value

same as CoronaVirus_Disease_2019()

Details

--------------------------------------------------------------------------

Diagnosis \ truth

Diseased Non-diseased -----------------------
----------------------- ------------- Positive se*n
\((N-n)(1-sp)\) Negative (1-se)*n \((N-n)sp\)
----------------------- ----------------------- -------------
n \(N-n\)

Diagnosis \ truth

Diseased

-------------------------------------------------------------------------

For example,

if prevalence is 0.0001,

population is 10000,

specificity = 0.8,

sensitivity = 0.9,

then the table is the following.

We can calculates the probability of the event that a one whose diagnosis is positive is really diseased is

$$ \frac{9}{1998 + 9} = 9/(1998+9) = 0.00448 percent $$

--------------------------------------------------------------------------

Diagnosis \ truth

Diseased Non-diseased -----------------------
----------------------- ------------- Positive 9
1998 Negative 1 7992
----------------------- ----------------------- -------------
\(n = 10\) \(N-n=10000-10\)

Diagnosis \ truth

Diseased

-------------------------------------------------------------------------

See Also

CoronaVirus_Disease_2019()

Examples

Run this code
# NOT RUN {
CoronaVirus_Disease_2019_prevalence(0.0001, 0.9,0.8)
CoronaVirus_Disease_2019_prevalence(0.03,0.9,0.8)
CoronaVirus_Disease_2019_prevalence(0.3,0.9,0.8)



#========================================================================================
#  If Sensitivity and Specificity is larger, then, the probability is also larger
#========================================================================================


x <- stats::runif(100,0,1)
y <- CoronaVirus_Disease_2019_prevalence(0.1,x,x)

dark_theme(4)
plot(x,y)


#========================================================================================
#  If the prevalence is larger, then, the probability is also larger
#========================================================================================



x <- stats::runif(100,0,1)
y <- CoronaVirus_Disease_2019_prevalence(x,0.9,0.9)

dark_theme(4)
plot(x,y)


# }

Run the code above in your browser using DataLab