Two-Way Layout: Data X(i,j) where 1 le i le nn Subjects or Blocks 1 le j le kk Treatments or Treatment Groups Model: X(i,j) = mu(i,j) plus error or mu + theta_i + tau_j plus error Test H_0: mu(i,j) = theta_i and there is no effect of Treatment Example 2: Strength of cotton fibers as a function of levels of potash (K_2O) in field k=5 potash fields with n=3 randomized blocks Potash levels in pounds per acre: 144(k=1) 108(k=2) 72(k=3) 54(k=4) 36(k=5) Table 7.5 (p286) in text n=3 blocks (subjects) and k=5 treatment groups Cotton fiber strengths at 144, 108, 72, 54, 36 pounds per acre: 1. 7.46 7.17 7.76 8.14 7.63 2. 7.68 7.57 7.73 8.15 8.00 3. 7.31 7.80 7.74 7.87 7.93 FRIEDMAN RANKS are WITHIN-BLOCK ranks, here 1 le R(i,j) le 5 Cotton strengths for n=3 replications with within-replication ranks 1. 7.46(2.0) 7.17(1.0) 7.76(4.0) 8.14(5.0) 7.63(3.0) 2. 7.68(2.0) 7.57(1.0) 7.73(3.0) 8.15(5.0) 8.00(4.0) 3. 7.31(1.0) 7.80(3.0) 7.74(2.0) 7.87(4.0) 7.93(5.0) Rank sums and rank averages by treatment group: 1. 5.00 1.67 2. 5.00 1.67 3. 9.00 3.00 4. 14.00 4.67 5. 12.00 4.00 With no tie correction: S=8.80000 P= 0.0663 (df=4) With tie correction: Tiesum=0 Tiecorr=0 SP=8.80000 P= 0.0663 (df=4) Simulating P-values for the Friedman test: Permuting rank values independently for each block Initializing the random-number generator at 12345678 Carrying out Nsims=10000 Friedman permutations: Fscore = Sum of Squares over Treatment Groups of Treatment-Group Rank Sums: 471 Number of simulations with values >= Fscore and total number: 347 10000 95% CI for true P-value bracketing estimate of true pvalue: (Since H and Fscore >= 0, P-values are inherently two-sided.) 0.0311 0.0347 0.0383 PAGE TEST for monotonic alternatives L is essentially the sum over blocks of the Spearman correlation coefficient of within-block midranks and the treatment-group number Specifically, L = sum(i=1,n) sum(j=1,k) j*R(i,j) = sum(j=1,k) j*sum(i=1,n) R(i,j) Observed score and large-sample approximation: L=158 Lmean=135 Lstdev=8.66025 Z=2.65581 P=0.0040 (one-sided) Carrying out Nsims=10000 Friedman permutations for Page`s test: Observed L = 158 Number of simulations with values >= Lobserv and total number: 25 10000 95% CI for true one-sided P-value bracketing estimate of true pvalue: 0.0015 0.0025 0.0035