Computes the empirical quantile function for a data vector and returns it as a step function object.

psi.eqf(x, val.right = NULL)

Arguments

x

a numeric data vector representing a random sample from a continuous distribution

val.right

value of eqf outside [0,1], see details

Details

The eqf for a sample of size n is a step function with value equal to the i-th order statistic in the interval ((i-1)/n,i/n] for i=1,...,n.

Other definitions of sample quantiles, see quantile, are not implemented by this function.

Value

The eqf as a stepfun object.

Note

The result will be incorrect if x contains ties but this should not happen for continuous distributions.

See also

Examples

f5 <- psi.eqf(rnorm(20)) psi.plot.stepfun(f5,xlim=c(0,1),rigid.xlim=TRUE,verticals=FALSE)
psi.plot.stepfun(f5,xlim=c(0,1),rigid.xlim=TRUE,verticals=FALSE,pch=19)