1
$\begingroup$

I had this question on a test:

Question: What is the Five-numbers summary for the following
numeric distribution, to be used in a Boxplot:
Age = {10, 10, 11, 12, 12, 13, 13, 15, 15, 16, 18, 18}
    A (10, 12, 14, 16, 18)
    B (10, 12, 13, 16, 18)
    C (10, 11.5, 13, 15.5, 18)
    D (10, 11, 13, 15, 18)

With C being the correct answer. In R:

> a <- c(10, 10, 11, 12, 12, 13, 13, 15, 15, 16, 18, 18)
> fivenum(a)
[1] 10.0 11.5 13.0 15.5 18.0
> quantile(a)
   0%   25%   50%   75%  100% 
10.00 11.75 13.00 15.25 18.00
> summary(a)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  10.00   11.75   13.00   13.58   15.25   18.00

The quantiles don't match! What is going on here.

$\endgroup$
  • 5
    $\begingroup$ ?quantile and ?fivenum (there are nine different ways how you could compute quantiles in R) $\endgroup$ – Tim May 14 '18 at 13:44
  • 1
    $\begingroup$ @Tim type: an integer between 1 and 9 selecting one of the nine quantile algorithms detailed below to be used. Oh god ... $\endgroup$ – Vorac May 14 '18 at 13:53
  • 1
    $\begingroup$ The five-letter summary is not defined in terms of quantiles: it is defined in terms of letter statistics. Therefore, what R (or any other software) computes as quantiles is scarcely relevant. $\endgroup$ – whuber May 14 '18 at 14:37
  • 1
    $\begingroup$ @whuber the definition in Wikipedia, as well as the R example there, talk about quartiles. Googling 'letter statistics' yields nothing I can grasp. I am at a loss. $\endgroup$ – Vorac May 14 '18 at 14:58
  • 4
    $\begingroup$ John Tukey defined these originally. Many subsequent "authorities" misunderstood his definitions and have replaced his "hinges" (aka "fourths") with "quartiles." Although the substitution is harmless for large datasets (since it makes little difference), the distinction becomes apparent in smaller datasets. Whoever set you this problem evidently was trying to determine whether you understood Tukey's procedure. Perhaps the best reference (apart from Tukey's book EDA) would be your own course notes. $\endgroup$ – whuber May 14 '18 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.