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

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

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

                                        Kolmogorov-Smirnov Tests
                                         柯尔莫哥洛夫 - 斯米尔诺夫检验

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

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

Perform a one- or two-sample Kolmogorov-Smirnov test.
执行一或两样本Kolmogorov-Smirnov检验。


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


ks.test(x, y, ...,
        alternative = c("two.sided", "less", "greater"),
        exact = NULL)



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

参数:x
a numeric vector of data values.
数字矢量数据值。


参数:y
either a numeric vector of data values, or a character string naming a cumulative distribution function or an actual cumulative distribution function such as pnorm.  Only continuous CDFs are valid.
无论是数据值的数字向量,或一个字符串,命名累积分布函数或实际的累积分布函数为pnorm。只有不断CDFS是有效的。


参数:...
parameters of the distribution specified (as a character string) by y.
指定y(字符串)的分布参数。


参数:alternative
indicates the alternative hypothesis and must be one of "two.sided" (default), "less", or "greater".  You can specify just the initial letter of the value, but the argument name must be give in full. See "Details" for the meanings of the possible values.
表示替代假说,必须是一个"two.sided"(默认),"less"或"greater"。您可以指定值的首字母,但必须给予充分的参数名称。见“详细资料”的可能值的含义。


参数:exact
NULL or a logical indicating whether an exact p-value should be computed.  See "Details" for the meaning of NULL.  Not available in the two-sample case for a one-sided test or if ties are present.
NULL或逻辑是否应计算一个确切的p值。为NULL的含义,请参阅“详细资料”。一种片面的测试或两样本的情况下,如果关系不存在。


Details

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

If y is numeric, a two-sample test of the null hypothesis that x and y were drawn from the same continuous distribution is performed.
如果y是数字,两样本测试的零假设,那x和y从同一连续分布绘制完成。

Alternatively, y can be a character string naming a continuous (cumulative) distribution function, or such a function.  In this case, a one-sample test is carried out of the null that the distribution function which generated x is distribution y with parameters specified by ....
另外,y可以是一个字符串,命名连续(累计)的分布函数,这样的功能。在这种情况下,一个样品的测试进行了空,生成的x是分布的分布函数y与...指定的参数。

The presence of ties always generates a warning, since continuous distributions do not generate them.  If the ties arose from rounding the tests may be approximately valid, but even modest amounts of rounding can have a significant effect on the calculated statistic.
在场的关系总是会生成一个警告,因为连续分布不产生它们。如果出现四舍五入的关系可能会测试约有效,但四舍五入,甚至温和的金额可以计算统计上有显着影响。

Missing values are silently omitted from x and (in the two-sample case) y.
遗漏值都静静地省略从x“(在两样本的情况下)y。

The possible values "two.sided", "less" and "greater" of alternative specify the null hypothesis that the true distribution function of x is equal to, not less than or not greater than the hypothesized distribution function (one-sample case) or the distribution function of y (two-sample case), respectively.  This is a comparison of cumulative distribution functions, and the test statistic is the maximum difference in value, with the statistic in the "greater" alternative being D^+ = max[F_x(u) - F_y(u)]. Thus in the two-sample case alternative = "greater" includes distributions for which x is stochastically smaller than y (the CDF of x lies above and hence to the left of that for y), in contrast to t.test or wilcox.test.
可能的值"two.sided","less"和"greater"alternativex真正的分布函数等于指定的零假设,不低于或不大于假设分布函数(单样本的情况下)或y(两样本的情况下)的分布函数,分别。这是一个累积分布函数的比较,检验统计量是价值最大的区别是"greater"D^+ = max[F_x(u) - F_y(u)]替代的统计。因此,在两样本的情况下alternative = "greater"包括分布为x的比y(CDF的x在于以上,因此,左随机小y),在对比t.test或wilcox.test。

Exact p-values are not available for the two-sample case if one-sided or in the presence of ties.  If exact = NULL (the default), an exact p-value is computed if the sample size is less than 100 in the one-sample case and there are no ties, and if the product of the sample sizes is less than 10000 in the two-sample case. Otherwise, asymptotic distributions are used whose approximations may be inaccurate in small samples.  In the one-sample two-sided case, exact p-values are obtained as described in Marsaglia, Tsang & Wang (2003) (but not using the optional approximation in the right tail, so this can be slow for small p-values).  The formula of Birnbaum & Tingey (1951) is used for the one-sample one-sided case.
精确的p值是不提供的两样本的情况下,如果片面或关系存在。如果exact = NULL(默认),一个确切的p值计算,如果样本大小是小于100一个样品的情况下,有没有关系,如果产品样本大小是小于10000在两样本的情况下。否则,渐近分布的近似可能是在小样本不准确的。双面的情况下,在一个样品得到精确p值在马尔萨利亚,曾与王(2003)(但不使用可选的逼近,在右侧尾部,所以这可能是缓慢的小p值)。用于一个样本一边倒的情况下,伯恩鲍姆和Tingey的(1951)的公式。

If a single-sample test is used, the parameters specified in ... must be pre-specified and not estimated from the data. There is some more refined distribution theory for the KS test with estimated parameters (see Durbin, 1973), but that is not implemented in ks.test.
如果使用单一样本测试,...指定的参数必须预先指定的,而不是从数据估计。有一些更精细的KS检验与估计参数(见德宾1973)的分布理论,但不是在ks.test实施。


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

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


参数:statistic
the value of the test statistic.
检验统计量的值。


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


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


参数:method
a character string indicating what type of test was performed.
一个字符串,指示什么类型的测试。


参数:data.name
a character string giving the name(s) of the data.
字符串数据的名称(S)。


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

One-sided confidence contours for probability distribution functions. The Annals of Mathematical Statistics, 22/4, 592–596.
Practical Nonparametric Statistics. New York: John Wiley & Sons. Pages 295–301 (one-sample Kolmogorov test), 309–314 (two-sample Smirnov test).
Distribution theory for tests based on the sample distribution function.  SIAM.
Evaluating Kolmogorov's distribution. Journal of Statistical Software, 8/18. http://www.jstatsoft.org/v08/i18/.

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

shapiro.test which performs the Shapiro-Wilk test for normality.
shapiro.test执行常态夏皮罗 - 威尔克测试。


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


require(graphics)

x <- rnorm(50)
y <- runif(30)
# Do x and y come from the same distribution?[做X和Y来自相同的分布?]
ks.test(x, y)
# Does x come from a shifted gamma distribution with shape 3 and rate 2?[的x来自转移的伽玛分布与形状3和2率?]
ks.test(x+2, "pgamma", 3, 2) # two-sided, exact[双面,确切]
ks.test(x+2, "pgamma", 3, 2, exact = FALSE)
ks.test(x+2, "pgamma", 3, 2, alternative = "gr")

# test if x is stochastically larger than x2[测试如果x是随机比X2较大]
x2 <- rnorm(50, -1)
plot(ecdf(x), xlim=range(c(x, x2)))
plot(ecdf(x2), add=TRUE, lty="dashed")
t.test(x, x2, alternative="g")
wilcox.test(x, x2, alternative="g")
ks.test(x, x2, alternative="l")

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-22 23:47 , Processed in 0.024045 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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