Calculates the confidence interval for any quantile. Although bootstrapping might be a good approach for getting senisble confidence intervals there's sometimes need to have a nonparameteric alternative. This function offers one.
numeric vector of probabilities with values in [0,1]. (Values up to 2e-14 outside that range are accepted and moved to the nearby endpoint.)
conf.level
confidence level of the interval
sides
a character string specifying the side of the confidence interval, must be one of "two.sided" (default), "left" or "right" (abbreviations allowed). "left" would be analogue to a "greater" hypothesis in a t.test.
na.rm
logical. Should missing values be removed? Defaults to FALSE.
method
defining the type of interval that should be calculated (one out of "exact", "boot"). Default is "exact". See Details.
R
The number of bootstrap replicates. Usually this will be a single positive integer. See
boot.ci for details.
Value
if probs was of length 1
a numeric vector with 3 elements:
est
est
lwr.ci
lower bound of the confidence interval
upr.ci
upper bound of the confidence interval
or, if probs was a vector, a matrix with 3 columns consisting of estimate, lower ci, upper ci
est, lwr.ci, upr.ci
%% ~Describe the value returned
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
%% \item{comp2 }{Description of 'comp2'}
%% ...
Details
The "exact" method corresponds to the way the confidence interval for the median is calculated in SAS.
The boot confidence interval type is calculated by means of boot.ci with default type "basic".