```
Calculations for Some Two Sample Rank tests of Scale
Put X in column C1 and
Y in column C3 in Minitab.
Then do these commands.

let c2 = c1-median(c1)     # center the X data
let c4 = c3-median(c3)     # center the Y data
let k1 = N(c1)             # sample size X
let k2 = N(c3)             # sample size Y
set c5
k1(0) k2(1)
end
stack c2 c4 c6
rank c6 c7
let c9 = ( (c7/(k1+k2+1)) - .5)**2            # Mood scale scores
let c10 = abso( (c7/(k1+k2+1)) - .5 )      # Ansari-Bradley scale scores
name c1 'Xdata' c2 'centerX'
name c3 'Ydata' c4 'centerY'
name c5 'Group' c6 'cen-data'
name c7 'Ranks'
name c9 'Mood Scores'

############# Now do Mood's test
let k3 = sum( c5*c9 )
prin k3         # Mood's test statistic
mean c9
stdev c9

let k4 = ( k3 - (k2*mean(c9)) ) / ( sqrt(k1*k2/(k1+k2)) * stdev(c9) )
prin k4

let k5 = sum( c5*c10 )
prin k5          # Ansari-Bradley test statistic
mean c10
stdev c10

let k6 = ( k5 - (k2*mean(c10)) ) / ( sqrt(k1*k2/(k1+k2)) * stdev(c10) )
prin k6

############################# Now do folded rank test, Wilcoxon scores
name c11 'Wilc Scores'
name c12 'Abs Ranks'
let c11 = abso(c6)
rank c11 c12                    # these are Wilcoxon scores, not ordered
let k7 = sum( c5*c12 )
prin k7           # Folded rank statistic (Wilcoxon)

let k8 = ( k7 - (k2*mean(c12)) ) / ( sqrt(k1*k2/(k1+k2)) * stdev(c12) )
prin k8

```