# Biostatistics with R/Descriptive Statistics

## Summary For Formular with R

Formula

Number

Name Formula Formula with R
2.3.1 Class interval width using Sturges’s Rule ${\displaystyle w={\frac {R}{k}}}$  Example
2.4.1 Mean of a population ${\displaystyle \mu ={\sum _{i=1}^{n}{x_{i}} \over N}}$  Example
2.4.2 Skewness ${\displaystyle Skewness={\frac {{\sqrt {n}}\sum _{i=1}^{n}\left(x_{i}-{\overline {x}}\right)^{3}}{(\sum _{i=1}^{n}\left(x_{i}-{\overline {x}}\right)^{2})^{\frac {3}{2}}}}={\frac {{\sqrt {n}}\sum _{i=1}^{n}\left(x_{i}-{\overline {x}}\right)^{3}}{(n-1){\sqrt {n-1}}s^{3}}}}$  Example
2.4.2 Mean of a sample ${\displaystyle {\bar {x}}={\sum _{i=1}^{n}{x_{i}} \over N}}$  Example
2.5.1 Range ${\displaystyle R=x_{L}-x_{s}}$  Example
2.5.2 Sample variance ${\displaystyle s^{2}={\frac {1}{n-1}}\sum _{i=1}^{n}\left(x_{i}-{\overline {x}}\right)^{2}}$  Example
2.5.3 Population variance ${\displaystyle \sigma ^{2}={\frac {1}{N}}\sum _{i=1}^{N}\left(x_{i}-\mu \right)^{2}}$  Example
2.5.4 Standard deviation ${\displaystyle s={\sqrt {s^{2}}}={\sqrt {{\frac {1}{n-1}}\sum _{i=1}^{n}\left(x_{i}-{\overline {x}}\right)^{2}}}}$  Example
2.5.5 Coefficient of variation ${\displaystyle C.V.={\frac {s}{\bar {x}}}}$  Example
2.5.6 Quartile location in ordered array ${\displaystyle Q_{1}={\frac {1}{4}}(n+1)}$  Example
2.5.7 Interquartile range ${\displaystyle IQR=Q_{3}-Q_{1}}$  Example
2.5.8 Kurtosis ${\displaystyle Kurtosis={\frac {\sum _{i=1}^{n}\left(x_{i}-{\overline {x}}\right)^{4}}{(\sum _{i=1}^{n}\left(x_{i}-{\overline {x}}\right)^{2})^{2}}}-3={\frac {n\sum _{i=1}^{n}\left(x_{i}-{\overline {x}}\right)^{4}}{(n-1)^{2}s^{4}}}}$  Example
Symbol Key
• ${\displaystyle C.V.}$ = coefficient of variation
• ${\displaystyle IQR}$  = Interquartile range
• ${\displaystyle k}$  = number of class intervals
• ${\displaystyle m}$  = population mean
• ${\displaystyle N}$  = population size
• ${\displaystyle n}$  = sample size
• ${\displaystyle (n-1)}$ =degrees of freedom
• ${\displaystyle Q_{1}}$  = first quartile
• ${\displaystyle Q_{2}}$ = second quartile = median
• ${\displaystyle Q_{3}}$ = third quartile
• ${\displaystyle R}$  =range
• ${\displaystyle s}$  =standard deviation
• ${\displaystyle s^{2}}$ = sample variance
• ${\displaystyle \sigma ^{2}}$ = population variance
• ${\displaystyle x_{i}}$ =${\displaystyle i^{t}h}$  data observation
• ${\displaystyle x_{L}}$ = largest data point
• ${\displaystyle x_{S}}$ =smallest data point
• ${\displaystyle {\bar {x}}}$ = sample mean
• ${\displaystyle w}$ =class width
Example