median_confint_hs: Two-sided confidence interval method for the median by the...

Description Usage Arguments Details Value References Examples

View source: R/quantile_confints.R

Description

Two-sided confidence interval method for the median by the method of Hettmansperger & Sheather (1991)

Usage

1
2
3
4
5
6
median_confint_hs(
  x,
  conf.level = 0.95,
  x_is_sorted = FALSE,
  interpolate = TRUE
)

Arguments

x

vector of observations

conf.level

A conf.level * 100% confidence interval is computed

x_is_sorted

Boolean (Default: FALSE) to safe sorting x, if it is already sorted. 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).

Details

The interpolation procedure suggested 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

Hettmansperger TP and Sheather SJ (1986), Confidence intervals based on interpolated order statistics, Statistics and Probability Letters, 4, p. 75-79.

Examples

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

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