[R] stratified Wilcoxon available?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Aug 30 15:46:44 CEST 2005


torsten at hothorn.de writes:

> > Nice to see that the old code made sense.
> 
> Nice to see that the new code is working correctly :-)
> 
> > A bit surprising that it
> > gives _exactly_ the same result as the blockwise ranking in coin...
> 
> why? Without ties, the conditional and unconditional versions of the tests
> should have exactly the same result.

Oh, just that there are a number of little things that could have been
done in slightly different but asymptotically equivalent ways. The
scale factor for the within-block ranks e.g.
 
> > Perhaps introduce some ties? (round(y,1) is usually effective).
> >
> 
> this should generate differences, yes.
> 
> > The trend test is easily fixed: just spell "t value" without capital V
> > as we do nowadays. This gives
> >
> >
> > > SKruskal.test(y ~ x | b, data = mydf, trend = TRUE)
> >
> >         Kruskal-Wallis stratified rank sum trend test
> >
> > data:  y , group:  x , strata:  b , trend:  as.numeric(group)
> > Z = -0.1624, df = 1, p-value = 0.871
> >
> > > SKruskal.test(y ~ x | b, data = mydf, trend = 1:3)
> >
> >         Kruskal-Wallis stratified rank sum trend test
> >
> > data:  y , group:  x , strata:  b , trend:  1 2 3
> > Z = -0.1624, df = 1, p-value = 0.871
> >
> > (The df=1 is a bit misleading in this case...)
> >
> 
> maybe report 0.1624^2 = 0.0264 as test statistic (same as with teststat
> = "quad" in `coin')?

Yes, but there was a point in getting a signed statistic. Otherwise, I
might as well have reused the code that used the SSD from the anova
table. 

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907




More information about the R-help mailing list