To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. Cochran`s Test: Two-Way Layout with 0,1 data: Data X(i,j)=0,1 where 1 le i le nn Subjects or Blocks 1 le j le kk Treatments or Treatment Groups Same model and H_0 as in Friedman`s test Example: Success for four methods of soothing newborn babies From: Lehmann ``Nonparametrics: Statistical methods based on ranks`` pages 267-270 See Lehmann p283 for the full data set. k=4 treatments and n=12 newborns Treatments: 1. Warm Water 2. Rocking 3. Pacifier 4. Sound n=12 blocks (subjects) and k=4 treatment groups B_i are row sums and L_j are column sums Row number, warm water, rocking, pacifier, sound: 1. 0 0 0 0 Sum: 0 (B( 1)) 2. 0 1 0 0 Sum: 1 (B( 2)) 3. 0 0 1 0 Sum: 1 (B( 3)) 4. 0 0 0 0 Sum: 0 (B( 4)) 5. 1 1 1 1 Sum: 4 (B( 5)) 6. 0 1 1 1 Sum: 3 (B( 6)) 7. 1 1 0 0 Sum: 2 (B( 7)) 8. 0 1 0 1 Sum: 2 (B( 8)) 9. 0 1 1 1 Sum: 3 (B( 9)) 10. 0 0 1 0 Sum: 1 (B(10)) 11. 1 1 0 1 Sum: 3 (B(11)) 12. 1 1 1 1 Sum: 4 (B(12)) Treatment-group (column) sums (L(j)): 4 8 6 6 Sum: 24 Row and column-sum statistics: (L1,B1 are sums, L2,B2 are sums of squares) L1=24 L2=152 B1=24 B2=70 Cochran-test statistics: L2=152 Q=3.692 Pval=0.2967 (df=3) Simulating P-values for the Cochran test: Permuting data values (=0,1) independently for each block Initializing the random-number generator at 12345678 Carrying out Nsims=10000 Friedman permutations: Number of simulations with values >= L2 and total number: 3349 10000 95% CI for true P-value bracketing estimate of true pvalue: (Since H and Fscore >= 0, P-values are inherently two-sided.) 0.3256 0.3349 0.3442 Applying the Friedman test procedure: Finding within-block midranks for each block: 1. 0(2.5) 0(2.5) 0(2.5) 0(2.5) 2. 0(2.0) 1(4.0) 0(2.0) 0(2.0) 3. 0(2.0) 0(2.0) 1(4.0) 0(2.0) 4. 0(2.5) 0(2.5) 0(2.5) 0(2.5) 5. 1(2.5) 1(2.5) 1(2.5) 1(2.5) 6. 0(1.0) 1(3.0) 1(3.0) 1(3.0) 7. 1(3.5) 1(3.5) 0(1.5) 0(1.5) 8. 0(1.5) 1(3.5) 0(1.5) 1(3.5) 9. 0(1.0) 1(3.0) 1(3.0) 1(3.0) 10. 0(2.0) 0(2.0) 1(4.0) 0(2.0) 11. 1(3.0) 1(3.0) 0(1.0) 1(3.0) 12. 1(2.5) 1(2.5) 1(2.5) 1(2.5) Rank sums and rank averages by treatment group: 1. 26.00 2.17 2. 34.00 2.83 3. 30.00 2.50 4. 30.00 2.50 With no tie correction: S=1.600 P= 0.6594 (df=3) With tie correction: Tiesum=408 Tiecorr=0.566667 SP=3.692 P= 0.2967 (df=3) Note that the second set of values are exactly the same as in Cochran`s test