quantile_confint_nyblom: Two-sided quantile confidence interval based on interpolating...

Description Usage Arguments Details Value References Examples

View source: R/quantile_confints.R

Description

Two-sided quantile confidence interval based on interpolating the order statistic as suggested in Nyblom (1991)

Usage

1
2
3
4
5
6
7
8
quantile_confint_nyblom(
  x,
  p,
  conf.level = 0.95,
  x_is_sorted = FALSE,
  interpolate = TRUE,
  fix_interval = TRUE
)

Arguments

x

vector of observations

p

quantile of interest, 0 <= p <= 1

conf.level

A conf.level * 100% confidence interval is computed

x_is_sorted

Boolean (Default: FALSE) indicating if x is already sorted and, hence, it is not necessary to sort it again. This is merely for speed reasons in situations where it is more efficient to only sort x once.

interpolate

Boolean (Default: TRUE) stating whether to interpolate the order statistics. If no interpolation is selected then this is just the standard exact procedure based on the order statistics. Note: This procedure is conservative (i.e. coverage is usualler larger than the nominal conf.level and hence the interval is actually in general too large).

fix_interval

Boolean (Default: TRUE) For the case with no interpolation, try to extend interval upwards if coverage is too little.

Details

The interpolation procedure suggested by Nyblom (1992), which extends work by Hettmansperger and Sheather (1986) for the median is applied to the order statistic.

Value

A vector of length two containing the lower and upper limit of the confidence interval

References

Nyblom J, Note in interpolated order statistics, Statistics and Probability Letters 14, p. 129-131.

Examples

1
2
3
set.seed(123)
x <- rnorm(25)
quantile_confint_nyblom(x=x, p=0.8, conf.level=0.95, interpolate=TRUE)

hoehleatsu/quantileCI documentation built on Aug. 29, 2021, 4:33 a.m.