Is Exact exact? [Nonparametrics]

posted by d_labes  – Berlin, Germany, 2010-09-27 11:53 (5250 d 16:53 ago) – Posting: # 5937
Views: 21,303

Dear Jack,

was on holiday thus I can answer but now.
Thanks for sharing your view.

❝ The coin packages uses the midpoint of the confidence interval as the point estimate for the location difference (ie (0.5-1.5)/2=-0.5 while the exactRankTests packages uses (sort of) the median of the observed differences as the point estimate.


Interesting as Helmut already said. Is it documented elsewhere?

Interesting enough the SAS Proc npar1way gives me both point estimates, Hodges-Lehmann median of the pairwise differences and the CI midpoint. The latter attributed to Lehmann:

Lehmann, E. L. (1963).
"Nonparametric Confidence Intervals for a Shift Parameter"
Annals of Mathematical Statistics, 34, 1507-1512

As noticed in the example above ... (sort of) ... is different from the HL estimate in case of ties.

❝ As for the differences in confidence intervals I presume that it has to do with either the approximation which is uses if n>50 and/or the continuity correction.


No. The example I have shown has n<50 and in that case the calculations will be done "exact" whatever that "exact" means.

Here another peculiarity of the coin package:
library(coin)

set.seed(130910)
n1  <- 10; n2 <-10
mu1 <- 0; mu2 <-0
grp <- as.factor(c(rep('A', n1), rep('B', n2)))
ptm <- proc.time()
nsim <- 500
equalCI <- 0
for(i in 1:nsim){
  x <- c(round(rnorm(n1, mean=mu1, sd=1),1), round(rnorm(n2, mean=mu2, sd=1),1))
  res1 <- confint(wilcox_test(x~grp,
          distribution=exact(algorithm = c("shift")),
          conf.int=TRUE, conf.level=0.90))$conf.int
  res1a <- confint(wilcox_test(x~grp,
          distribution=exact(algorithm = c("split-up")),
          conf.int=TRUE, conf.level=0.90))$conf.int
  if(all.equal(res1,res1a)==TRUE) {equalCI <- equalCI+1}
  if (1000*trunc(i/1000)==i) cat("\n")
  if (50*trunc(i/50)==i & i<nsim) cat(i+1,"") # give a sign of alive
}
cat("\n\n")
cat("shift vs. split-up: equal CIs",equalCI/nsim)
cat("\nsims time\n")
print(proc.time()-ptm)


This gives:
shift vs. split-up: equal CIs 0.73
sims time
   user  system elapsed
 182.67    0.23  184.70


Uuuups! :confused:

Regards,

Detlew

Complete thread:

UA Flag
Activity
 Admin contact
23,379 posts in 4,913 threads, 1,661 registered users;
263 visitors (0 registered, 263 guests [including 6 identified bots]).
Forum time: 03:47 CET (Europe/Vienna)

Statistics is the art of never having to say you’re wrong.
Variance is what any two statisticians are at.    C.J. Bradfield

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5