1.5 Thinking like a Bayesian 4/4

1.5.1 Asking question

What’s the chance that I actually have the disease (a)? Versus I do not have the disease, What’s the chance that I would have gotten this positive test results (b)?

# building data
disease <- c(rep("disease", 4), rep("no disease", 96))
a <- "test positive" ; b <- "test negative"
test <- c(rep(a, 3), b, rep(a, 9), rep(b, 87))
disease_status <- data.frame(disease, test)
# contingency table
contingency_disease <- table(disease_status)
contingency_disease <- addmargins(contingency_disease)
knitr::kable(contingency_disease )
test negative test positive Sum
disease 1 3 4
no disease 87 9 96
Sum 88 12 100

(a): 3 / 12

(b): 9 / 96

Analogy between (b) and p-value: it is more natural to study the uncertainty of a yet-unproven hypothesis than the uncertainty of data we have already observed.(authors’opinion)