找回密码
 注册
查看: 10559|回复: 0

R语言:wilcox.test()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 17:50:22 | 显示全部楼层 |阅读模式
wilcox.test(stats)
wilcox.test()所属R语言包:stats

                                        Wilcoxon Rank Sum and Signed Rank Tests
                                         Wilcoxon秩和签署秩检验

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Performs one- and two-sample Wilcoxon tests on vectors of data; the latter is also known as "Mann-Whitney" test.
执行一两样本秩测试和数据的向量,后者也被称为“曼 - 惠特尼”测试。


用法----------Usage----------


wilcox.test(x, ...)

## Default S3 method:[默认方法]
wilcox.test(x, y = NULL,
            alternative = c("two.sided", "less", "greater"),
            mu = 0, paired = FALSE, exact = NULL, correct = TRUE,
            conf.int = FALSE, conf.level = 0.95, ...)

## S3 method for class 'formula'[类formula的方法]
wilcox.test(formula, data, subset, na.action, ...)



参数----------Arguments----------

参数:x
numeric vector of data values.  Non-finite (e.g. infinite or missing) values will be omitted.
数字矢量数据值。非有限(如无限或失踪)的值将被忽略。


参数:y
an optional numeric vector of data values: as with x non-finite values will be omitted.
一个可选的数字矢量数据值:x非有限值将被忽略。


参数:alternative
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".  You can specify just the initial letter.
一个字符串,指定替代假说,必须是一个"two.sided"(默认),"greater"或"less"。您可以指定只的首字母。


参数:mu
a number specifying an optional parameter used to form the null hypothesis.  See "Details".
一个数字,指定一个可选的参数,用来形成零假设。见“详细资料”。


参数:paired
a logical indicating whether you want a paired test.
逻辑指示是否要配对的测试。


参数:exact
a logical indicating whether an exact p-value should be computed.
逻辑是否应计算一个确切的p值。


参数:correct
a logical indicating whether to apply continuity correction in the normal approximation for the p-value.
逻辑说明是否适用于在正常近似连续性校正p值。


参数:conf.int
a logical indicating whether a confidence interval should be computed.
逻辑指示是否应计算置信区间。


参数:conf.level
confidence level of the interval.
区间的置信水平。


参数:formula
a formula of the form lhs ~ rhs where lhs is a numeric variable giving the data values and rhs a factor with two levels giving the corresponding groups.
一个公式的形式lhs ~ rhs其中lhs是一个数值变量提供的数据值和rhs的因素有两个级别给予相应的组。


参数:data
an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula.  By default the variables are taken from environment(formula).
一个可选的矩阵或数据框(或类似:看到model.frame)包含公式formula的变量。默认情况下采取的变量从environment(formula)。


参数:subset
an optional vector specifying a subset of observations to be used.
一个可选的向量,指定要使用的意见的一个子集。


参数:na.action
a function which indicates what should happen when the data contain NAs.  Defaults to getOption("na.action").
一个函数,它表示数据时,包含NA的,应该发生什么。 getOption("na.action")默认。


参数:...
further arguments to be passed to or from methods.
进一步的参数被传递到或从方法。


Details

详情----------Details----------

The formula interface is only applicable for the 2-sample tests.
2样本测试只适用公式界面。

If only x is given, or if both x and y are given and paired is TRUE, a Wilcoxon signed rank test of the null that the distribution of x (in the one sample case) or of x - y (in the paired two sample case) is symmetric about mu is performed.
如果只x,或如果这两个x和y和paired是TRUE,Wilcoxon秩空试验的分布x(一个样品的情况下)或x - y(在配对的两个样本的情况)是mu进行对称。

Otherwise, if both x and y are given and paired is FALSE, a Wilcoxon rank sum test (equivalent to the Mann-Whitney test: see the Note) is carried out.  In this case, the null hypothesis is that the distributions of x and y differ by a location shift of mu and the alternative is that they differ by some other location shift (and the one-sided alternative "greater" is that x is shifted to the right of y).
否则,如果x和y有paired是FALSE,Wilcoxon秩和检验(相当于的Mann-Whitney检验:见注)进行出。在这种情况下,原假设是分布x和y不同的位置移mu“的另一种方法是,他们通过一些其他的位置移位(一个不同片面替代"greater"是x被转移到y)的权利。

By default (if exact is not specified), an exact p-value is computed if the samples contain less than 50 finite values and there are no ties.  Otherwise, a normal approximation is used.
(exact如果未指定),默认情况下,一个确切的p值计算,如果样品中含有有限值小于50,有没有关系。否则,一个正常的近似。

Optionally (if argument conf.int is true), a nonparametric confidence interval and an estimator for the pseudomedian (one-sample case) or for the difference of the location parameters x-y is computed.  (The pseudomedian of a distribution F is the median of the distribution of (u+v)/2, where u and v are independent, each with distribution F.  If F is symmetric, then the pseudomedian and median coincide.  See Hollander & Wolfe (1973), page 34.)  Note that in the two-sample case the estimator for the difference in location parameters does not estimate the difference in medians (a common misconception) but rather the median of the difference between a sample from x and a sample from y.
可选的(如果参数conf.int是真实的),非参数的置信区间和一个估计为pseudomedian(一个样品的情况下)或位置参数的区别x-y计算。 (分布F pseudomedian是(u+v)/2,u和v是独立的,每个分布F如果分布的中位数F是对称的,那么,pseudomedian和中位数一致。霍兰德和沃尔夫(1973),第34页)。请注意,在两个样本的情况下估计位置参数的差异并不估计中位数的差异(一个常见的误解),而是中位数从x和y样本样本之间的差异。

If exact p-values are available, an exact confidence interval is obtained by the algorithm described in Bauer (1972), and the Hodges-Lehmann estimator is employed.  Otherwise, the returned confidence interval and point estimate are based on normal approximations.  These are continuity-corrected for the interval but not the estimate (as the correction depends on the alternative).
如果确切的p值,得到一个确切的置信区间鲍尔(1972年)中描述的算法,并采用霍奇斯莱曼估计。否则,返回的置信区间和点估计的基础上正常的近似。这些都是连续性的修正区间,但没有估计(作为校正取决于alternative)。

With small samples it may not be possible to achieve very high confidence interval coverages. If this happens a warning will be given and an interval with lower coverage will be substituted.
小样本,可能无法达到非常高的置信区间覆盖。如果发生这种情况,将给予警告和覆盖率较低的时间间隔将被替换。


值----------Value----------

A list with class "htest" containing the following components:
一类"htest"包含以下组件的列表:


参数:statistic
the value of the test statistic with a name describing it.
的名字描述的检验统计量的值。


参数:parameter
the parameter(s) for the exact distribution of the test statistic.
为检验统计量的精确分布参数(S)。


参数:p.value
the p-value for the test.
p值的测试。


参数:null.value
the location parameter mu.
位置参数mu。


参数:alternative
a character string describing the alternative hypothesis.
字符串描述替代假说。


参数:method
the type of test applied.
应用类型的测试。


参数:data.name
a character string giving the names of the data.
字符串提供的数据的名称。


参数:conf.int
a confidence interval for the location parameter. (Only present if argument conf.int = TRUE.)
一个位置参数的置信区间。 (目前唯一的参数conf.int = TRUE。)


参数:estimate
an estimate of the location parameter. (Only present if argument conf.int = TRUE.)
位置参数的估计。 (目前唯一的参数conf.int = TRUE。)


警告----------Warning----------

This function can use large amounts of memory and stack (and even crash R if the stack limit is exceeded) if exact = TRUE and one sample is large (several thousands or more).
此功能可以使用大量的内存和栈(甚至崩溃R如果超出堆栈限制),如果exact = TRUE和一个样本是大(数千或更多)。


注意----------Note----------

The literature is not unanimous about the definitions of the Wilcoxon rank sum and Mann-Whitney tests.  The two most common definitions correspond to the sum of the ranks of the first sample with the minimum value subtracted or not: R subtracts and S-PLUS does not, giving a value which is larger by m(m+1)/2 for a first sample of size m.  (It seems Wilcoxon's original paper used the unadjusted sum of the ranks but subsequent tables subtracted the minimum.)
文学是不Wilcoxon秩和Mann-Whitney检验的定义一致。两种最常见的定义对应的第一个样品的最低值减去或不行列的总和:R减去,S-PLUS不,给m(m+1)/2大值,这是第一个样本大小m。 (似乎秩的原始文件,使用未经调整队伍的总和,但随后的表中减去最低。)

R's value can also be computed as the number of all pairs (x[i], y[j]) for which y[j] is not greater than x[i], the most common definition of the Mann-Whitney test.
R的值也可以作为所有对数计算(x[i], y[j]),y[j]是不是比x[i],最常见的定义Mann-Whitney检验。


参考文献----------References----------

Constructing confidence sets using rank statistics. Journal of the American Statistical Association 67, 687–690.
Nonparametric Statistical Methods. New York: John Wiley &amp; Sons. Pages 27&ndash;33 (one-sample), 68&ndash;75 (two-sample).<br> Or second edition (1999).

参见----------See Also----------

psignrank, pwilcox.
psignrank,pwilcox。

wilcox_test in package coin for exact, asymptotic and Monte Carlo conditional p-values, including in the presence of ties.
wilcox_test包coin确切的,渐进的和蒙特卡洛条件的p-值,包括中存在的关系。

kruskal.test for testing homogeneity in location parameters in the case of two or more samples; t.test for an alternative under normality assumptions [or large samples]
kruskal.test同质化的情况下在两个或两个以上的样本位置参数测试;t.test为常态假设[或大样本下替代


举例----------Examples----------


require(graphics)
## One-sample test.[#一个样本测试。]
## Hollander &amp; Wolfe (1973), 29f.[#霍兰德和沃尔夫(1973),29F。]
## Hamilton depression scale factor measurements in 9 patients with[#汉密尔顿抑郁量表因数测量9例]
##  mixed anxiety and depression, taken at the first (x) and second[#混合性焦虑和抑郁症,在第一(x)和第二]
##  (y) visit after initiation of a therapy (administration of a[#(Y)开始治疗后的访问(一个管理]
##  tranquilizer).[#镇静剂)。]
x <- c(1.83,  0.50,  1.62,  2.48, 1.68, 1.88, 1.55, 3.06, 1.30)
y <- c(0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29)
wilcox.test(x, y, paired = TRUE, alternative = "greater")
wilcox.test(y - x, alternative = "less")    # The same.[相同。]
wilcox.test(y - x, alternative = "less",
            exact = FALSE, correct = FALSE) # H&amp;W large sample[H&W公司的大样本]
                                            # approximation[近似]

## Two-sample test.[#两个样本测试。]
## Hollander &amp; Wolfe (1973), 69f.[#霍兰德和沃尔夫(1973),69f。]
## Permeability constants of the human chorioamnion (a placental[#渗透的人类chorioamnion的常数(1胎盘]
##  membrane) at term (x) and between 12 to 26 weeks gestational[#膜)(X)在长期与12至26周妊娠]
##  age (y).  The alternative of interest is greater permeability[#年龄(Y)。利益的另一种方法是更大的渗透]
##  of the human chorioamnion for the term pregnancy.[#人类chorioamnion足月妊娠。]
x <- c(0.80, 0.83, 1.89, 1.04, 1.45, 1.38, 1.91, 1.64, 0.73, 1.46)
y <- c(1.15, 0.88, 0.90, 0.74, 1.21)
wilcox.test(x, y, alternative = "g")        # greater[更大的]
wilcox.test(x, y, alternative = "greater",
            exact = FALSE, correct = FALSE) # H&amp;W large sample[H&W公司的大样本]
                                            # approximation[近似]

wilcox.test(rnorm(10), rnorm(10, 2), conf.int = TRUE)

## Formula interface.[#公式接口。]
boxplot(Ozone ~ Month, data = airquality)
wilcox.test(Ozone ~ Month, data = airquality,
            subset = Month %in% c(5, 8))

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-23 05:59 , Processed in 0.023483 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表