Chapter 6
Two Way Layout
1
Question 6.1
Give an example for comparing two
treatments whereby pair-data design
should be applied.
2
Question 6.2
What is the non-parametric test statistic
for examining treatment difference in the
context of pair-data design?
3
Question 6.3
Suppose you now want to compare three
treatments, and you want to (1) enhance
generalizability and (2) control the effect
of extraneous factors, what can you do?
4
Question 6.4
With the following data, how can you
construct a non-parametric test statistic?
Treatments
1 2 3 …… k
1 X11 X12 X13 …… X1k
2 X21 ……
Blocks
3 X31
: :
n Xn1 …… …… Xnk
5
1. Friedman Statistic in Randomized Block Design
Treatments
1 2 3 …… k
1 X11 X12 X13 …… X1k
2 X21 ……
Blocks
3 X31
: :
n Xn1 …… …… Xnk
exactly k observations within each block, one observation per cell
Model: X ij = µ + β i + γ j + eij n k
β i : Block effect γ j : Treatment effect ∑β
i =1
i = 0; ∑ γ j = 0
j =1
eij : Mutually independent and come from the same continuous
distribution
H0 :γ1 = γ 2 = = γ k vs H1 : γ i not all equal 6
Procedure for Friedman statistic
1. Rank the observations within each block.
Let rij be the rank of Xij in the i-th block for the j-th
treatment.
1 n 1 Rj : Sum of ranks for the jth treatment
2. R. j = ∑ rij = R j
n i =1 n R.j : Average rank for the jth treatment
12n k k +1 2
3. S = ∑
k (k + 1) j =1
( R. j −
2
) Compare to the Sum of squares
due to treatment:
k
12 k SST = n∑ ( X . j − X .. )2
= ∑
nk (k + 1) j =1
R j − 3n( k + 1)
2 j =1
4. Reject H0 if S is too large. (Compare with Table A.15)
7
Question 6.5
Find the distribution of S when k=3 and
n=2.
8
Exact distribution of S:
Under H0, use randomization model
1 2 …... k 1 2 …... k
…
Block 1 Block n
There are totally (k!)n different permutations.
Each permutation gives a value of S.
9
Example
k = 3, n = 2. There are (3!)2 = 36 permutation.
Note : S does not vary with changes of the names of the blocks or with
relabeling of the k samples.
∴ Can consider only configurations as follows:
k
∑R
k
12
∑
2
j S= R 2j − 3n(k + 1)
Trt 1 Trt 2 Trt 3 j =1 nk (k + 1) j =1
Block 1 1 2 3
Block 2 1 2 3 56 4
or 2 3 1 50 1
3! Different or 3 1 2 50 1
permutation or 1 3 2 54 3
or 2 1 3 54 3
or 3 2 1 48 0
∴ Pr(S ≥ 4) = 1/6 = 0.167 Pr(S ≥ 3) = 3/6 = 0.5 See Table A.15
(k=3, n=2)
Pr(S ≥ 1) = 5/6 = 0.833 Pr(S ≥ 0) = 6/6 = 1.0 10
• Large sample distribution
Under H0,
S~χ 2
k −1
• Ties
Use average ranks
Use S
S'= n gi
~ χ k2−1
∑∑ ij − tij )
(t 3
i =1 j =1
1−
nk (k − 1)
2
where
gi : Number of tied groups in block i
tij : size of the j-th tied group in block i
11
• Example BLOCK
1 2 3 4 5 6 7 8 Rj
TREATMENT
1 23.1 4 57.6 4 10.53 23.64 11.9 1 54.64 21.0 4 20.3 3 27
2 22.7 3 53.2 2 9.7 2 19.61 13.8 4 47.13 13.6 1 23.6 4 20
3 22.5 1 53.7 3 10.84 21.12 13.7 3 39.22 13.7 2 16.3 2 19
4 22.6 2 53.1 1 8.3 1 21.63 13.3 2 37.01 14.8 3 14.8 1 14
k
12
S= ∑
nk (k + 1) j =1
R j − 3n( k + 1)
2
k = 4, n = 8
12
= (27 2 + 20 2 + 19 2 + 14 2 ) − 3 × 8 × 5
8× 4× 5
= 126.45 − 120 From Table2A.15 (p.369), Pr (S ≥ 6.45) = 0.094
= 6.45 From χ 3, Pr (S ≥ 6.45) = 0.09
∴Do not reject H0 of no treatment difference at α = 0.05
12
2. Special cases of Friedman’s statistics
2.1: Matched pairs (k = 2, no ties)
Blocks
1 2 3 4 …… n
1 1 1 2 … …
Treatment
2 2 2 1 … …
S=
12n
2×3
[
( R.1 − 1.5) 2 + ( R.2 − 1.5) 2 ] R.j : Average rank for the jth treatment
(k+1)/2 = 1.5 because k=2
Let p = proportion of times treatment 1 is less than treatment 2
R.1 = [np + n(1 − p ) × 2] n = 2 − p R.2 = [n(1 − p ) + np × 2] n = 1 + p
1 1
R.1 − 1.5 = −p R.2 − 1.5 = p −
1 1
S = 2 n ( − p ) 2 + ( p − ) 2 2 2
2 2 The (square of) the normal
1 1 n approximation of the sign test
= 4n( p − ) 2 = (np − ) 2 ~ χ12
2 n 2 statistic. [Recall: B=#(Xi<Yi)=np,
B~B(n, ½)]. 13
4
2.2 Cocharn’s Test (for dichotomous response)
Blocks
1 2 3 4 …… n
1 1 1 0 0 …
2 0 0 1 1 …
Treatment
: : : : :
k 1 : : : … …
Let Lj = # 1’s in the j-th block
Bi = # 1’s in the i-th treatment
Work out the Friedman statistic with ties we have
k
k (k − 1)∑ ( Bi − B ) 2
S'= n
i =1
n Tedious, See Lehmann p.269 – p270.
k∑ Lj − ∑ L 2
j
j =1 j =1 14
2.3 McNemar’s Test (k = 2; dichotomous response)
Blocks
1 2 3 4 …… n
1 0 0 0 1 …
Treatment
2 1 1 0 1 …
Four possible cases: 0 0 1 1
A : # B :# C :# D :#
0 1 0 1
Treatment 2
0 1
Treatment 0 A B
1 1 C D
n A+B+C+D=n
Work out the Friedman statistic with ties we obtain the McNemar’s test statistic:
(B − C )2
S'= ~ χ12 Assignment
B+C
15
Question 6.6
What pattern of the ranks represents a
strong indication of treatment difference?
Treatments
1 2 3 …… k
1 X11 X12 X13 …… X1k
2 X21 ……
Blocks
3 X31
: :
n Xn1 …… …… Xnk
16
3. Kendall’s Coefficient of Concordance
(Reference: Conover, p.305)
Randomized block design: n blocks, k treatments
Rank observations within each block
Rj = Sum of ranks for j-th treatment
Kendall’s Coefficient of Concordance = Kendall’s W
12 k
n(k + 1) 2
W= 2 ∑
n k (k + 1)(k − 1) j =1
( R j −
2
)
It was primarily used as a measure of “agreement in
rankings” in the n blocks.
17
If there is a “perfect agreement” in all n blocks, W = 1
Perfect agreement: Treatment 1 get rank 1 in all blocks, treatment 2 gets rank 2 in all
blocks, treatment 3 gets rank 3 … , treatment k gets rank k in all blocks.
n( k + 1 )
k 2
∑
j =1
( R j −
2
)
n( k + 1 ) 2 n( k + 1 ) 2 n( k + 1 ) 2
=(n− ) + ( 2n − ) + + ( kn − )
2 2 2
( k +1) ( k + 1 )2
= n 2 12 + + k 2 + ( −2 )( 1 + 2 + +k ) +k
2 22
2 1 k ( k + 1 )2 k ( k + 1 )2
= n k ( k + 1 )( 2k + 1 ) − +
6 2 4
1 k ( k + 1 )2
= n k ( k + 1 )( 2k + 1 ) −
2
12 k
n(k + 1) 2
6 4
∴W = 2 ∑
n k (k + 1)(k − 1) k =1
(R j −
2
)
n2
= k ( k + 1 )( 4k + 2 − 3k − 3 ) 12 n 2 k (k + 1)(k − 1)
12 = 2 × =1
n2 n k (k + 1)(k − 1) 12
= k ( k + 1 )( k − 1 )
12
18
If there is a “perfect disagreement”, everything is
random, Rj will nearly equal to each other and
n(k + 1)
Rj =
2
∴ Under perfect disagreement, W = 0.
S = Friedman statistic, it can be shown that
S
W=
n(k − 1) 19
4. Online Information
More description on the Friedman Statistic: Chapter
15a in the following online text book:
[Link]
20