Sunday, November 16, 2014

Quartiles in R

In this Wikipedia article it looks like the R functions summary and fivepoint use the same algorithm to calculate q1 and q3:
However that is not the case, as can be seen here (notice the difference in q1 and q3):
Of course quartiles are not uniquely defined. In fact the function quantile offers nine(!) different ways to calculate them: The function summary actually calls quantile using its default algorithm type 7.