inuyasha
k-s检验公式:Dn=max{abs[f(x)-fn(x)},其中fn(x)是假设的分布函数
R中 ks检验结果得出:
One-sample Kolmogorov-Smirnov test
data: x
D = 0.0686, p-value = 0.958
alternative hypothesis: two-sided
这个结果怎么分析呢?D的值是什么呀?是公式中的Dn吗?
yihui
是。D很小,P-value很大,不足以拒绝零假设(数据来自某分布)。
inuyasha
谢谢管理员,呵呵
cyy024
alternative hypothesis: two-sided
请问这个结果是什么意思? 两边?
R的帮助文档中有下面这个例子:
ks.test(x+2, "pgamma", 3, 2, alternative = "gr")
其中alternative有三个备选项:"two.sided" (default), "less", or "greater". 分别表示什么意义呢?
是不是只有单样本检验 需要设置alternative
如果是双样本检验,直接ks.test(x,y)即可?
谢谢~
zwzcosname
?ks.test
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_u [ 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.