qtiles.CI: Quantiles with Confidence Limits

View source: R/qtiles.CI.R

qtiles.CIR Documentation

Quantiles with Confidence Limits

Description

Computes sample quantiles and confidence limts for specified probabilities.

Usage

qtiles.CI(x, probs = 0.5, CI = 0.9, bound = c("two.sided", "upper",
  "lower"), na.rm = TRUE)

Arguments

x

numeric vector to compute the sample quantiles.

probs

numeric vector of desired probabilities with values between 0 and 1.

CI

the minimum desired confidence interval for each level specifed in probs.

bound

a character string indicating the desired bounds, "two.sided" means the two-sided interval, "upper" means the upper bound of the interval, and "lower" means the lower bound of the interval. Only a single character is needed. The lower confidence limit is -Inf when bound is "upper" and the upper confidence limit is Inf when bound is "lower."

na.rm

logical; if TRUE, then missing values are removed before computation.

Value

A matrix of sample quantiles, the lower confidence limit, the upper confidence limit, and the probability represented by the confidence interval corresponding to the probs levels in the sorted x data.

References

Helsel, D.R. and Hirsch, R.M., 2002, Statistical methods in water resources: U.S. Geological Survey Techniques of Water-Resources Investigations, book 4, chap. A3, 522 p.

See Also

quantile

Examples

## Generate a random sample
set.seed(222)
XX.rn <- rexp(32)
qtiles.CI(XX.rn, probs=c(.25, .5, .75))

USGS-R/smwrStats documentation built on Oct. 11, 2022, 6:15 a.m.