Class 7: Multiple tests

Systems Biology

AndrΓ©s Aravena, PhD

November 16, 2023

Essential Maths

Math is not sums, calculations, and formulae.
It is pulling things apart to understand how things work

Colin Wright, juggler,
inventor of the mathematical notation of juggling

Essential Math for Biology

In my opinion, all biologist should know something about

  • Set theory
  • Logic
  • Probabilities
  • Graphs (Networks)

The rest depends on each case

(maybe calculus and linear algebra)

Probabilities

An event is a set of outcomes

The set of all possible outcomes is often called Ξ©

An event 𝐴 can be seen as the set of all outcomes that make the event true

For example,

Fever={Temperature>37.5Β°C}

Evaluating rational beliefs

An event will become either true or false after an experiment

For example, a dice can be either 4 or not

We want to give a value to our rational belief that the event will become true after the experiment

The numeric value is called Probability

Probabilities as Areas

It is useful to think that the probability of an event is the area in the drawing

The total area of Ξ© is 1

Usually we do not know the shape of 𝐴

Probabilities depend on our knowledge

Our rational beliefs depend on our knowledge

If we represent our knowledge (or hypothesis) by 𝑍, the the probability of an event 𝐴 is written as \[β„™(A|Z)\] We read β€œthe probability of event 𝐴, given that we know 𝑍”

For example, β€œthe probability that we get a 4, given that the dice is symmetrical”

Important idea

The order is relevant \[β„™(A|Z)β‰ β„™(Z|A)\] There are two events, 𝐴 and 𝑍

The one written after | is what we assume to be true

The one written before | is what we are asking for

One we know, the other we do not

Visually

Now outcomes are limited only to the 𝑍 region

We measure the area of \(β„™(A|Z)\) with respect to the area of 𝑍 instead of Ξ©

The shape of 𝑍 is often unknown

Degrees of belief

If, given our knowledge 𝑍, the event 𝐡 is more plausible than the event 𝐴, then \[β„™(A|Z)≀ℙ(B|Z)\]

For example, the probability that we get either 4, 5 or 6 is greater than the probability that we get a 4, given that the dice is symmetrical \[β„™(\{4\}|Z)≀ℙ(\{4,5,6\}|Z)\]

Degrees of belief with new info

On the other hand, if we get new information, the probabilities may change

The same event 𝐴 may be more plausible under a new hypothesis π‘Œ than under the initial hypothesis 𝑍

Then \[β„™(A|Z)≀ℙ(A|Y)\]

Probability rules based on these two ideas

It has been proven that probabilities must be like this

  1. A probability is a number between 0 and 1 inclusive \[β„™(A) β‰₯ 0\textrm{ and } β„™(A)≀1\]

  2. The probability of an sure event is 1 \[β„™(\textrm{True}) = 1\]

  3. The probability of an impossible event is 0 \[β„™(\textrm{False}) = 0\]

Complex events

We are interested in non-trivial events, that are usually combinations of smaller events

For example, we may ask β€œwhat is the probability that, in a group of 𝑛 people, at least two persons have the same birthday”

Fortunately, any complex event can be decomposed into simpler events, combined with and, or and not connectors

Exercise: decompose the birthday event into simpler ones

Probability of not 𝐴

If the event 𝐴 becomes more and more plausible, then the opposite event not 𝐴 becomes less and less plausible

It can be shown that we always have \[β„™(\textrm{not } A) = 1-β„™(A)\]

Probability of 𝐴 and 𝐡

\[β„™(A\text{ and } B)=\frac{\text{Number of cases where }(A\text{ and } B)\text{ is true}}{\text{Total cases of combinations of }A\text{ and } B}\]

If \(n_A\) and \(n_B\) are the total number of cases for \(A\) and \(B\), then the total number of cases is \(n_Aβ‹…n_B\)

In the same way, if \(m_A\) and \(m_B\) are the number of cases where \(A\) and \(B\) are true, respectively, then the number of cases where \((A\text{ and }B)\) is true is \(m_Aβ‹…m_B\)

\[β„™(A\text{ and } B)=\frac{m_Aβ‹…m_B}{n_Aβ‹…n_B}=\frac{m_A}{n_A}β‹…\frac{m_B}{n_B}\]

Interpretation

We could say that \[\frac{m_A}{n_A}=β„™(A)\qquad\frac{m_B}{n_B}=β„™(B)\] but we have to be careful. The result of A may affect \(m_B\) and \(n_B\). We better write \[\frac{m_A}{n_A}=β„™(A)\qquad\frac{m_B}{n_B}=β„™(B|A)\]

Rewriting the Probability of 𝐴 and 𝐡

\[β„™(A\text{ and } B)=\frac{m_A}{n_A}β‹…\frac{m_B}{n_B}=β„™(A)β‹…β„™(B|A)\] To simplify, instead of \(β„™(A\text{ and } B)\) we write \(β„™(A, B)\)

Thus, we write \[β„™(A,B)=β„™(A)β‹…β„™(B|A)\] β€œProb that (𝐴 and 𝐡) happens is Prob that 𝐴 happens times Prob that 𝐡 happens given that A happens”

Joint Probability

We know that \((A\text{ and } B)\) is always the same as \((B\text{ and } A)\)

There are two ways to calculate the probability of of 𝐴 and 𝐡 happening simultaneously

  • Start with the prob. of \(A\) and then of \(B\) given that \(A\) is true \[β„™(A,B)=β„™(A)β‹…β„™(B|A)\]
  • Start with the prob. of \(B\) and then of \(A\) given that \(B\) is true \[β„™(A,B)=β„™(B)β‹…β„™(A|B)\]

Summary

  • The order matters: \(β„™(A|Z)β‰ β„™(Z|A)\)

  • To get the probability of \(A\) and \(B\) together we find the probability of \(A\) and then of \(B\) given that \(A\) is true \[β„™(A,B)=β„™(A)β‹…β„™(B|A)\]

Can we share our birthday cake?

πŸŽ‚

Birthday paradox

What is the probability that two people in the class share the same birthday?

How many people we need to guarantee at least 50% probability?

Intuition says we need 365/2 people

That is wrong

Decomposing complex into simple

Conditional probability

Probability of 𝐴 or 𝐡

We know how to calculate \(β„™(A\text{ and } B)\) and \(β„™(\text{not } A)\)

We also know the De Morgan’s law, to swap ANDs with ORs
\[\text{not } (A \text{ or } B) = (\text{not } A) \text{ and } (\text{not } B)\]

Therefore we can write

\[ \begin{aligned} β„™(A \text{ or } B) & = 1 - β„™(\text{not }(A \text{ or } B))\\ & = 1-β„™( (\text{not } A) \text{ and } (\text{not } B)) \end{aligned} \]

Using the multiplication rule

\[β„™(A \text{ or } B) = 1-β„™( (\text{not } A) \text{ and } (\text{not } B)) \\ = 1-β„™(\text{not } A)β‹…P(\text{not } B|\text{not } A)\]

using negation rule \[ \begin{aligned} β„™(A \text{ or } B) & = 1-β„™(\text{not } A)β‹…(1- β„™(B|\text{not } A)) \\ & = 1-β„™(\text{not } A) + β„™(\text{not } A)β‹…P(B|\text{not } A) \end{aligned} \]

Using the multiplication rule again

\[ \begin{aligned} β„™(A \text{ or } B) & = 1 -β„™(\text{not } A) + β„™(\text{not } A,B) \\ β„™(A \text{ or } B) & = 1 -(1-β„™(A)) + β„™(\text{not } A|B)β„™(B) \\ β„™(A \text{ or } B) & = β„™(A) + (1-β„™(A|B))β„™(B) \\ β„™(A \text{ or } B) & = β„™(A) + β„™(B)-β„™(A|B)β„™(B) \\ β„™(A \text{ or } B) & = β„™(A) + β„™(B)-β„™(A,B) \end{aligned} \] You need to remember only the last line

The previous lines justify why the last one is always true

Do not count twice

If A and B can happen at the same time, then \(β„™(A) + β„™(B)\) counts the intersection twice

So we have to take out the intersection \(β„™(A,B)\) \[β„™(A \text{ or } B) = \\ β„™(A) + β„™(B)-β„™(A,B)\]

It gets complicated

If there are three compatible events, things get messy

\[\begin{aligned} & β„™(A \text{ or } B \text{ or } C) \\ & β„™(A) + β„™(B \text{ or } C)-β„™(A,(B \text{ or } C)) \\ & β„™(A) + β„™(B) + β„™(C)-β„™(B,C) - β„™(A,B \text{ or } A,C) \\ & β„™(A) + β„™(B) + β„™(C)-β„™(B,C) - (β„™(A,B) + β„™(A,C) - β„™(A,B,C)) \\ & β„™(A) + β„™(B) + β„™(C)-β„™(B,C) - β„™(A,B) - β„™(A,C) + β„™(A,B,C) \end{aligned} \]

It gets worse with more events

Boole’s inequality

Now we can see that

\[{\mathbb P}\left(\bigcup_{i=1}^{\infty} A_i \right) \le \sum_{i=1}^{\infty} {\mathbb P}(A_i)\]

in other words

\[\mathbb P\left(A_1\text{ OR }A_2 \text{ OR } … \text{ OR } A_k \right) \le \mathbb P(A_1)+\mathbb P(A_2)+\cdots+\mathbb P(A_k)\]

There is an easier way

Using De Morgan’s rule

\[\begin{aligned} & β„™(A \text{ or } B \text{ or } C) \\ & 1 - β„™((\text{not } A) \text{ and } (\text{not } B) \text{ and } (\text{not } C))\\ & 1 - β„™(\text{not } A)β‹…β„™(\text{not } B | \text{not } A)β‹…β„™(\text{not } C | \text{not } A, \text{not } B)\\ & 1 - (1-β„™(A))β‹…(1-β„™(B | \text{not } A))β‹…(1-β„™(C | \text{not } A, \text{not } B)) \end{aligned} \]

This is often easier to calculate

Solving the paradox

Let’s say we have three people, with birthday \(x_1, x_2\) and \(x_3.\)

The probability that there are at least two people with the same birthday is \[β„™(x_2=x_1 \text{ or } x_3=x_2 \text{ or } x_3=x_1)\] which can be rewritten as \[1-β„™(x_2β‰ x_1 \text{ and } x_3β‰ x_2 \text{ and } x_3β‰ x_1)\]

Now we only have and combinations

We want to calculate \[1-β„™(x_2β‰ x_1 \text{ and } x_3β‰ x_2 \text{ and } x_3β‰ x_1)\] We can separate like this (only the first and) \[1-β„™(x_2β‰ x_1)β‹…β„™(x_3β‰ x_2 \text{ and } x_3β‰ x_1|x_2β‰ x_1)\] Assuming 365 possible birthdays, we have \[1-\frac{364}{365}β‹…\frac{363}{365}\]

Multiple tests

Family-wise error rate

If \(m\) independent comparisons are performed, the family-wise error rate (FWER), is given by

\[\bar{\alpha} = 1-\left( 1-\alpha_{\{\text{per comparison}\}} \right)^m\]

Hence, \(\bar{\alpha}\) increases as the number of comparisons increases.

Bonferroni method

If we do not assume that the comparisons are independent, then we can still say:

\[\bar{\alpha} \le m \cdot \alpha_{\{\text{per comparison}\}}\]

which follows from Boole’s inequality. Example: \(0.2649=1-(1-.05)^6 \le .05 \times 6 = 0.3\)

Benjamini–Hochberg procedure