Illustrating nonparametric two-sample methods: (Wilcoxon rank sum and allied procedures - January 31, 2007.) (This is twosamps_ranks.txt on the Ma408 Web site.) Sample I (m=9): 23 21 22 14 23 19 15 15 16 Sample II (n=14): 27 27 22 21 27 28 19 20 31 24 21 23 23 21 Sorted data from both samples: Samp Value Tgrp Ord Midrank X 14 A 1 1.0 X 15 B 2 2.5 X 15 B 3 2.5 X 16 C 4 4.0 X 19 D 5 5.5 Y 19 D 6 5.5 Y 20 E 7 7.0 X 21 F 8 9.5 Y 21 F 9 9.5 Y 21 F 10 9.5 Y 21 F 11 9.5 Y 22 G 12 12.5 X 22 G 13 12.5 X 23 H 14 15.5 Y 23 H 15 15.5 Y 23 H 16 15.5 X 23 H 17 15.5 Y 24 I 18 18.0 Y 27 J 19 20.0 Y 27 J 20 20.0 Y 27 J 21 20.0 Y 28 K 22 22.0 Y 31 L 23 23.0 12 tiegroups 6 tiegroups with more than one tied value Check: End reassortment: i=9 m=9 j=14 n=14 The ranks/midranks in each sample: Sample I (m=9) (Rank sum=68.5): 1 2.5 2.5 4 5.5 9.5 12.5 15.5 15.5 Sample II (n=14) (Rank sum=207.5): 5.5 7 9.5 9.5 9.5 12.5 15.5 15.5 18 20 20 20 22 23 Check: Rsumx+Rsumy=276: MN*(MN+1)/2 = 23*24/2 = 276 Observed Wilcoxon rank-sum statistic based on Sample II: W=207.5 E(W)=168 W-E(W)=39.5 Normal approx. W/O tie corr.: Z=2.488 P=0.0128 (two-sided) 12 tiegroups Tiesum: 162 Tiesum correction: 0.0133 Correct Z-score with tie correction: Normal approximation: Z=2.505 P=0.0122 (two-sided) Finding Hodges-Lehmann estimator of Y-X: Collecting and sorting N = 9*14 = 126 Mann-Whitney differences: HLEst for ``E(Y)-E(X)'' = Median of MW differences HLEst: 5.00 Ybar-Xbar = 5.19 Using normal approximation to find indices in (1,126) for HL-associated 95% confidence interval: C offsets (31,94) 95% CI: (1, 8): The 126 sorted Mann-Whitney differences: (The starred values for median or 95% CI) -4 -4 -3 -3 -3 -2 -2 -2 -2 -2 -2 -2 -2 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 1(*) 1 1 2 2 2 2 2 2 3 3 3 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5(*) 5(*) 5 5 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8(*) 8 8 9 9 9 9 9 9 10 10 11 11 11 12 12 12 12 12 12 12 12 13 13 13 13 13 14 15 16 16 17 Summary: Test:Z P-value EstDiff 95% CI WRS: 2.505 0.0122 5.00 (1.00, 8.00) Student-t: 3.353 0.0030 5.19 (1.97, 8.41) df=21