mad(stats)
mad()所属R语言包:stats
Median Absolute Deviation
中位数绝对偏差
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Compute the median absolute deviation, i.e., the (lo-/hi-) median of the absolute deviations from the median, and (by default) adjust by a factor for asymptotically normal consistency.
计算中位数绝对偏差,即(lo-/hi-)中位数的中位数绝对偏差,(默认)调整渐近正态的一致性因素。
用法----------Usage----------
mad(x, center = median(x), constant = 1.4826, na.rm = FALSE,
low = FALSE, high = FALSE)
参数----------Arguments----------
参数:x
a numeric vector.
数字向量。
参数:center
Optionally, the centre: defaults to the median.
可选,默认为中心:中位数。
参数:constant
scale factor.
比例因子。
参数:na.rm
if TRUE then NA values are stripped from x before computation takes place.
如果TRUE然后NA值剥离x计算发生之前。
参数:low
if TRUE, compute the "lo-median", i.e., for even sample size, do not average the two middle values, but take the smaller one.
如果TRUE,甚至样本大小计算“中位数”,即,不要两个中间值的平均,而是采取较小的一个。
参数:high
if TRUE, compute the "hi-median", i.e., take the larger of the two middle values for even sample size.
如果TRUE,计算“中位数”,即,甚至样本大小的两个中间值较大。
Details
详情----------Details----------
The actual value calculated is constant * cMedian(abs(x - center)) with the default value of center being median(x), and cMedian being the usual, the "low" or "high" median, see the arguments description for low and high above.
计算的实际值是constant * cMedian(abs(x - center))与center被median(x),cMedian往常一样,“低”或“高”的中位数,看到的默认值low和high上面的参数的说明。
The default constant = 1.4826 (approximately 1/ Φ^(-1)(3/4) = 1/qnorm(3/4)) ensures consistency, i.e.,
默认constant = 1.4826(约1/ Φ^(-1)(3/4)=1/qnorm(3/4))确保一致性,即,
for X_i distributed as N(μ, σ^2) and large n.
X_iN(μ, σ^2)大n分布式的。
If na.rm is TRUE then NA values are stripped from x before computation takes place. If this is not done then an NA value in x will cause mad to return NA.
如果na.rm是TRUE然后NA值x计算发生之前剥离。如果不这样做,那么NAx会造成mad回NA的价值。
参见----------See Also----------
IQR which is simpler but less robust, median, var.
IQR这是简单,但不太可靠,median,var。
举例----------Examples----------
mad(c(1:9))
print(mad(c(1:9), constant=1)) ==
mad(c(1:8,100), constant=1) # = 2 ; TRUE[= 2;真]
x <- c(1,2,3, 5,7,8)
sort(abs(x - median(x)))
c(mad(x, constant=1),
mad(x, constant=1, low = TRUE),
mad(x, constant=1, high = TRUE))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|