Lisp-Stat / lisp-stat

Lisp-Stat main system
https://lisp-stat.github.io/lisp-stat
Microsoft Public License
145 stars 11 forks source link

Implement Tukey's version of five number summary #3

Closed snunez1 closed 3 years ago

snunez1 commented 3 years ago

There are multiple ways to calculate a five number quantile summary. The current version of fivenum returns min, 1st quartile, median, 3rd quartile, max of the elements of the sequence. Different software generally have the same results for "min", "median", and "max", but there are different ways to get "first quartile" and "third quartile".

In particular, Tukey's hinge method includes median in the first/third quartile calculation, and is the method used in R's version of fivenum. Adding a keyword option for a Tukey computation in the fivenum function and implementing Tukey's version of first and third quartile would make working with R code a bit easier. There are many descriptions discussing Tukey's method, and this would make a good first issue.