在R中?quantile可以看到至少有9种
*Discontinuous sample quantile types 1, 2, and 3*
Type 1 Inverse of empirical distribution function.
Type 2 Similar to type 1 but with averaging at discontinuities.
Type 3 SAS definition: nearest even order statistic.
*Continuous sample quantile types 4 through 9*
Type 4 p(k) = k / n. That is, linear interpolation of the
empirical cdf.
Type 5 p(k) = (k - 0.5) / n. That is a piecewise linear function
where the knots are the values midway through the steps of
the empirical cdf. This is popular amongst hydrologists.
Type 6 p(k) = k / (n + 1). Thus p(k) = E[F(x[k])]. This is used by
Minitab and by SPSS.
Type 7 p(k) = (k - 1) / (n - 1). In this case, p(k) =
mode[F(x[k])]. This is used by S.
Type 8 p(k) = (k - 1/3) / (n + 1/3). Then p(k) =~ median[F(x[k])].
The resulting quantile estimates are approximately
median-unbiased regardless of the distribution of 'x'.
Type 9 p(k) = (k - 3/8) / (n + 1/4). The resulting quantile
estimates are approximately unbiased if 'x' is normally
distributed.
|