boxplot.stats(grDevices)
boxplot.stats()所属R语言包:grDevices
Box Plot Statistics
箱形图统计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function is typically called by another function to gather the statistics necessary for producing box plots, but may be invoked separately.
此功能通常是由另一个函数调用来收集的生产框图的必要的统计,但可以单独调用。
用法----------Usage----------
boxplot.stats(x, coef = 1.5, do.conf = TRUE, do.out = TRUE)
参数----------Arguments----------
参数:x
a numeric vector for which the boxplot will be constructed (NAs and NaNs are allowed and omitted).
将兴建的盒形图数字矢量(NA和NaNS是允许的,省略)。
参数:coef
this determines how far the plot "whiskers" extend out from the box. If coef is positive, the whiskers extend to the most extreme data point which is no more than coef times the length of the box away from the box. A value of zero causes the whiskers to extend to the data extremes (and no outliers be returned).
这就决定了多远的图“晶须”延长开箱。 coef如果是积极的,胡须扩展到最极端的数据点,这是比coef倍框的长度,离着箱子的。值为零的原因,胡须扩展到数据极端(没有离群返回)。
参数:do.conf,do.out
logicals; if FALSE, the conf or out component respectively will be empty in the result.
逻辑值;如果FALSE,conf或out组件将分别在空的结果。
Details
详情----------Details----------
The two "hinges" are versions of the first and third quartile, i.e., close to quantile(x, c(1,3)/4). The hinges equal the quartiles for odd n (where n <- length(x)) and differ for even n. Whereas the quartiles only equal observations for n %% 4 == 1 (n = 1 mod 4), the hinges do so additionally for n %% 4 == 2 (n = 2 mod 4), and are in the middle of two observations otherwise.
两个“铰链”的第一和第三四分位数,即版本quantile(x, c(1,3)/4)。铰链等于为奇数的四分n(其中n <- length(x))和不同甚至n。只有平等的意见,而在四分n %% 4 == 1(n = 1 mod 4),铰链此外,对于这样做n %% 4 == 2(n = 2 mod 4),并在中间的两点意见,否则。
The notches (if requested) extend to +/-1.58 IQR/sqrt(n). This seems to be based on the same calculations as the formula with 1.57 in Chambers et al. (1983, p. 62), given in McGill et al. (1978, p. 16). They are based on asymptotic normality of the median and roughly equal sample sizes for the two medians being compared, and are said to be rather insensitive to the underlying distributions of the samples. The idea appears to be to give roughly a 95% confidence interval for the difference in two medians.
缺口(如果要求)延伸到+/-1.58 IQR/sqrt(n)。这似乎是基于相同的计算公式1.57中庭等。 (1983年,第62页),在麦吉尔大学等。 (1978年,第16页)。它们都是基于对被比较的两个位数的中位数大致相等的样本量的渐近正态性,并说是相当敏感的样本基础分布。这个想法似乎是给大约95%置信区间为两位数的差异。
值----------Value----------
List with named components as follows:
列出与命名组件如下:
参数:stats
a vector of length 5, containing the extreme of the lower whisker, the lower "hinge", the median, the upper "hinge" and the extreme of the upper whisker.
一个长度为5的向量,含有晶须,较低的“铰链”,中位数,“铰链”上,上晶须的极端极端。
参数:n
the number of non-NA observations in the sample.
非NA样品中观测。
参数:conf
the lower and upper extremes of the "notch" (if(do.conf)). See the details.
“缺口”的上下极端(if(do.conf))。查看详细信息。
参数:out
the values of any data points which lie beyond the extremes of the whiskers (if(do.out)).
躺在晶须(if(do.out))极端超越任何数据点的值。
Note that $stats and $conf are sorted in increasing order, unlike S, and that $n and $out include any +- Inf values.
请注意$stats和$conf递增的顺序排序,不像小号,并$n和$out包括任何+- Inf值。
参考文献----------References----------
plots. The American Statistician 32, 12–16.
and Computing of Exploratory Data Analysis. Duxbury Press.
Chapter 3 of Understanding Robust and Exploratory Data Analysis, eds. D. C. Hoaglin, F. Mosteller and J. W. Tukey. Wiley.
Graphical Methods for Data Analysis. Wadsworth & Brooks/Cole.
参见----------See Also----------
fivenum, boxplot, bxp.
fivenum,boxplot,bxp。
举例----------Examples----------
require(stats)
x <- c(1:100, 1000)
(b1 <- boxplot.stats(x))
(b2 <- boxplot.stats(x, do.conf=FALSE, do.out=FALSE))
stopifnot(b1 $ stats == b2 $ stats) # do.out=F is still robust[do.out = F是仍然强劲]
boxplot.stats(x, coef = 3, do.conf=FALSE)
## no outlier treatment:[#没有离群治疗:]
boxplot.stats(x, coef = 0)
boxplot.stats(c(x, NA)) # slight change : n is 101[略有变化:N是101]
(r <- boxplot.stats(c(x, -1:1/0)))
stopifnot(r$out == c(1000, -Inf, Inf))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|