[R] wilcox_test function in coin package

Peter Ehlers ehlers at ucalgary.ca
Sat Jun 1 00:50:04 CEST 2013


On 2013-05-30 20:20, Janh Anni wrote:
> Hello Greg,
>
> Thank you so much for your kind assistance.  It looks like there's no way
> around using the formula format.  I longed in vain for a simpler script
> more like the wilcox.test format.  Thanks again.
>
> Janh

I don't see why the formula syntax would be a problem, but to avoid it
you could use exactRankTests::wilcox.exact() which, I believe, was
written by the same author. It uses the same syntax as wilcox.test(). 
Note, though, that the package is no longer
being developed.

Peter Ehlers

>
>
> On Thu, May 30, 2013 at 6:21 PM, Greg Snow <538280 at gmail.com> wrote:
>
>> Ok, it looks like the function mainly works through the formula syntax.
>>   It still would have been nice to have a reproducible example of what your
>> data may look like, but I can show an example with simulated x and y:
>>
>>> x <- rpois(10, 3)
>>> y <- rpois(11, 3.1)
>>> mydf <- data.frame( vals = c(x,y),
>> +   group=rep( c('x','y'), c( length(x), length(y) ) ) )
>>> wilcox_test( vals ~ group, data=mydf )
>>
>>          Asymptotic Wilcoxon-Mann-Whitney Test
>>
>> data:  vals by group (x, y)
>> Z = -1.3718, p-value = 0.1701
>> alternative hypothesis: true mu is not equal to 0
>>
>> Does that help?  (maybe I am the heedlessness theorist after all)
>>
>>
>>
>> On Thu, May 30, 2013 at 4:14 PM, Janh Anni <annijanh at gmail.com> wrote:
>>
>>> I thought (hoped) wilcox_test(x,y) would do it but it doesn't and the
>>> package maintainer says the data have to be rearranged but does not specify
>>> how.  Thanks
>>>
>>> Janh
>>>
>>>
>>>
>>> On Thu, May 30, 2013 at 6:05 PM, Greg Snow <538280 at gmail.com> wrote:
>>>
>>>> What have you tried so far?  Have you read the help page? have you run
>>>> the examples on that page?
>>>>
>>>> I would expect that it is something as simple as
>>>>
>>>> library(coin)
>>>> wilcox_test(x,y)
>>>>
>>>> or
>>>>
>>>> wilcox_test( y ~ group )
>>>>
>>>> But you should trust the help page more than the expectations of someone
>>>> who has not read it recently (see fortune(14)).
>>>>
>>>> If that does not answer your question then give us more detail on what
>>>> you tried, what you expected the results to be, what the results actually
>>>> were, and how they differed.  Without that information we have to resort to
>>>> mind reading and the current implementation of the esp package is still
>>>> very pre-alpha, it suggests that the answer to your question is:
>>>>
>>>>> esp()
>>>> [1] "selflessly vigilantly pigeon theorist heedlessness"
>>>>
>>>> Which is either much to profound for the likes of me to understand or is
>>>> complete gibberish (which is only slightly less helpful than an overly
>>>> general question without a reproducible example).
>>>>
>>>>
>>>> On Thu, May 30, 2013 at 2:07 PM, Janh Anni <annijanh at gmail.com> wrote:
>>>>
>>>>> Dear All,
>>>>>
>>>>> I have two simple data samples (no groups or factors, etc.) and would
>>>>> just
>>>>> like to compute the two-sample Wilcoxon Rank Sum test using the
>>>>> wilcox_test
>>>>> function contained in the coin package, which is reportedly better than
>>>>> the
>>>>> regular wilcox.test function because it performs some adjustment for
>>>>> ties.
>>>>> Would anyone know how to craft a script to perform this task?  Much
>>>>> appreciated.
>>>>>
>>>>> Janh
>>>>>
>>>>>          [[alternative HTML version deleted]]
>>>>>
>>>>> ______________________________________________
>>>>> R-help at r-project.org mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>>> PLEASE do read the posting guide
>>>>> http://www.R-project.org/posting-guide.html
>>>>> and provide commented, minimal, self-contained, reproducible code.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Gregory (Greg) L. Snow Ph.D.
>>>> 538280 at gmail.com
>>>>
>>>
>>>
>>
>>
>> --
>> Gregory (Greg) L. Snow Ph.D.
>> 538280 at gmail.com
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list