gconv(c(2/3,1/3),c(2/3,1/3))
gconv(1,c(2/3,1/3))
round(gconv(c(0, 1/6, 1/6, 1/6, 1/6, 1/6, 1/6),
c(0, 1/6, 1/6, 1/6, 1/6, 1/6, 1/6)),3)
#
# Compute the exact distribution of Quade's treated-control
# statistic forI=3 blocks of size J=3.
#
# Block with range rank = 1
rk1<-c(0,1/3,1/3,1/3)
names(rk1)<-0:3
rk1
#
# Block with range rank = 2
rk2<-c(0,0,1/3,0,1/3,0,1/3)
names(rk2)<-0:6
rk2
#
# Block with range rank = 3
rk3<-c(0,0,0,1/3,0,0,1/3,0,0,1/3)
names(rk3)<-0:9
rk3
#
# Convolution of rk1 and rk2
round(gconv(rk1,rk2),3)
1/(3^2)
#
# Convolution of rk1, rk2 and rk3
round(gconv(gconv(rk1,rk2),rk3),3)
1/(3^3)
Run the code above in your browser using DataLab