Variance, robust spread measures, skewness and kurtosis

TODO

  • link to diagDistributions, varianceHom

Install required packages

DescTools, robustbase

Variance and standard deviation

Corrected (sample) variance and standard deviation

[1] 26.26667
[1] 5.125102

Uncorrected (population) variance and standard deviation

$cov
         [,1]
[1,] 21.88889

$center
[1] 24.33333

$n.obs
[1] 6
[1] 21.88889
[1] 4.678556

Robust spread measures

Winsorized variance and standard deviation

[1] 17.2
[1] 4.147288

Inter-quartile-range

   0%   25%   50%   75%  100% 
17.00 21.50 24.00 28.75 30.00 
[1] 7.25

Mean absolute difference to the median

[1] 4

Median absolute difference to the median (MAD)

[1] 6.6717

\(Q_{n}\): more efficient alternative to MAD

[1] 6.792788

\(\tau\) estimate of scale

[1] 4.865323

Diversity of categorical data

fac
         A          B          C          D          E          Q 
0.09090909 0.09090909 0.18181818 0.27272727 0.36363636 0.00000000 

First, calculate Shannon index, then diversity measure.

[1] 0.8193845

Higher moments: skewness and kurtosis

[1] -0.08611387
[1] -1.772568

Detach (automatically) loaded packages (if possible)

Get the article source from GitHub

R markdown - markdown - R code - all posts