RDS 286: Excercise 3.1 from Decision Making in Health and Medicine: Integrating Evidence and Values (Hunink, 2001)

Available data:
P(appendicitis) = 0.16
P(Perforated at time 0|appendicitis) = 0.1875
P(Perforated at time 6|appendicitis) = 0.24

P(Sx worse at time 6|Perforated at time 6|appendicitis) = 0.84
P(Sx same at time 6|Perforated at time 6|appendicitis) = 0.16

P(Sx worse at time 6|Not perforated at time 6|appendicitis) = 0.8
P(Sx same at time 6|Not perforated at time 6|appendicitis) = 0.2

P(Sx same at time 6|No appendicitis) = 0.39
P(Sx better at time 6|No appendicitis) = 0.61

a. Perforation of appendix
If the appendix is perforated at time 0, it will always be perforated thereafter. Thus, 0.24 - 0.1875 = 0.0525 is the new occurence of perforation. This occured among patients without perforation at time 0, therefore, 0.0525 / (1 - 0.1875) = 0.0646 is the answer.

b. Chance tree

c. Probability of perforation at time 0
Prevalence of appendicitis * probability of perforation at time 0 = 0.16 * 0.1875 = 0.03.

d. Probability of perforation at time 6
Prevalence of appendicitis * probability of perforation at time 6 = 0.16 * 0.24 = 0.0384.

e. Probability of symptom outcome at time 6

better <- (1 - 0.16) * 0.61
same <- (1 - 0.16) * 0.39 + 0.16 * (0.1875 * 0.16 + (1 - 0.1875) * 
    (0.0646 * 0.16 + (1 - 0.0646) * 0.2))
worse <- 0.16 * (0.1875 * 0.84 + (1 - 0.1875) * (0.0646 * 0.84 + 
    (1 - 0.0646) * 0.8))
list(worse = worse, same = same, better = better)
## $worse
## [1] 0.1295
## 
## $same
## [1] 0.3581
## 
## $better
## [1] 0.5124
## 

f. Probability of perforation conditional on symptom outcome
The values calculated in question e will be denominators.

P(perforation|Sx better) = P(Sx better AND perforation) / P(better)
Better: 0 / 0.5124 = 0

P(perforation|Sx same) = P(Sx same AND perforation) / P(same)
Same: (0.16 * (0.1875 * 0.16 + (1 - 0.1875) * 0.0646 * 0.16)) / 0.3581 = 0.0172.

P(perforation|Sx worse) = P(Sx worse AND perforation) / P(worse)
Worse: (0.16 * (0.1875 * 0.84 + (1 - 0.1875) * 0.0646 * 0.84)) / 0.1295 = 0.249.

g. Probability of appendicitis conditional on symptom outcome
P(appendicitis|Sx better) = P(Sx better AND appendicitis) / P(better)
Better: 0 / 0.5124 = 0

P(appendicitis|Sx same) = P(Sx same AND appendicitis) / P(same)
Same: (0.16 * (0.1875 * 0.16 + (1 - 0.1875) * (0.0646 * 0.16 + (1 - 0.0646) * 0.2))) / 0.3581 = 0.0851.

P(appendicitis|Sx worse) = P(Sx worse AND appendicitis) / P(worse)
Worse: (0.16 * (0.1875 * 0.84 + (1 - 0.1875) * (0.0646 * 0.84 + (1 - 0.0646) * 0.8))) / 0.1295 = 1.


For other information: http://rpubs.com/kaz_yos/
If you find errors: kazky AT mac.com