Skip to content
Back to formatted view

Raw Message

Message-ID: <16209B07-F65E-4F7B-AC06-5F7C2ED2CDC7@comcast.net>
Date: 2011-11-21T20:16:25Z
From: David Winsemius
Subject: count ties after rank?
In-Reply-To: <805CF575416A5648A33D58C35B7D3552AD604E06@it-monad.sooner.net.ou.edu>

On Nov 21, 2011, at 2:36 PM, Hao, Zhaozhe wrote:

> Hello!
>
>    I need to use Kruskal-Wallis test and post-hoc test (Dunn's test)  
> for my data. But when I searched around,

"Searching around" is a bit vague as a search strategy:

Try :kruskal dunn" at the location that RSiteSearch gets you to:

http://search.r-project.org/cgi-bin/namazu.cgi?query=kruskal+Dunn&max=100&result=normal&sort=score&idxname=functions&idxname=Rhelp08&idxname=Rhelp10&idxname=Rhelp02

Or in its default settings:

http://search.r-project.org/cgi-bin/namazu.cgi?query=kruskal+Dunn&max=100&result=normal&sort=score&idxname=functions&idxname=vignettes&idxname=views


> I only found this function: kruskal.test. But nothing for Dunn's test.
>
>    So I started to write one myself.

You are perhaps referring to what others are callng the  Nemenyi- 
Damico-Wolfe-Dunn test. See the last example in the entry that ? 
kruskal_test would have gotten you... had you known where it was.

install.packages("coin")
require(coin)
help("LocationTests")


>  But  I do not know how to count ties in the data frame. I can use  
> for loops but it seems long and unnecessary since the rank function  
> actually knows the ties. So can anyone give me a hint on how I can  
> "count" the number of ties?
>
>    Many thanks.


-- 
David Winsemius, MD
West Hartford, CT