Learn R Programming

lmomco (version 2.0.1)

pp.median: Quantile Function of the Ranks of Plotting Positions

Description

There are two major forms (outside of the general plotting-position formula pp) for estimation of the $p_r$th probability of the $r$th order statistic for a sample of size $n$: the mean is $p'_r = r/(n+1)$ (Weibull plotting position) and the median is $p^\star_r = IIB(0.5, r, n+1-r)$, where $f=0.5$ represents the median. $IIB$ is the inverse of the incomplete beta function or the quantile function of the beta distribution as provided by qbeta(f, a, b). See Gilchrist (2011, chapter 12, p. 510 in Karian and Dudewicz, 2011). The $p'_r$ are known in some fields as mean rankit and $p^\star_r$ as median rankit.

Usage

pp.median(x)

Arguments

x
A vector of data. The ranks and the length of the vector are computed within the function.

Value

  • An R vector is returned.

References

Karian, Z.A., and Dudewicz, E.J., 2011, Handbook of fitting statistical distributions with R: Boca Raton, FL, CRC Press.

See Also

pp, pp.f

Examples

Run this code
X <- rexp(10)*rexp(10)
means <- pp(X, sort=FALSE)
median  <- pp.median(X)
supposed.median <- pp(X, a=0.3175, sort=FALSE)
lmr <- lmoms(X)
par <- parwak(lmr)
F <- nonexceeds()
plot(F, qlmomco(F,par), type="l", log="y")
points(means, X)
points(median, X, col=2)
points(supposed.median, X, pch=16, col=2, cex=0.5)
# The plot shows that the median and supposed.median by the plotting-position
# formula are effectively equivalent. Thus, the partical application it seems
# that a=0.3175 would be good enough in lieu of the complexity of the
# quantile function of the beta distribution.

Run the code above in your browser using DataLab