Learn R Programming

broman (version 0.84)

quantileSE: Sample quantiles and their standard errors

Description

Calculate sample quantiles and their estimated standard errors.

Usage

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

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.

Arguments

x

Numeric vector whose sample quantiles are wanted.

p

Numeric vector with values in the interval [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.

Details

The sample quantiles are calculated with the function stats::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 stats::density().

See Also

Examples

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

Run the code above in your browser using DataLab