| MedianCI | R Documentation |
Calculate the confidence interval for the median.
MedianCI(
x,
conf.level = 0.95,
sides = c("two.sided", "left", "right"),
method = c("exact", "boot"),
na.rm = FALSE,
...
)
x |
a (non-empty) numeric vector of data values. |
conf.level |
confidence level of the interval |
sides |
a character string specifying the side of the confidence
interval, must be one of |
method |
defining the type of interval that should be calculated (one
out of |
na.rm |
logical. Should missing values be removed? Defaults to
|
... |
the dots are passed on to |
The "exact" method is the way SAS is said to calculate the confidence
interval. This is also implemented in SignTest. The boot
confidence interval type is calculated by means of boot.ci
with default type "perc".
Use sapply,
resp.apply, to get the confidence intervals from a data.frame
or from a matrix.
a numeric vector with 3 elements:
median |
median |
lwr.ci |
lower bound of the confidence interval |
upr.ci |
upper bound of the confidence interval |
Andri Signorell andri@signorell.net
wilcox.test, MeanCI,
median, HodgesLehmann
MedianCI(d.pizza$price, na.rm=TRUE)
MedianCI(d.pizza$price, conf.level=0.99, na.rm=TRUE)
t(round(sapply(d.pizza[,c("delivery_min","temperature","price")], MedianCI, na.rm=TRUE), 3))
MedianCI(d.pizza$price, na.rm=TRUE, method="exact")
MedianCI(d.pizza$price, na.rm=TRUE, method="boot")
x <- runif(100)
set.seed(448)
MedianCI(x, method="boot")
# ... the same as
set.seed(448)
MedianCI(x, method="boot", type="bca")
MedianCI(x, method="boot", type="basic")
MedianCI(x, method="boot", type="perc")
MedianCI(x, method="boot", type="norm", R=499)
# not supported:
MedianCI(x, method="boot", type="stud")
MedianCI(x, method="boot", sides="right")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.