R中多重比较的成对检验(Nemenyi检验)

Posted

技术标签:

【中文标题】R中多重比较的成对检验(Nemenyi检验)【英文标题】:Pairwise Test for Multiple comparisons (Nemenyi Test) in R 【发布时间】:2015-10-06 18:19:44 【问题描述】:

我正在使用包 PMCMR 执行博士后 Kruskal-Nemenyi 测试。 当我使用默认设置运行测试时:

posthoc.kruskal.nemenyi.test(x=coastal$HIGH_MORTGAGE, g=coastal$SIZECLASS, method="Tukey")

我得到以下结果和警告:

Pairwise comparisons using Tukey and Kramer (Nemenyi) test  
                   with Tukey-Dist approximation for independent samples

data:  coastal$HIGH_MORTGAGE and coastal$SIZECLASS 

       Large Medium
Medium 0.931 -     
Small  0.746 0.078 

P value adjustment method: none

Warning message:
In posthoc.kruskal.nemenyi.test.default(x = coastal$HIGH_MORTGAGE,  :
  Ties are present, p-values are not corrected.*

当我运行测试将分布更改为 Chisq 以对关系进行校正时,我仍然得到相同的结果,并且不使用卡方分布。

posthoc.kruskal.nemenyi.test(x=coastal$HIGH_MORTGAGE, g=coastal$SIZECLASS, method="Chisq")

Pairwise comparisons using Tukey and Kramer (Nemenyi) test  
                   with Tukey-Dist approximation for independent samples

data:  coastal$HIGH_MORTGAGE and coastal$SIZECLASS

       Large Medium
Medium 0.931 -     
Small  0.746 0.078

P value adjustment method: none 

Warning message:
In posthoc.kruskal.nemenyi.test.default(x = coastal$HIGH_MORTGAGE,  :
  Ties are present, p-values are not corrected.

我想知道包中是否存在错误,或者是否有任何我不知道的方法来解决这个问题。

【问题讨论】:

【参考方案1】:

从版本PMCMR1.0PMCMR1.1(和> 1.1)语法略有变化,所以它是dist,而不是method,它是:

posthoc.kruskal.nemenyi.test( x, g, dist = c("Tukey", "Chisquare"), ...)

posthoc.kruskal.nemenyi.test(formula, data, subset, na.action, dist =
 c("Tukey", "Chisquare"), ...)

包含示例的小插图已相应更新到版本 PMCMR1.3

【讨论】:

非常感谢!非常感谢!

以上是关于R中多重比较的成对检验(Nemenyi检验)的主要内容,如果未能解决你的问题,请参考以下文章