Skip to content
Prev 912 / 63424 Next

ctest miscellania

Sorry for leaving this one in my mail box for so long, but - well, I
suppose you know what I mean.

(I'm shifting it over to r-devel, so I'll include all your original
text)  

Kurt Hornik <hornik@ci.tuwien.ac.at> writes:
I really don't think we should do randomized tests, except possibly as
an option. Different people getting different p-values for the same
data??

If one must do it, I conjecture that one could get a "p-value" by
looking at x + runif(1,-.5,.5) and linearly interpolating between - er,
draw a picture of the density of the modified x and think about it...
I think the main point was that they're not *median* tests,
(irrespective of what the SAS output says!) "Location test" is
probably OK. My basic worry was the risk of losing the simplicity of
having well known standard tests called simply t.test(),
wilcoxon.test(), in favour of a perhaps unnecessarily abstract
taxonomy. Of course there's always the possibility to do things like

spearman.test(...) <- function(...) cor.test(..., method="spearman")

etc.
Signed rank is trivial, you just generate the 2^k different sign
patterns and look at the distribution of the sums. Even in interpreted
code, this can be done for k up to 16 or so, at which point the
difference from the approximation is immaterial. The bit patterns are
simply all binary numbers between 0 and 2^k-1.

The two-sample case is a bit more unwieldy...
If one can precompute the size of the array, one can usually allocate
it in R and pass it as a parameter instead.

As you know, *my* main desires for ctest is to allow model formula
specifications for all of the common tests (for consistency), and in
the slightly longer run also include trend tests and stratification.