14
Independent samples- Independent samples- Wilcoxon rank sum test Wilcoxon rank sum test

Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

Embed Size (px)

Citation preview

Page 1: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

Independent samples-Independent samples-Wilcoxon rank sum testWilcoxon rank sum test

Page 2: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

ExampleExample

The main outcome measure in MS is the The main outcome measure in MS is the expanded disability status scale (EDSS)expanded disability status scale (EDSS)

The EDSS is a 0-10 scale with steps of 0.5The EDSS is a 0-10 scale with steps of 0.5 Ordinal scaleOrdinal scale

– Ordered, but magnitude between steps is Ordered, but magnitude between steps is uncertainuncertain

Dr. Kurtzke who developed the scale Dr. Kurtzke who developed the scale believes the steps of scale are just a rank, believes the steps of scale are just a rank, not a measure of magnitudenot a measure of magnitude– This makes a t-test inappropriateThis makes a t-test inappropriate

Page 3: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

Pediatric vs. adultPediatric vs. adult

Most MS patients develop the disease Most MS patients develop the disease between age 20-40, but a subset of between age 20-40, but a subset of patients develop MS youngerpatients develop MS younger

What is different about these What is different about these patients?patients?

If we investigated patients at similar If we investigated patients at similar disease duration, is there a significant disease duration, is there a significant difference in EDSS?difference in EDSS?

Page 4: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

Since we have two Since we have two independent independent samples, we could samples, we could have used two-have used two-sample t-testsample t-test

Unfortunately, there Unfortunately, there seem to be outliers seem to be outliers in the adult groupin the adult group

Also, we know that Also, we know that we have ordinal we have ordinal data so a t-test is data so a t-test is not appropriatenot appropriate

Page 5: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

Wilcoxon rank sum testWilcoxon rank sum test

Since we have two independent samples Since we have two independent samples and the t-test is not appropriate, we need and the t-test is not appropriate, we need a nonparametric test. The test for two a nonparametric test. The test for two independent samples is Wilcoxon rank independent samples is Wilcoxon rank sum.sum.

Again, we are interested in the median Again, we are interested in the median rather than the mean.rather than the mean.

The hypothesis test of interest isThe hypothesis test of interest is– HH00: median: medianadultadult = median = medianpediatricpediatric

– HHAA: median: medianadultadult != median != medianpediatricpediatric

Page 6: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

Wilcoxon rank sumWilcoxon rank sum

Again, we use the Again, we use the rank of the data rank of the data points, rather than points, rather than the actual values. the actual values.

An exact Wilcoxon An exact Wilcoxon rank sum test can rank sum test can be used, but we be used, but we focus on the focus on the approximateapproximate

PatienPatientt

EDSSEDSS GroupGroup RankRank

11 00 PP 11

22 1.51.5 PP 4.54.5

33 1.51.5 PP 4.54.5

44 11 PP 2.52.5

55 22 AA 66

66 11 AA 2.52.5

77 33 AA 77

Page 7: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

Approximate Wilcoxon testApproximate Wilcoxon test

If the sample size is large enough (rule of If the sample size is large enough (rule of thumb, n=20) an approximate Wilcoxon test thumb, n=20) an approximate Wilcoxon test based on the normal approximation can be based on the normal approximation can be usedused

– W=sum of ranks in smaller groupW=sum of ranks in smaller group

– WW =expected sum of ranks in smaller group under =expected sum of ranks in smaller group under nullnull

– WW=standard deviation of sum of ranks in smaller =standard deviation of sum of ranks in smaller group under nullgroup under null

W

WW

Wz

Page 8: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

TT and and TT

Under the null of no difference Under the null of no difference between the groups, this expression between the groups, this expression is the expected sum of ranks in the is the expected sum of ranks in the small groupsmall group

The standard deviation is given by The standard deviation is given by this formulathis formula

2

)1( LSS

Wnnn

12

)1( LSLS

Wnnnn

Page 9: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

ResultsResults From our results, From our results,

– sum of the ranks in smaller group: sum of the ranks in smaller group: W=1526W=1526

– expected value of sum of positive ranks:expected value of sum of positive ranks:

– Standard deviation of sum of positive ranksStandard deviation of sum of positive ranks

Our approximate test statistic isOur approximate test statistic is

4.15912

)111021(*110*21

T

13862

)111021(*21

W

88.04.159

13861526

Z

Page 10: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

TiesTies

In this example, we have many tiesIn this example, we have many ties As with the Wilcoxon signed rank As with the Wilcoxon signed rank

test, a correction for ties can be test, a correction for ties can be made to the variance (see Rosner or made to the variance (see Rosner or other text book)other text book)

This correction is included in STATA This correction is included in STATA and all other computer packagesand all other computer packages

Page 11: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

Hypothesis testHypothesis test

1)1) HH00: median difference=0: median difference=02)2) Continuous outcome from paired dataContinuous outcome from paired data3)3) Wilcoxon signed rank testWilcoxon signed rank test4)4) Test statistic: z=0.91Test statistic: z=0.915)5) p-value= 0.36p-value= 0.366)6) Since the p-value is more than 0.05, we Since the p-value is more than 0.05, we

fail to reject the null hypothesis fail to reject the null hypothesis 7)7) We conclude that the there is no We conclude that the there is no

significant difference in terms of EDSS in significant difference in terms of EDSS in pediatric and adult MS patientspediatric and adult MS patients

Page 12: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

p-value

z-statistic

Page 13: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

CommentsComments

Wilcoxon rank sum test is becoming Wilcoxon rank sum test is becoming more prominent because computers more prominent because computers allow this statistic to be calculated allow this statistic to be calculated very quicklyvery quickly

There is not a large loss of power in There is not a large loss of power in using a Wilcoxon rank sum test using a Wilcoxon rank sum test compared to a t-test even when the compared to a t-test even when the normality assumption holds. normality assumption holds.

If normality does not hold or ordinal If normality does not hold or ordinal data, Wilcoxon test is betterdata, Wilcoxon test is better

Page 14: Independent samples- Wilcoxon rank sum test. Example The main outcome measure in MS is the expanded disability status scale (EDSS) The main outcome measure

Parametric tests-Parametric tests-nonparametric equivalentnonparametric equivalent

Paired t-test – Wilcoxon signed rankPaired t-test – Wilcoxon signed rank Two sample t-test – Wilcoxon rank Two sample t-test – Wilcoxon rank

sumsum ANOVA – Kruskal-Wallis testANOVA – Kruskal-Wallis test

– When you have two or more When you have two or more independent samples and the independent samples and the assumptions of ANOVA are not met, you assumptions of ANOVA are not met, you can use the Kruskal-Wallis test. This is a can use the Kruskal-Wallis test. This is a rank based test.rank based test.