simulants of the world unite [Nonparametrics]

posted by martin  – Austria, 2010-09-15 16:53 (5748 d 18:00 ago) – Posting: # 5915
Views: 27,407

dear d_labes!

❝ I have one small doubt. I'm not quite sure but should we not include the CI borders in counting the coverage due to the definition of the CI?


thank you very much for pointing this out; IMHO you are right - this is crucial in the case of ties. here is a little bit faster version of the simulation code (ca. 30 min on my CPU)

date()
[1] "Wed Sep 15 14:16:44 2010"
set.seed(130910)
n <- 10
nsim <- 1E4
cover1 <- 0
cover2 <- 0
grp <- as.factor(c(rep('A', n), rep('B', n)))
for(i in 1:nsim){
    x <- round(rnorm(2*n, mean=0, sd=1),1)
    res1 <- confint(wilcox_test(x~grp, distribution='exact', conf.int=TRUE,
    conf.level=0.95))$conf.int
    res2 <- wilcox.exact(x~grp, conf.int=TRUE, conf.level=0.95)$conf.int
      if(res1[1] <= 0 & res1[2] >= 0){cover1 <- cover1 + 1}
      if(res2[1] <= 0 & res2[2] >= 0){cover2 <- cover2 + 1}
  }
print(cover1/nsim)
[1] 0.9609
print(cover2/nsim)
[1] 0.9682
date()
[1] "Wed Sep 15 14:46:26 2010"


and here I am, for all my lore, the wretched fool I was before (Goethe)

martin

Complete thread:

UA Flag
Activity
 Admin contact
23,653 posts in 4,991 threads, 1,571 registered users;
164 visitors (0 registered, 164 guests [including 19 identified bots]).
Forum time: 10:53 CEST (Europe/Vienna)

Outside his own ever-narrowing field of specialization,
a scientist is a layman.
What members of an academy of science have in common
is a certain form of semiparasitic living.    Erwin Chargaff

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