CoronaVirus_Disease_2019_prevalence: Who should be inspected?

Description Usage Arguments Details Value See Also Examples

View source: R/CoronaVirus_Disease_2019.R

Description

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

Usage

1

Arguments

pre

Prevalence of population

se

Sensitivity of a diagnostic test

sp

Specificity of a diagnostic test

Details

————————————————————————–

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

————————————————————————-

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 positive-diagnosis correctly detects the diseased patient is

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

————————————————————————–

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

————————————————————————-

Value

same as CoronaVirus_Disease_2019()

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

where we denotes the conditional probability measure of an event A given the assumed occurrence of G as an usual manner

P(A|G):= \frac{P(A \cap G)}{P(G)}.

See Also

CoronaVirus_Disease_2019()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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(1111,0,1)
y <- CoronaVirus_Disease_2019_prevalence(0.1,x,x)

dark_theme(4)
plot(x,y)








x <- stats::runif(1111,0,1)
y <- CoronaVirus_Disease_2019_prevalence(0.01,x,x)

dark_theme(4)
plot(x,y)






x <- stats::runif(1111,0,1)
y <- CoronaVirus_Disease_2019_prevalence(0.001,x,x)

dark_theme(4)
plot(x,y)





#========================================================================================
#  linear case:
#
#   If prevalence is 0.5
#       and sensitivity = specificity
#   then, the probability is exactly same as sensitivity = specificity
#
#========================================================================================



x <- stats::runif(1111,0,1)
y <- CoronaVirus_Disease_2019_prevalence(0.5,x,x)

dark_theme(4)
plot(x,y)


sum(x==y)==length(x)

# Because the last is true, the probablity is same as sensitivity
# when the prevalence is 0.5.












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



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

dark_theme(4)
plot(x,y)

BayesianFROC documentation built on Jan. 13, 2021, 5:22 a.m.