Nonparametric one-way layouts: Kruskal-Wallis, Jonckheere-Terpstra, and multiple comparison tests. Starting random-number seed: 408408 (Enter a number on the command line to specify a different seed.) The data: Number of treatments: 3 Total number of observations: 15 Trtment #1 (n=5): 53 31 139 5 16 Trtment #2 (n=5): 75 64 205 97 139 Trtment #3 (n=5): 54 139 194 1253 275 Data with midranks (RA=Rank-Average of treatment group): #1 (RA= 4.0): 53( 4.0) 31( 3.0) 139(10.0) 5( 1.0) 16( 2.0) #2 (RA= 8.8): 75( 7.0) 64( 6.0) 205(13.0) 97( 8.0) 139(10.0) #3 (RA=11.2): 54( 5.0) 139(10.0) 194(12.0) 1253(15.0) 275(14.0) Carrying out the Kruskal-Wallis test: Recall that for the Kruskal-Wallis test: H = (12/(N*(N+1)))*Sum n_i*(RankAverage - (N+1)/2)^2 (with no tie correction) HPrime = Hstat WITH tie correction. Here: Rank-Average=8.0 (Ntot=15, ntreatments=3) H(Prime)=6.76835 Tiesum=24 Tiecorr=0.992857 H(NoCorr)=6.72 Large-sample Chisquare approx.: P=0.0339 (HP=6.76835, df=2) Without the tie correction: P=0.0347 (H=6.72, df=2) Now SIMULATING the exact P-value of the Kruskal-Wallis test: Hobs = Sum RankSum_i^2/n_i = 1094.4 Simulating the true KW P-value with n=1000 permutations: P = 25/1000 = 0.0250 95% CI: (0.0153, 0.0347) Simulating the true KW P-value with n=10000 permutations: P = 238/10,000 = 0.0238 95% CI: (0.0208, 0.0268) Simulating the true KW P-value with n=100000 permutations: P = 2472/100,000 = 0.0247 95% CI: (0.0238, 0.0257) Are the treatment groups increasing in treatment-group order? Carry out the Jonckheere-Terpstra test to find out: Statistic J=62.5 Min: 0.00 Mean: 37.50 Max: 75.00 J = 62.5 E(J)=37.5 Var(J)=89.5833 (NOT tie-corrected) J = 62.5 E(J)=37.5 Var(J)=88.8919 (tie-corrected) Large-sample approximation: Z=2.6516 P=0.00801 (2-sided, T.C.) Now SIMULATING the exact P-value of the Jonckheere-Terpstra test: Simulating the true JT P-value (n=100000 simulations, Jscore=25.0): P = 586/100,000 = 0.00586 95% CI: (0.00539, 0.00633) (2-sided) Random numbers used: 2,954,000