# Biostatistics with R/Some Basic Probability Concepts

## Formular with R

Formular Number Name Formular Formular with R
3.2.1 Classical probability $P(E)={\frac {m}{N}}$  Example
3.2.2 Relative frequency probability $P(E)={\frac {m}{n}}$  Example
3.3.1–3.3.3 Properties of probability $P(E_{i})\geq 0$

$P(E_{1})+P(E_{2})+\dots +P(E_{n})=0$  $P(E_{i}+E_{j})=P(E_{i})+P(E_{j})$

Example
3.4.1 Multiplication rule $P(A\cap B)=P(A|B)P(B)=P(A)P(B|A)$  Example
3.4.2 Conditional probability $P(A|B)={\frac {P(A\cap B)}{P(B)}}$  Example
3.4.3 Addition rule $P(A\cup B)=P(A)+P(B)-P(A\cap B)$  Example
3.4.4 Independent events $P(A\cap B)=P(A)P(B)$  Example
3.4.5 Complementary events $P({\overline {A}})=1-P(A)$  Example
3.4.6 Marginal probability $P(A_{i})=\sum {P(A_{i}\cap B_{j})}$  Example
Sensitivity of a screening test $P(T|D)={\frac {a}{(a+c)}}$  Example
Specificity of a screening test $P({\overline {T}}|{\overline {D}})={\frac {d}{(b+d)}}$  Example
3.5.1 Predictive value positive of a screening test $P(D|T)={\frac {P(D|T)P(D)}{P(T|D)P(D)+P(T|{\overline {D}})P({\overline {D}})}}$  Example
3.5.2 Predictive value negative of a screening test $P({\overline {D}}|{\overline {T}})={\frac {P({\overline {D}}|{\overline {T}})P({\overline {D}})}{P({\overline {T}}|{\overline {D}})P({\overline {D}})+P({\overline {T}}|D)P(D)}}$  Example
Symbol Key
• $D$ = disease
• $E$ = Event
• $m$ = the number of times an event E_i occurs
• $n$ = sample size or the total number of times a process occurs
• $n$ =Population size or the total number of mutually exclusive and equally likely events
• $P({\overline {A}})$ = a complementary event; the probability of an event A, not occurring
• $P(E_{i})$ =probability of some event E_i occurring
• $P(A\cap B)$ =an “intersection” or “and” statement; the probability of an event A and an event B occurring
• $P(A\cup B)$ =an “union” or “or” statement; the probability of an event A or an event B or both occurring
• $P(A|B)$ =a conditional statement; the probability of an event A occurring given that an event B has already occurred
• $T$ =test results
Example