Learn R Programming

broman (version 0.59-5)

quantileSE: Sample quantiles and their standard errors

Description

Calculate sample quantiles and their estimated standard errors.

Usage

quantileSE(x, p = 0.95, bw, na.rm = TRUE, names = TRUE)

Arguments

x
Numeric vector whose sample quantiles are wanted.
p
Numeric vector with values in [0,1].
bw
Bandwidth to use in the density estimation.
na.rm
Logical; if true, and NA and NaN's are removed from x before the quantiles are computed.
names
Logical; if true, the column names of the result is set to the values in p.

Value

  • A matrix of size 2 x length(p). The first row contains the estimated quantiles; the second row contains the corresponding estimated standard errors.

Details

The sample quantiles are calculated with the function quantile. Standard errors are obtained by the asymptotic approximation described in Cox and Hinkley (1974). Density values are estimated using a kernel density estimate with the function density.

See Also

quantile, density

Examples

Run this code
quantileSE(rchisq(1000,4), c(0.9,0.95))

Run the code above in your browser using DataLab