shorth | R Documentation |
Calculates the mean of the data points in the shortest interval containing half of the data.
The arguments of the function are such that it directly can be used as a
statistic in the mboot()
function.
shorth(data, indices = NULL)
data |
the data as a numeric vector. |
indices |
the selected indices of |
The mean of the data points in the shortest interval containing half of the data.
Andrews D.F. et al. (1972) Robust Estimates of Location Princeton University Press, Princeton.
data <- rnorm(100)
shorth(data)
shorth(data, sample(1:100, size = 20))
# Calculating a CI for shorth using [mboot()]
data <- rnorm(100)
boot.out <- mboot(data, shorth, m = sqrt(length(data)))
basic.ci <- mboot.ci(boot.out, conf =0.95, tau = function(n) return(n^(1/3)), types = "basic")$basic
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.