Illustration of nonparametric tests for two-way layouts Friedman and Page tests. Starting random-number seed: 123456 (Enter a number on the command line to specify a different seed.) The Friedman test for a two-way layout Time for Rounding First Base under Three Different Strategies Text (Hollander & Wolfe), Table 7.1, p2743 treatments, 22 subjects The data with Friedman (within-block) ranks: Round Out Narrow Angle Wide Angle 1. 5.40 (1) 5.50 (2) 5.55 (3) 2. 5.85 (3) 5.70 (1) 5.75 (2) 3. 5.20 (1) 5.60 (3) 5.50 (2) 4. 5.55 (3) 5.50 (2) 5.40 (1) 5. 5.90 (3) 5.85 (2) 5.70 (1) 6. 5.45 (1) 5.55 (2) 5.60 (3) 7. 5.40 (2.5) 5.40 (2.5) 5.35 (1) 8. 5.45 (2) 5.50 (3) 5.35 (1) 9. 5.25 (3) 5.15 (2) 5.00 (1) 10. 5.85 (3) 5.80 (2) 5.70 (1) 11. 5.25 (3) 5.20 (2) 5.10 (1) 12. 5.65 (3) 5.55 (2) 5.45 (1) 13. 5.60 (3) 5.35 (1) 5.45 (2) 14. 5.05 (3) 5.00 (2) 4.95 (1) 15. 5.50 (2.5) 5.50 (2.5) 5.40 (1) 16. 5.45 (1) 5.55 (3) 5.50 (2) 17. 5.55 (2.5) 5.55 (2.5) 5.35 (1) 18. 5.45 (1) 5.50 (2) 5.55 (3) 19. 5.50 (3) 5.45 (2) 5.25 (1) 20. 5.65 (3) 5.60 (2) 5.40 (1) 21. 5.70 (3) 5.65 (2) 5.55 (1) 22. 6.30 (2.5) 6.30 (2.5) 6.25 (1) AvData: 5.54 5.53 5.46 AvRanks: (2.41) (2.14) (1.45) Friedman statistic S'=11.1429 P=0.0038 (2 df, 4 tiegroups) Simulating the Friedman P-value using 100000 permutations: Friedman score (for simulations): 6042 P = 345/100000 = 0.00345 95% CI (0.0031, 0.0034, 0.0038) Large-sample approximation WITHOUT tie correction: S=10.6364 P=0.0049 (2 d.f.) The Page (increasing alternative) test for a two-way layout Cotton strength index as a function of potash in fertilizer Text (Hollander & Wolfe), Table 7.5, p2865 treatments, 3 subjects The data with Friedman (within-block) ranks: 144#/acre 108#/acre 72#/acre 54#/acre 36#/acre 1. 7.46 (2) 7.17 (1) 7.76 (4) 8.14 (5) 7.63 (3) 2. 7.68 (2) 7.57 (1) 7.73 (3) 8.15 (5) 8.00 (4) 3. 7.31 (1) 7.80 (3) 7.74 (2) 7.87 (4) 7.93 (5) AvData: 7.48 7.51 7.74 8.05 7.85 AvRanks: (1.67) (1.67) (3.00) (4.67) (4.00) Page statistic L=158 E(L)=135 Z=2.65581 P=0.0079 (two-sided) Simulating the Page P-value using 100000 permutations: P = 490/100000 = 0.00490 95% CI (0.0045, 0.0049, 0.0053) Random numbers used: 5,600,000