On 30 Ean 2009, at 01:41, Rico Baumann wrote:
I have data with a binary variable (0 and 1) that splits my data set
into two matched groups (one group of original observations and one
control group), therefore the samples are not independent.
group1 0 varname1 ...
group2 1 varname1 ...
Since some of the contained variables are not normally distributed I
´d like to use a non-parametric test in order to test for the median
difference of some variables between the two dependent groups.
Careful what you say here! There is a difference between a difference
in medians and a median difference.
Here's a little do-file. You will need to install the relevant user-
written ados.
=============Start==============
*A simple guide to getting confused about testing for differences
between groups
*Using 'nonparametric' statistics
clear
input group value
1 5
1 5
1 5
1 5
1 5
1 5
1 6
1 7
1 8
1 9
1 10
0 1
0 2
0 3
0 4
0 5
0 5
0 5
0 5
0 5
0 5
end
* No difference in medians -
table group, c(median value)
* And qreg reports this
qreg value group
* However, a nonparametric equality of medians test runs close to the
wire
median value, by(group)
* A rank sum test with the -porder- option shows us that the probability
* of a group 0 value being higher than a group 1 value is just 16%
ranksum value, by(group) porder
* And, of course, the median difference isn't zero either
npshift value, by(group)
* And there's a highly significant difference
censlope value group
=============end=====
Ronan Conroy
=================================
[email protected]
Royal College of Surgeons in Ireland
Epidemiology Department,
Beaux Lane House, Dublin 2, Ireland
+353 (0)1 402 2431
+353 (0)87 799 97 95
+353 (0)1 402 2764 (Fax - remember them?)
http://rcsi.academia.edu/RonanConroy
P Before printing, think about the environment
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/