Добавил:
Sekretar
kiopkiopkiop18@yandex.ru
t.me/Prokururor I Вовсе не секретарь, но почту проверяю
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_155_библиотеки_им_акад_М_И_Перельмана
.pdf
4.4 Conditional Probability 73
4.4 Conditional Probability
Conditional probability is a measure of the probability of an event occurring, given
that another event (by evidence) has already occurred. It is a tool that lets you
comment about some related uncertain events are. It also lets you explain about
how the probability of an event can vary under different conditions. In probability
theory, conditional probability is very important and a is one of the fundamental
concepts.
If the interested event is A and the you know that event B has occurred, “the
conditional probability of A Given B”, or “the probability of A under the condition
B”, is usually written as P(A|B).
P
(
A|B
)
=
Joint probability of A and B
marginal probability of B
=
P(A ∩ B)
P(B)
.
The following relationships can be easily obtained:
P
(
A ∩ B
)
= P
(
A|B
)
× P
(
B
)
,
P
(
A|B
)
P
(
A
)
=
P
(
B|A
)
P
(
B
)
,
P
(
A ∩ B
)
= P
(
A|B
)
× P
(
B
)
= P
(
B|A
)
× P
(
A
)
.
Note that conditional probability does not state that there is always a causal
relationship between the two events, as well as it does not indicate that both events
occur simultaneously.
Example 4 Table 1.4 shows the number of people in a population of 100,000 in an
area and the mortality rate per thousand populations by age. What is the probability
that a person from this area will die at the age of 51?
Solution: If A = “probability of survival up to 50 years” and B = “probability of
death between 50 and 51 years”, we have:
Age No. of alive Mortality rate
50 90,718 6.43
51 90,135 7.00
52 89,504 7.62
53 88,822 8.30
54 88,085 9.03
55 87,290 9.77
56 86,437 10.60
57 85,521 11.56
58 84,532 12.71
59 83,448 13.98
60 82,291 15.42
https://t.me/med1917

74 4 Probability
P
(
A
)
=
90718
10000
= 0.90718.
The probability of dying before the age of 50 is equal to:
P
A
= 1 − P
(
A
)
= 1 − 0.90718 = 0.09282.
The probability of dying between the ages of 50 and 51 is equal to:
P
(
B
)
=
90718 − 90135
10000
= 0.00583.
In this case P
(
A ∩ B
)
= P
(
B
)
, then:
P
(
A ∩ B
)
= P
(
B
)
= 0.00583.
Therefore, the probability of death at any particular age is obtained using
conditional probability, because it means that the person in question must be alive
before that year. In other words, the probability of a person dying at the age of 51
as long as we know he was alive before that age (50 years).
P
(
B|A
)
=
P
(
A ∩ B
)
p(A)
=
0.00583
0.90718
= 0.00643.
This means that the probability that a person who has passed the age of 50 will
die between the ages of 50 and 51 is 0.00643.
Example 5 Sixty % of the students in a university are female and a 30% of them
are local students. We know that 10% of the students are local females. What is the
probability that a local student be female?
Solution: We note “F” for Female, “L” for local students, F ∩ L = for local female
students, and “F|L” for being a female given that the student is local. Then P (F) =
0.60, P (L) = 0.30, and
P(F ∩ L) = 0.10.
Using conditional probability, the probability of being a female given that the
student is local is:
P
(
F|L
)
=
P(F ∩ L)
P(L)
=
0.10
0.30
= 0.33
https://t.me/med1917

4.5 Bayes’ Theorem 75
4.5 Bayes’ Theorem
Bayes’ theorem represents an extension of conditional probability, serving as a
method for categorizing phenomena based on supplementary information regarding
the event’s occurrence. This additional information typically comprises prior
knowledge concerning conditions that may be associated with the event, including
probabilities of other phenomena occurring or not. Essentially, Bayes’ theorem
facilitates the determination of a probability (posterior) when certain other
probabilities (prior) are known. It operates as a mathematical principle governing
the adjustment of beliefs considering evidence presented.
The logic of equation is:
Posterior = Prior ×
Likelihood
Marginal probability
,
P
(
A|B
)
= P(A) ×
P(B|A)
P(B)
,
where:
The prior probability, also known as the previous probability, refers to the
probability of an event before new data is gathered. It represents the most rational
assessment of the probability of an outcome based on existing knowledge before
conducting an experiment.
On the other hand, the posterior probability denotes the revised or updated
probability of an event occurring after incorporating new information. It’s essential
to note that posterior probability is distinct from likelihood and reflects the updated
probability following the consideration of fresh data.
Likelihood is another conditional probability. It is the probability of the evidence
being present, given that the hypothesis is true. Remember, this is not the same as
the posterior!
Marginal probability is the probability of the evidence, under any circumstance.
This means the probability of the evidence being present, whether the hypothesis is
true or false.
Bayes’ theorem is important and widely used in probability theory. The
Bayesian method is used when the values of P(A) and P(A ∩ B) are not directly
available to obtain P(B|A). Indeed, the probability of an event can be computed by
conditioning it on the occurrence or non-occurrence of another event. Often,
calculating the probability of an event directly can be challenging. However, by
leveraging Bayes’ theorem and conditioning one event on another, it becomes
possible to derive the probability. This approach enables a systematic and effective
method for calculating probabilities, especially in scenarios where direct
computation is impractical.
The relation p
(
A
)
= p
(
A ∩ B
)
+ p(A ∩ B), which its accuracy is easily proved, is
used to prove Bayesian rule. The following rule, known as Bayesian rule, is derived
from the conditional probability formula.
https://t.me/med1917

76 4 Probability
p
(
B|A
)
=
p(B ∩ A)
p(A)
=
p(A ∩ B)
p
(
A ∩ B
)
+ p(A ∩ B)
=
p
(
A|B
)
p(B)
p
(
A|B
)
p
(
B
)
+ p(A|B)p(B)
.
Example 6 The physician’s diagnosis is usually based on the patient’s laboratory
results. Both the lab results and the doctor’s diagnosis may be erroneous (that is,
a person may be really healthy, but the doctor may diagnose him/her ill, or s/he is
really ill, but the doctor diagnoses him/her as healthy). Assume that the probability
of being actually ill is 0.3 and the probability of error in the laboratory tests is 0.06.
Find the probability of being actually ill for a person whom was diagnosed as ill by
the doctor has.
Solution: Suppose A is defined as “the person is diagnosed ill”, B is “the person is
actually ill”, and
B is “the person is healthy”.
According to Bayes’ rule:
The probability that the person is actually ill = p
(
B
)
= 0.3.
The probability that the person is healthy p(B) = 1 − 0.3 = 0.7.
Probability that the relevant tests are correct p
(
A|B
)
= 0.9.
Probability of error in tests p
A|B
= 0.1.
Therefore, the probability of correctly diagnosing a patient, i.e., the actually ill
person diagnosed by the doctor sick is equal to:
p
(
B|A
)
=
p
(
A|B
)
p(B)
p
(
A|B
)
p
(
B
)
+ p(A|B)p(B)
=
0.3 × 0.9
0.3 × 0.9 + 0.7 × 0.06
= 0.865.
Example 7 Medical tests can occasionally yield inaccurate results, prompting us
to introduce uncertainty by employing probabilities. Let’s denote A as the event
signifying a positive test outcome for a virus in a person, while B represents the
event indicating the individual’s actual infection with the virus. Assuming that the
virus affects 2% of the population and given a conditional probability of 0.995 for a
positive test result given that the person has the virus (denoted p(A|B)), we
establish these conditions to model uncertainty in the testing process. Also,
suppose the conditional probability that a person not having the virus tests positive
(a false positive) is
p
A|B
= 0.01. Find out the probability that the test result of
someone who has actually the virus is positive
p
(
B|A
)
. In other words, when a
person tests positive, how likely is it that person is actually infected with the virus?
Solution: In this example, the following probabilities are given:
The probability that a person is infected is equal to
(
B
)
= 0.02
.
Probability of not having the virus is: p
B
= 1 − p
(
B
)
= 1 − 0.02 = 0.98.
Conditional probability that the test is positive, given that the person has the virus,
is
p
(
A|B
)
= 0.995.
https://t.me/med1917

4.5 Bayes’ Theorem 77
Conditional probability that the test is positive, given that the person has not the
virus, is
p
A|B
= 0.01.
p
(
A
)
= p
(
A|B
)
.p
(
B
)
+ p
A|B
p
B
= (0.995 × 0.02) + (0.01 × 0.98) = 0.0297.
In this example, A is the event that the test of a person is positive and B is the
event that the person actually has the virus. Supposing a person test is positive and
using Bayes’ theorem, we are able to update the probability that the person has the
virus, the posterior probability
p
(
B|A
)
:
p
(
B|A
)
=
p
(
A|B
)
p(B)
p
(
A|B
)
p
(
B
)
+ p(A|B)p(B)
=
0.995 × 0.02
0.995 × 0.02 + 0.01 × 0.98
= 0.67.
The probability of having the virus has varied from 0.02 to 0.67.
p
(
Disease|test+
)
=
p
(
test +|disease
)
p(disease)
p(test+)
=
p
(
test +|disease
)
p(disease)
p
(
test +|disease
)
p
(
disease
)
+ p
(
test +|disease
)
p(no disease)
.
Example 8 A test to diagnose and screen arthritis in people over the age of 50 has
been suggested. According to national studies, 10% of this age group suffers from
this type of arthritis. The test result is 85% positive for people with confirmed arthritis
and 4% for healthy people without the disease (false positive). Obviously, for this
test to be useful in screening, the positive results of that test must indicate a high
percentage of disease, i.e., the P (D|T +) must be high.
Solution: We noted the event of arthritis = D, being healthy (no arthritis) = D,
positive test result = T+, and negative test result = T−. The given information in this
example is:
(
D
)
= 0.90, p
D
= 0.90, p
(
T −|D
)
= 0.15, p
T −|D
= 0.96,
and p
(
T +|D
)
= 0.85, p
T −|D
= 0.04.
In this example, P (D ∩ T +) and P (T +) are not given and cannot be obtained
directly from the conditional probability formula. They must be obtained in another
way.
This information can be seen in the “probability path” diagram.
https://t.me/med1917

78 4 Probability
D
D
T+
T+
T-
T-
0.1
0.9
0.15
0.85
0.96
0.04
0.1 × 0.85 = 0.085 = p(D|T+)
0.1 × 0.15 = 0.015 = p(D|T−)
0.9 × 0.04 = 0.036 = p(D|T+)
0.9 × 0.96 = 0.864 = p(D
_
_
_
|T−)
There are four paths in this chart. The sum of paths 1 and 3 gives the probability
of positive test result, p (T +), and the sum of paths 2 and 4 will the probability of
negative test result p (T−).
p
(
T +
)
= 0.085 × 0.036 = 0.121,
p
(
T −
)
= 0.015 × 0.864 = 0.879.
We now draw a tree path in the opposite direction.
According to this tree diagram and the conditional probability formula, the
probability of being ill a person with positive test result is obtained by dividing the
number 0.085 by 0.121:
X = p
(
D|T +
)
=
0.085
0.121
= 0.70.
Thus, if a person’s test is positive, there is a 70% chance that the person is actually ill.
The same value can be obtained by placing the above values in the Bayesian formula.
p(D|T +) =
p(T +|D) × p(D)
p
(
T +|D
)
× p
(
D
)
+ p(T +|D ) × p(D)
=
0.85 × 0.10
0.85 × 0.10 + 0.04 × 0.9
= 0.70.
D
T+
T-
0.121
0.879
x=?
0.085 = p(D|T+)
0.015 = p(D|T−)
0.036 = p(D
_
_
_
|T+)
0.864 = p(D|T−)
D
D
_
D
https://t.me/med1917

4.5 Bayes’ Theorem 79
Example 9 There are 3 red and 2 green marbles in the first urn and 2 red and 8 green
marbles in the second urn. Someone throws the dice. If the dice turns up multiple of
3 (3 and 6) sides, he chooses a marble from the urn I, otherwise a marble is chosen
from the urn II (but he does not reveal whether it has turned up multiple 3 or no, that
means we don’t know which urn has chosen). If the selected marble is red, what is
the probability that urn I was chosen?
Solution: If we denote R for event “red”, I for “urn I ”, and II for “urn II ”, the
following probability is given:
p
(
R|I
)
=
3
3+2
= 0.6, p
(
R|II
)
=
2
8+2
= 0.2.
p
(
I
)
=
2
6
=
1
6
and p
(
II
)
=
4
6
=
2
3
.
Calculating p
(
I|R
)
is the answer for the question, which is obtained as below.
p
(
I|R
)
=
p
(
I
)
· p(R|I)
p
(
I
)
· p(R|I) + p
(
II
)
· p(R|II)
=
1
3
(0.6)
1
3
(
0.6
)
+
2
3
(0.2)
= 0.6.
Example 10
An ambulance takes patients after inquiry, with a probability of 40%
to hospital A, a probability of 25% to hospital B, and a probability of 35% to hospital
C. The probability of infection of the patient in hospitals A, B, and C is equal to 0.6,
0.4, and 0.3, respectively. If your patient became infected after discharge from the
hospital, what is the probability that the ambulance took him or her to hospital C?
Solution: We denote “I ” for event of “infection” and A, B, and C for events of
different hospitals A, B, and C:
p
(
A
)
= 0.40, p
(
B
)
= 0.25, p
(
C
)
= 0.35,
p
(
I|A
)
= 0.60, p
(
I|B
)
= 0.40, p
(
I|C
)
= 0.30.
Calculating p
(
I|C
)
is the answer for the question.
p
(
I|C
)
=
p
(
I
)
· p(C|I )
p
(
I
)
× p
(
A|I
)
+ p
(
B
)
× p
(
R|B
)
+ p
(
I
)
× p(C|I )
=
0.35 × 0.3
(0.4 × 0.6) + (0.25 × 0.4) + (0.35 × 0.3)
=
0.105
0.24 + 0.10 + 0.105
=
0.105
0.445
= 0.236.
https://t.me/med1917

80 4 Probability
4.6 Bayes’ Theorem and Epidemiology
Bayesian theorem has many applications in epidemiology and public health. For
example, diagnostic and screening tests that vary along with the prevalence of
diseases can be obtained using the Bayes’ theorem. Suppose the following
contingency table in which the columns represent the disease status and rows show
the result of the diagnostic test.
Disease status
Positive Negative To t a l
Test Positive a = true positive b = false positive a + b
Negative c = false negative d = true negative c + d
Tota l a + c b + d n
Tips
Sensitivity (true positive rate) is the proportion of diseased people who have
been also diagnosed correctly positive by a diagnostic test.
Specificity (true negative rate) is the proportion of disease-free people who
have been also diagnosed correctly negative by a diagnostic test.
Positive predictive value (PPV) is the ratio of patients whose diagnostic test
results are also correctly diagnosed as positive.
Negative predictive value (NPV) is the ratio of patients whose diagnostic test
results are also correctly diagnosed as negative.
By dividing true values of positive or true negative (a or d) to marginal total gives
useful indices of sensitivity and specificity in epidemiology:
Sensitivity =
a
a + c
and Specificity =
d
b + d
.
And dividing false values of positive or true negative (b or c) to marginal total
gives useful indices in epidemiology:
PPV (positive predictive value) =
a
a+b
,
NPV (negative predictive value) =
d
c+d
.
The proportion of the observed total disease
(
a + c
)
to the sample size of the
study is named prevalence:
https://t.me/med1917

4.6 Bayes’ Theorem and Epidemiology 81
Prevalence =
a + c
n
.
The PPV and NPV give a direct assessment of the usefulness of the test in practice.
By employing Bayes’ theorem, we can assess the predictive capability of the test
across various population groups with different disease prevalences. This approach
allows us to calculate the probability of disease given a positive test result, enabling
us to understand how the test performs in different demographic subsets, such as
distinct age groups or the overall population.
p
(
D +|T+
)
=
p
(
T +|D+
)
× p
(
D+
)
p
(
T +
)
=
p
(
T +|D+
)
× p
(
D+
)
p
(
T +|D+
)
× p
(
D+
)
+ p
(
T +|D−
)
× p
(
D−
)
.
Conceptually we know that:
p
(
D+
)
= prevalence of disease,
p
(
D +|T+
)
= PPV,
p
(
D −|T−
)
= NPV,
p
(
T +|D+
)
= sensitivity,
p
(
T +|D−
)
= 1 − specificity.
During the application stage of a screening test in a target population, individual
disease statuses are typically unknown, as the purpose of screening is to identify
undetected cases. However, disease prevalence data can often be sourced from
national agencies and health surveys. Predictive values are then computed based on
this prevalence information.
PPV =
(
sensitivity
)
×
(
prevalence
)
(
sensitivity
)
×
(
prevalence
)
+
(
1 − specificity
)
×
(
1 − prevalence
)
,
NPV =
(specificity) × (1 − prevalence)
(specificity) × (1 − prevalence) +
(
1 − sensitivity
)
×
(
prevalence
)
.
Bayes’ theorem enables the calculation of predictive values without requiring data
from the application stage. Instead, all that’s necessary are the disease prevalence
(accessible from health ministries or other sources) and the sensitivity and specificity
of the screening test.
Example 11
Suppose the prevalence of Covid-19 in population A is 1% and in
population B is 0.5%, a diagnostic test (assume PCR) has 95% sensitivity and 99%
specificity. Calculate and interpret PPV and NPV for the disease.
Solution: We know that specificity = 99%, sensitivity = 95%, p (A) = 1%, and p(B)
= 0.5%.
For population A with 1% prevalence, we have:
https://t.me/med1917

82 4 Probability
PPV =
(
sensitivity
)
×
(
prevalence
)
(
sensitivity
)
×
(
prevalence
)
+
(
1 − specificity
)
×
(
1 − prevalence
)
=
0.95 × 0.01
0.95 × 0.01 +
(
1 − 0.99
)
×
(
1 − 0.01
)
=
0.95 × 0.01
0.95 × 0.01 + 0.01 × 0.99
=
0.0095
0.0095 + 0.0099
= 0.489.
Comment: In this population, about 48.9% of patients with positive PCR are
correctly classified as diseased.
NPV =
(specificity) × (1 − prevalence)
(specificity) × (1 − prevalence) +
(
1 − sensitivity
)
×
(
prevalence
)
=
0.99 × (1 − 0.01)
0.99 × (1 − 0.01) +
(
1 − 0.95
)
× 0.01
=
0.0099
0.0099 + 0.0005
= 0.952.
Comment: In this population, about 95.2% of patients with negative PCR are
correctly classified as disease free.
For population B with 0.5% prevalence, we have:
PPV =
(
sensitivity
)
×
(
prevalence
)
(
sensitivity
)
×
(
prevalence
)
+
(
1 − specificity
)
×
(
1 − prevalence
)
=
0.95 × 0.005
0.95 × 0.005 +
(
1 − 0.99
)
×
(
1 − 0.005
)
=
0.95 × 0.005
0.95 × 0.005 + 0.01 × 0.995
=
0.00475
0.00475 + 0.00995
= 0.323.
Comment: In this population, about 32.3% of patients with positive PCR are
correctly classified as diseased.
NPV =
(specificity) × (1 − prevalence)
(specificity) × (1 − prevalence) +
(
1 − sensitivity
)
×
(
prevalence
)
=
0.99 × (1 − 0.005)
0.99 × (1 − 0.005) +
(
1 − 0.95
)
× 0.005
=
0.98505
0.98505 + 0.00025
= 0.999.
Comment: In this population, about 99.9% of patients with negative PCR are
correctly classified as disease free.
https://t.me/med1917
Соседние файлы в папке Библиотека им академика М.И. Перельмана
