On Fri, 7 Dec 2001, Edward Malthouse wrote:
> See Hyndman and Fan (1996), "Sample quantiles in statistical
> packages," American Statistician, Vol 50, number 4, pp-361-365.
>
> If I recall correctly, they give about 9 different definitions of
> quantiles that have been proposed in the literature and a list of
> desirable properties. They show which definitions have which
> properties. As I recall, the method they recommend isn't in SAS,
> SPSS, or S-plus. The default in SAS is one of the better ones.
Better for what? (Not that we were discussing SAS.)
> Functions that compute quantiles in S-plus are (were not)
> consistent (Here is an example using S-plus 2000. It may have been
> fixed as there was discussion on this list a few years ago.):
>
> > x <- c(8,9,10,11,14,20)
> > quantile(x)
> 0% 25% 50% 75% 100%
> 8 9.25 10.5 13.25 20
> > summary(x)
> Min. 1st Qu. Median Mean 3rd Qu. Max.
> 8 9.25 10.5 12 13.2 20
Nope: they *were* and are consistent. They are printed to different
numbers of significant digits. See
> print(summary(x), digits=5)
Min. 1st Qu. Median Mean 3rd Qu. Max.
8.00 9.25 10.50 12.00 13.25 20.00
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
|