[R] Simple General Statistics and R question (with 3 line example) - get z value from pairwise.wilcox.test

JP jeanpaul.ebejer at inhibox.com
Thu May 5 10:58:59 CEST 2011


On 4 May 2011 15:32, peter dalgaard <pdalgd at gmail.com> wrote:

>
> On May 4, 2011, at 15:11 , JP wrote:
>
>> Peter thanks for the fantastically simple and understandable explanation...
>>
>> To sum it up... to find the z values of a number of pairwise wilcox
>> tests do the following:
>>
>> # pairwise tests with bonferroni correction
>> x <- pairwise.wilcox.test(a, b, alternative="two.sided",
>> p.adj="bonferroni", exact=F, paired=T)
>
>
> You probably don't want the bonferroni correction there. Rather p.adj="none". You generally correct the p values for multiple testing, not the test statistics.
>

Oh, I see thanks... of course since I have 5 groups (samples) and 10
comparisons I still have to correct when quoting p values...


> (My sentiment would be to pick apart the stats:::wilcox.test.default function and clone the computation of Z from it, but presumably backtracking from the p value is a useful expedient.)
>

Should this be so onerous for the user [read non-statistician] ?


>> # what is the data structure we got back
>> is.matrix(x$p.value)
>> # p vals
>> x$p.value
>> # z.scores for each
>> z.score <- qnorm(x$p.value / 2)
>>
>
> Hmm, you're not actually getting a signed z out of this, you might want to try alternative="greater" and drop the division by 2 inside qnorm(). (If the signs come out inverted, I meant "less" not "greater"...)
>

But I need a two sided test (changing the alternative would change the
hypothesis!)...  do I still do this?
All my z values are negative....

Is this correct?



More information about the R-help mailing list