Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Wilcoxon signed-rank test for clustered data

From   "Harsha" <[email protected]>
To   <[email protected]>
Subject   RE: st: Wilcoxon signed-rank test for clustered data
Date   Wed, 6 Oct 2010 09:06:13 +0530

Dear Roger and Ariel,
Thanks a ton for the help. Yes this definitely helps. This is precisely what
I wanted.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Roger Newson
Sent: 05 October 2010 17:17
To: [email protected]
Subject: Re: st: Wilcoxon signed-rank test for clustered data

The -somersd- package, downloadable from SSC, computes confidence limits 
for a wide range of rank statistics, including clustered ones. In the 
case of the Wilcoxon test for clustered data, we are interested in one 
of 2 statistics, namely Somers' D of outcome with respect to membership 
of the first group (calculated using the -somersd- command) and the 
Hodges-Lehmann median difference between groups (calculated using either 
the -cendif- command or the -censlope- command). All 3 of these commands 
have a -cluster()- option.

As an aside, the Wilcoxon test does not "compare the medians". It tests 
for a zero value for the median difference, which is not usually the 
same thing as a difference between medians (although it is when the 2 
distributions compared are either symmetrical or differ only in 
location). However, it is possible to use -censlope- or -cendif- with 
clustered data to estimate medians (with confidence limits), and then to 
use the -invcise- package, together with the -metaparm- option of 
-parmest-, to get a confidence interval for the difference between 
medians. However, this difference between medians is not a parameter 
corresponding to the Wilcoxon test, and is probably not what Harsha 
really wants. (Correct me if I'm wrong.)

I hope this helps.

Best wishes


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

On 05/10/2010 05:45, Harsha wrote:
> Dear All,
> I have a data comparing a few parameters in a group of patients before and
> after a particular surgery. These surgeries are done on both eyes of a few
> patients resulting in a correlated data. A few variables which I am trying
> to compare are non-parametric. I am trying to apply Wilcoxon signed rank
> test but am faced with the problem of the observations being not
> between the 2 eyes of the patients. There is a program on SAS by Rosner's
> group to use Wilcoxon for clustered data. Is there something similar in
> stata? Is there any other ways to compare the medians between groups in
> correlated data?
> Kindly suggest.
> Harsha
> *
> *   For searches and help try:
> *
> *
> *
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index