I need to run non-parametric test and posthoc test on my data, I was using PMCMRPlus package, but after upgrading MacOS to Ventura RStudio doesn't run anymore. Does anyone have any suggestions for another package for this posthoc test?
Error: 'posthoc.kruskal.nemenyi.test.default' is defunct.
Use 'PMCMRplus::kwAllPairsNemenyiTest' instead.
See help("Defunct") and help("PMCMR-defunct").
library(PMCMRplus)
ans <- posthoc.kruskal.nemenyi.test.default(count ~ spray, data = InsectSprays)
#> Error in posthoc.kruskal.nemenyi.test.default(count ~ spray, data = InsectSprays): could not find function "posthoc.kruskal.nemenyi.test.default"
ans <- kwAllPairsNemenyiTest(count ~ spray, data = InsectSprays)
#> Warning in kwAllPairsNemenyiTest.default(c(10, 7, 20, 14, 14, 12, 10, 23, : Ties
#> are present, p-values are not corrected.
summary(ans)
#>
#> Pairwise comparisons using Tukey-Kramer-Nemenyi all-pairs test with Tukey-Dist approximation
#> data: count by spray
#> alternative hypothesis: two.sided
#> P value adjustment method: single-step
#> H0
#> q value Pr(>|q|)
#> B - A == 0 0.441 0.99960707
#> C - A == 0 6.738 2.7914e-05 ***
#> D - A == 0 4.400 0.02292762 *
#> E - A == 0 5.435 0.00169497 **
#> F - A == 0 0.572 0.99861029
#> C - B == 0 7.179 5.7061e-06 ***
#> D - B == 0 4.841 0.00812908 **
#> E - B == 0 5.876 0.00046606 ***
#> F - B == 0 0.131 0.99999905
#> D - C == 0 2.338 0.56300179
#> E - C == 0 1.303 0.94108652
#> F - C == 0 7.311 3.4955e-06 ***
#> E - D == 0 1.035 0.97809294
#> F - D == 0 4.973 0.00584731 **
#> F - E == 0 6.007 0.00031142 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Thank you so much!
but now I have another problem, kruskal.test is significant and the posthoc test doesn't shows difference. Could it be due to the message that "p-values are not corrected" using kwAllPairsNemenyiTest?
kruskal.test(DESEMP$TCE~trat)
Kruskal-Wallis rank sum test
data: DESEMP$TCE by trat
Kruskal-Wallis chi-squared = 26.446, df = 14, p-value = 0.02271
ansTCE <- kwAllPairsNemenyiTest(DESEMP$TCE~trat, dist = c("Tukey", "Chisquare"))
Warning message:
In kwAllPairsNemenyiTest.default(c(71.07142857, 32.88095238, -33.19047619, :
Ties are present, p-values are not corrected.
summary(ansTCE)
Pairwise comparisons using Tukey-Kramer-Nemenyi all-pairs test with Tukey-Dist approximation
signifies that there were tied ranks. For an explanation of how this affects the way in which test statistics are calculated, see this paper by the package author.