tmax in case of ties: StatXact, Phoenix, and... [Nonparametrics]
❝ Ok, this thread could also go into the category "R for BE/BA". But this here is Helmut's favorite .
Right. But if ties are considered, you are stirring up a hornets' nest!
❝ Since in case of tmax there are usually some/many equal values (ties in the non-parametric methods speak) the used software should be able to handle such.
Well, cough…
Summary of your results (T-R) - changed signs if necessary and divided by 2:
program PE 90.26% CI
library(exactRankTests) +0.125 -0.25 +0.75
library(coin) +0.25 -0.25 +0.75
SAS (asymptotic) +0.25 -0.25 +0.75
SAS (exact) +0.25 -0.25 +0.75
My quick and dirty solution:
PKt$pdiff <- (PKt$P1 - PKt$P2)/2
PKt$sequence <- relevel(PKt$sequence, ref="TR")
PKt$sequence
[1] TR RT TR RT TR RT TR RT TR RT TR RT TR RT
Levels: TR RT
require(exactRankTests)
t1 <- wilcox.exact(pdiff ~ sequence, data=PKt, conf.int=TRUE, conf.level=0.9)
print(t1)
Exact Wilcoxon rank sum test
data: pdiff by sequence
W = 31, p-value = 0.4149
alternative hypothesis: true mu is not equal to 0
90 percent confidence interval:
-0.50 0.75
sample estimates:
difference in location
0.125
require(coin)
t2 <- wilcox_test(pdiff ~ sequence, data=PKt, conf.int=TRUE, conf.level=0.9,
distribution="exact")
print(t2)
Exact Wilcoxon Mann-Whitney Rank Sum Test
data: pdiff by sequence (TR, RT)
Z = 0.8465, p-value = 0.4149
alternative hypothesis: true mu is not equal to 0
90 percent confidence interval:
-0.25 0.75
sample estimates:
difference in location
0.25
❝ Any body out there who knows whats going on here?
Hhm; don't use
library(exactRankTests)
?Hauschke et al. (1990) don't speak about ties; they refer to Hollander and Wolfe.1 In my edition the word 'tie' is not even mentioned in the subject index… With my mid-1990 implementation in Rocky Mountain BASIC (not corrected for ties) I get:
PE 90.26% CI
+0.25 -0.25 +0.75
Now for StatXact 6.1. using the coding according to Senn (2002) I get:
PE 90.26% CI
asymptotic +0.50 -0.25 +1.00
exact +0.50 -0.25 +1.00
What the heck?
Phoenix 6.1 (asymptotic), according to Koch2 (no ties!):
PE 90.26% CI
+0.25 -0.25 +0.75
EquivTest/PK (asymptotic):
PE 90.26% CI
+0.25 -0.25 +0.75
Not a single word about ties in the manuals of Phoenix and EquivTest/PK.
StatXact states:
[…] zero differences are ignored. We assume initially that there are no ties in the observed values of the Di's. We will show subsequently how to adjust for the possibility of ties. […] By suitably adapting the reasoning in Lehmann (1975, pages 181 to 182) so as to accommodate ties one can show that the probability that the interval [λ*, λ*] excludes λ is at most α. This ensures that the Hodges-Lehmann confidence intervals preserve the desired coverage probability.

In a more recent textbook3 the common procedure of using mid-ranks for ties is given. According to this reference StatXact adjusts for ties. But I'm not so sure anymore. Open questions:
- Signs… (sigh!) I've checked the coding in all programs numerous times, but don't know what's going on here. Fishbrain. I guess the reason might be that you are comparing period differences rather than treatment differences. Since we have a balanced case here, it might explain the opposite signs.
- In my understanding
wilcox_test()
does not correct for ties. I triedties.method="mid-ranks"
andties.method="average-scores"
and got:
Warning:
In independence_test.IndependenceProblem(object, teststat = "scalar", :
additional arguments ties.method will be ignored
- Apart from the signs, the numerical values are identical with the exception of StatXact's results and the PE in R's exactRankTests. We have four out of 14 cases with a zero difference. If I manually exclude these cases from the dataset I get exactly the same results as for the full dataset.
- If I exclude subjects with a zero difference (1, 3, 104, 14) I get StatXact's results in all (!) other programs… So what do we have here? One program (maybe!) adjusts for ties, but excludes zero differences.
❝ Sorry for that lengthy post.
So am I. You gave me a nice excuse not to spend the afternoon struggling with my income tax return.
- Holander M, Wolfe DA. Nonparametric Statistical Methods. New York: Wiley; 1973.
- Koch GG. The Use of Non-Parametric Methods in the Statistical Analysis of the Two-Period Change-Over Design. Biometrics. 1972: 28; 578–85. PMID 4556704.
- Sprent P, Smeeton NC. Applied Nonparametric Statistical Methods. Boca Raton: Chapman & Hall/CRC; 4th ed. 2007.
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- tmax in case of ties: R vs. R vs. SAS d_labes 2010-09-10 12:05 [Nonparametrics]
- tmax in case of ties: StatXact, Phoenix, and...Helmut 2010-09-10 18:28
- Ties, no ties, ties, no ties ... d_labes 2010-09-13 13:21
- simulation martin 2010-09-14 08:33
- simulants of the world unite d_labes 2010-09-15 10:14
- simulants of the world unite martin 2010-09-15 14:53
- simulants of the world unite Helmut 2010-09-15 16:17
- simul ants with no ties d_labes 2010-09-16 11:19
- simul ants with no ties Helmut 2010-09-16 14:01
- two different approaches martin 2010-09-16 15:35
- simul ants with no ties Helmut 2010-09-16 14:01
- simul ants with no ties d_labes 2010-09-16 11:19
- simulants of the world unite Helmut 2010-09-15 16:17
- simulants of the world unite martin 2010-09-15 14:53
- simulants of the world unite d_labes 2010-09-15 10:14
- simulation martin 2010-09-14 08:33
- Ties, no ties, ties, no ties ... d_labes 2010-09-13 13:21
- evaluation of tmax: use of relative effects? martin 2010-09-16 18:04
- Not positive about that Helmut 2010-09-16 19:52
- Not positive about that martin 2010-09-16 21:00
- Stupidity Helmut 2010-09-17 13:10
- Not positive about that martin 2010-09-16 21:00
- Not positive about that Helmut 2010-09-16 19:52
- tmax in case of ties: R vs. R vs. SAS Jack 2010-09-20 14:03
- R packages Helmut 2010-09-20 14:20
- R packages code d_labes 2010-09-27 11:27
- R packages Jack 2010-09-27 16:14
- Is Exact exact? d_labes 2010-09-27 09:53
- R packages Helmut 2010-09-20 14:20
- tmax in case of ties: StatXact, Phoenix, and...Helmut 2010-09-10 18:28