[R] Summary vs fivenum results for Q3
tlumley at u.washington.edu
Wed Oct 10 00:56:03 CEST 2007
On Tue, 9 Oct 2007, Schaefer, Robert L. Dr. wrote:
> I've just started using R and am still a neophyte, but I found the
> following curious result. I'm using the current version of R (2.5.1
> (2007-06-27) ).
> Why are the results for the third quartile different in the output from
> the summary and fivenum commands?
Because there are lots of ways to define quantiles. The quantile()
function provides 9 definitions of quantiles, and in your data these range
from 913 to 1015.75
You might also get a hint that there are deliberately different
definitions involved from the help page for fivenum(), which doesn't use
the word "quartile" at all.
Everyone agrees that the third quartile (and the upper hinge) should be
somewhere between the 24th and 25th of 32 observations, but not on which
point in this interval should be chosen.
Thomas Lumley Assoc. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle
More information about the R-help