Learn R Programming

jmuOutlier (version 2.2)

quantileCI: Confidence Intervals on Quantiles

Description

Produces exact confidence intervals on quantiles corresponding to the stated probabilities, based on the binomial test.

Usage

quantileCI(x, probs = 0.5, conf.level = 0.95)

Arguments

x

Numeric vector of observations.

probs

Numeric vector of cumulative probabilities between 0 and 1.

conf.level

Confidence level of the interval.

Value

Confidence interval for each quantile based on probs.

Details

If probs=0.5 (default), then a confidence interval on the population median is produced.

References

Higgins, J. J. (2004) Introduction to Modern Nonparametric Statistics.

Examples

Run this code
# NOT RUN {
# Sample 20 observations from an Exponential distribution with mean=10.

print( sort( x <- rexp( 20, 0.1 ) ) ) 

# Construct 90% confidence intervals on the 25th, 50th, and 75th percentiles.  

quantileCI( x, c( 0.25, 0.5, 0.75 ), 0.9 ) 
# }

Run the code above in your browser using DataLab