quantileSE: Sample quantiles and their standard errors

View source: R/quantileSE.R

quantileSER Documentation

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)

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().

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.

See Also

stats::quantile(), stats::density()

Examples

quantileSE(rchisq(1000,4), c(0.9,0.95))


broman documentation built on May 29, 2024, 7:18 a.m.

Related to quantileSE in broman...