contingency table - Vierfeldertafel
using a tree diagram to make a contingency table
contingency table
$B$ |
$\overline{B}$ |
||
$A$ |
$P(A \cap B)$ |
$P(A \cap \overline{B})$ |
$P(A)$ |
$\overline{A}$ |
$P(\overline{A} \cap B)$ |
$P(\overline{A} \cap \overline{B})$ |
$P(\overline{A})$ |
$P(B)$ |
$P(\overline{B})$ |
1 |
Note that $P_A(B)$
is equivalent to $P(B|A)$
- “probability of B given A” - conditional probability.
From
$P(A \cap B) = P(A) \cdot P_A(B)$
we know that$P_A(B)$
=$\frac{P(A \cap B)}{P(A)}$
For the probabilities we have
$${P_A(B) = \frac{P(A \cap B)}{P(A)}}$$ $${P_A(\overline{B}) = \frac{P(A \cap \overline{B})}{P(A)}}$$ $${P_\overline{A}(B) = \frac{P(\overline{A} \cap B)}{P(\overline{A})}}$$ $${P_\overline{A}(\overline{B}) = \frac{P(\overline{A} \cap \overline{B})}{P(\overline{A})}}$$
total probability - die totale Wahrscheinlichkeit
In a tree diagram you can read off the probability of event A but not that of event B. But, the total probability (totale Wahrscheinlichkeit) of B is
$P(B) = P(A) \cdot P_A(B) + P(\overline{A}) \cdot P_\overline{A}(B)$
where you are adding the probabilities of the paths that result in $P(\overline{A} \cap B)$
and $P(A \cap B)$
Bayes’ Law
We can reverse the process and find the conditional probability $P_B(A)$
using what we know about the total probability:
$P_B(A)$
=$\frac{P(A \cap B)}{P(B)}$
=$\frac{P(A \cap B)}{P(A) \cdot P_A(B) + P(\overline{A}) \cdot P_\overline{A}(B)}$
dependent and independent events
Event A and event B are either dependent of each other or independent
The events are independent (stochastisch unabhängig) if $P_A(B)$
= $P(B)$
Find the probabilities of event B
Note the event B is not neccessarily independent of event A depending on the input of $P(A \cap B)$
and $P(\overline{A} \cap B)$
That is why the probabilitites you generate are not always possible (negative and greater than one) in the first app below.
With this App you can find conditional probabilities $P_A(B)$
, $P_A(\overline{B})$
, $P_\overline{A}(B)$
and $P_\overline{A}(\overline{B})$
example
$B$ |
$\overline{B}$ |
||
$A$ |
0.16 | 0.48 | 0.64 |
$\overline{A}$ |
0.24 | 0.12 | 0.36 |
0.4 | 0.6 | 1 |
TASK - convert the contingency table into a tree diagram