# 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 $w={\frac {R}{k}}$  Example
2.4.1 Mean of a population $\mu ={\sum _{i=1}^{n}{x_{i}} \over N}$  Example
2.4.2 Skewness $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 ${\bar {x}}={\sum _{i=1}^{n}{x_{i}} \over N}$  Example
2.5.1 Range $R=x_{L}-x_{s}$  Example
2.5.2 Sample variance $s^{2}={\frac {1}{n-1}}\sum _{i=1}^{n}\left(x_{i}-{\overline {x}}\right)^{2}$  Example
2.5.3 Population variance $\sigma ^{2}={\frac {1}{N}}\sum _{i=1}^{N}\left(x_{i}-\mu \right)^{2}$  Example
2.5.4 Standard deviation $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 $C.V.={\frac {s}{\bar {x}}}$  Example
2.5.6 Quartile location in ordered array $Q_{1}={\frac {1}{4}}(n+1)$  Example
2.5.7 Interquartile range $IQR=Q_{3}-Q_{1}$  Example
2.5.8 Kurtosis $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
• $C.V.$ = coefficient of variation
• $IQR$  = Interquartile range
• $k$  = number of class intervals
• $m$  = population mean
• $N$  = population size
• $n$  = sample size
• $(n-1)$ =degrees of freedom
• $Q_{1}$  = first quartile
• $Q_{2}$ = second quartile = median
• $Q_{3}$ = third quartile
• $R$  =range
• $s$  =standard deviation
• $s^{2}$ = sample variance
• $\sigma ^{2}$ = population variance
• $x_{i}$ =$i^{t}h$  data observation
• $x_{L}$ = largest data point
• $x_{S}$ =smallest data point
• ${\bar {x}}$ = sample mean
• $w$ =class width
Example