Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: ranksum v median - why do they produce different results?

From   Daniel Pratt <>
Subject   st: ranksum v median - why do they produce different results?
Date   Tue, 2 Aug 2005 11:41:18 +0100 (BST)


Using STATA 8 for Windows.

I'm trying to test if older prisoners are committing
suicide sooner after release from prison than younger

I have 2 variables;
daysaftr: no. of days between release and suicide
agedis40: age at time of release from prison

I have used the Wilcoxon rank-sum test, as follows:

ranksum daysaftr, by (agedis40)

which produces: z=1.842, Prob>|z|=0.0655

But when I use the median test, as follows:

median daysaftr, by (agedis40) exact

this produces: Pearson chi2(1)=1.5380, Pr=0.215

I was expecting these two tests to produce the same
results.  Why do they differ?  Are they not the same

Many thanks,


Centre for Suicide Prevention
The University of Manchester
Room A3.5, Humanities Building
Devas Street
M13 9PL
Tel:  0161 275 0722
Fax:  0161 275 0716

How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index