Download presentation
Presentation is loading. Please wait.
Published byJoel Gervais Modified over 6 years ago
1
Bayesian Networks HAP 823 George Mason University
Tutor: Prof. Farook Alemi By Akhil Anto
2
Teach One Assignment Question
Write an SQL code to calculate the probability of negative outcome in the situation where the patient is severely ill and has not signed a "Do Not Resuscitate" (DNR) order. Note that probabilities for events that are mutually exclusive and exhaustive should add up to one. Data► Link
4
First, we need to eliminate the variables that we are not focusing on which are “Not Severe”
p(severity) p(DNR) p(Tx|DNR, Severity) p(Outcome|Tx, Severity) Severity p DNR Tx Outcome Severe 0.4 Yes 0.1 Positive 0.2 Not Severe 0.6 No 0.9 Negative 0.0 0.3
5
Now we should join the first two tables using cross join as they don’t share features.
p(severity) p(DNR) Severity p DNR Severe 0.4 Yes 0.1 Not Severe 0.6 No 0.9 p(Sev DNR) Severity DNR p Severe Yes 0.04 No 0.36
6
Now that we have our variables of interest which reflects the severity and DNR. Next step is to combine the resulting table with treatment table given DNR and severity We will do inner join using SQL coding for sever cases, with all the probabilities of DNR and the treatment. At the same time we will multiply the probabilities with its equivalent from each table. p(Sev DNR) Severity DNR p Severe Yes 0.04 No 0.36 p(Tx|DNR, Severity) DNR Severity Tx p Yes Severe 0.1 No 0.2 0.3 Severity Tx DNR p Yes Severe No 0.108 0.036 0.004 0.008
7
Here we select the treatment table above severity and treatment variables and the probabilities for each treatment and severity will be sum by combining each no and yes cases for treatment across different values of DNR and then we need to specify the grouping based on the treatment and severity only p(Tx Sev) Tx Severity psum No Severe 0.044 Yes 0.112
8
Join the previous table with the outcome table
p(Tx Sev) Tx Severity psum No Severe 0.044 Yes 0.112 p(Outcome|Tx, Severity) Tx Severity Outcome p Yes Severe Positive 0.2 Negative 0.1 No 0.3 p(Tx Sev Outcome) Tx Severity Outcome p Yes Severe Positive 0.0224 Negative 0.0112 No 0.0044 0.0132
9
Because we are interested in the adverse outcome we will sum the probabilities of negative outcome over treatment values, and we can also add the probabilities of the positive values to compare Severity Outcome p Severe Negative 0.0244 Positive 0.0268
10
Finally we need to normalize the probabilities so they sum up to one
So we have 47.65% of our severe patients have adverse outcomes Severity Outcome p pnormalized Severe Negative 0.0244 Positive 0.0268
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.