# Biostatistics with R/Some Basic Probability Concepts

## Formular with R

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

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

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