mc(x, na.rm = FALSE, doReflect = (length(x) <= 100),="" eps1 =" .Machine$double.eps," eps2 =" .Machine$double.xmin," maxit =" 100," trace.lev =" 0," full.result =" FALSE)
NA
s)
should be dealt with.-x
, with final result
(mc.(x) - mc.(-x))/2
. This makes sense since the internal
MC, mc.()
computes the himedian() which can differ slightly from
the median.trace.lev = 5
.attr(*, "mcComp")
.r <- mc(x, full.result = TRUE, ....)
, then
attr(r, "mcComp")
is a list with components
doReflect=TRUE
.Hubert, M. and Vandervieren, E. (2008). An adjusted boxplot for skewed distributions, Computational Statistics and Data Analysis 52, 5186--5201.
Qn
for a robust measure of scale (aka
“dispersion”), ....
mc(1:5) # 0 for a symmetric sample
x1 <- c(1, 2, 7, 9, 10)
mc(x1) # = -1/3
data(cushny)
mc(cushny) # 0.125
stopifnot(mc(c(-20, -5, -2:2, 5, 20)) == 0,
mc(x1, doReflect=FALSE) == -mc(-x1, doReflect=FALSE),
all.equal(mc(x1, doReflect=FALSE), -1/3, tolerance = 1e-12))
Run the code above in your browser using DataLab