To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. DATA FOR N=11 paired differences: Expanded data matrix: Columns are Ordinal, Before (X_i), After (Y_i), Z_i=Y_i-X_i, Abs(Z_i), and 1 if Z_i>0, 0 if Z_i<0 dd = 1 26 37 11 11 1 2 25 29 4 4 1 3 59 62 3 3 1 4 27 25 -2 2 0 5 34 47 13 13 1 6 38 40 2 2 1 7 51 58 7 7 1 8 48 52 4 4 1 9 39 42 3 3 1 10 37 34 -3 3 0 11 30 42 12 12 1 DATA WITH MIDRANKS (from getmidranks()): Columns are now Ordinal, X, Y, Z, Abs(Z), Sgn, and Midrank dd = 1.0000 26.0000 37.0000 11.0000 11.0000 1.0000 9.0000 2.0000 25.0000 29.0000 4.0000 4.0000 1.0000 6.5000 3.0000 59.0000 62.0000 3.0000 3.0000 1.0000 4.0000 4.0000 27.0000 25.0000 -2.0000 2.0000 0 1.5000 5.0000 34.0000 47.0000 13.0000 13.0000 1.0000 11.0000 6.0000 38.0000 40.0000 2.0000 2.0000 1.0000 1.5000 7.0000 51.0000 58.0000 7.0000 7.0000 1.0000 8.0000 8.0000 48.0000 52.0000 4.0000 4.0000 1.0000 6.5000 9.0000 39.0000 42.0000 3.0000 3.0000 1.0000 4.0000 10.0000 37.0000 34.0000 -3.0000 3.0000 0 4.0000 11.0000 30.0000 42.0000 12.0000 12.0000 1.0000 10.0000 DATA SORTED BY ABS(Z) (with Z then Ord as tie-breakers): Columns are Ordinal, X, Y, Z, Abs(Z), Sgn, and Midrank ddx = 4.0000 27.0000 25.0000 -2.0000 2.0000 0 1.5000 6.0000 38.0000 40.0000 2.0000 2.0000 1.0000 1.5000 10.0000 37.0000 34.0000 -3.0000 3.0000 0 4.0000 3.0000 59.0000 62.0000 3.0000 3.0000 1.0000 4.0000 9.0000 39.0000 42.0000 3.0000 3.0000 1.0000 4.0000 2.0000 25.0000 29.0000 4.0000 4.0000 1.0000 6.5000 8.0000 48.0000 52.0000 4.0000 4.0000 1.0000 6.5000 7.0000 51.0000 58.0000 7.0000 7.0000 1.0000 8.0000 1.0000 26.0000 37.0000 11.0000 11.0000 1.0000 9.0000 11.0000 30.0000 42.0000 12.0000 12.0000 1.0000 10.0000 5.0000 34.0000 47.0000 13.0000 13.0000 1.0000 11.0000 The same table, using fprintf() instead of a simple display: 4. 27 25 -2 2 0 1.5 6. 38 40 2 2 1 1.5 10. 37 34 -3 3 0 4.0 3. 59 62 3 3 1 4.0 9. 39 42 3 3 1 4.0 2. 25 29 4 4 1 6.5 8. 48 52 4 4 1 6.5 7. 51 58 7 7 1 8.0 1. 26 37 11 11 1 9.0 11. 30 42 12 12 1 10.0 5. 34 47 13 13 1 11.0 WILCOXON SIGNED RANK TEST: Have ties, so use midranks for Tplus and Tminus. Recall Tminus+Tplus=nn*(nn+1)/2, even with midranks Tminus, Tplus, Tmean, N 5.5000 60.5000 33.0000 11.0000 LARGE-SAMPLE NORMAL APPROXIMATION for two-sided Wilcoxon signed-rank P-value for H_0:theta=0: IGNORING tie correction (TstdDev then Z then two-sided normal P): 11.2472 2.4450 0.0145 Tie correction depends on distribution of tie groups Tie group sizes for size > 1: 2 3 2 Tiesum=36 TieCorrection=0.0059 CORRECT APPROXIMATE P-VALUE WITH tie correction: (TstdDev then Z then two-sided normal P): 11.2138 2.4523 0.0142 SIMULATING THE TRUE Wilcoxon Signed-Rank P-VALUE: Using NSIMS=10000 random permutations: INITIALIZING the random-number generator at Wseed=2.132549e+005 FINISHED NSIMS simulations SIMULATED value for true 2-sided P-value: NGrEq=40 Nsims=10000 Pvalue=0.00800 (2-sided) 95%% Confidence Interval for true P-value (with Estimate in middle): Plow_PEst_Phigh = 0.0055 0.0080 0.0105 The Hodges-Lehmann estimator for theta for After=Before+theta is the median of the Walsh averages W_k=(Z_i+Z_j)/2: SORTED Walsh averages (n=11, nwa=66, nrows=7): ( 1) -3.0 -2.5 -2.0 -0.5 0.0 0.0 0.0 0.5 0.5 0.5 (11) 0.5 1.0 1.0 2.0 2.0 2.5 2.5 2.5 3.0 3.0 (21) 3.0 3.0 3.0 3.5 3.5 3.5 3.5 4.0 4.0 4.0 (31) 4.0 4.5 4.5 4.5 5.0 5.0 5.0 5.0 5.5 5.5 (41) 5.5 6.5 7.0 7.0 7.0 7.0 7.5 7.5 7.5 7.5 (51) 7.5 8.0 8.0 8.0 8.0 8.5 8.5 9.0 9.5 10.0 (61) 11.0 11.5 12.0 12.0 12.5 13.0 Zmean_MedZ_MedWav = 4.9091 4.0000 4.5000 EXACT CONFIDENCE INTERVALS based on the Wilcoxon signed-rank statistic: Estimator: 4.5 Table A4 for n=11 (n*(n+1)/2=66) has: P(T+ ge 55)=0.027 P(T+ ge 56)=0.021 P(T+ ge 57)=0.016 P(T+ ge 58)=0.012 P(T+ ge 59)=0.009 P(T+ ge 60)=0.007 P(T+ ge 61)=0.005 P(T+ ge 62)=0.003 Exact symmetric confidence intervals for theta: ( 1.0, 8.0) x=55 94.6% CI ( 0.5, 8.5) x=56 95.8% CI ( 0.5, 8.5) x=57 96.8% CI ( 0.5, 9.0) x=58 97.6% CI ( 0.5, 9.5) x=59 98.2% CI ( 0.0, 10.0) x=60 98.6% CI ( 0.0, 11.0) x=61 99.0% CI ( 0.0, 11.5) x=62 99.4% CI