ordertable2supp(soling_table) # discouraged
suppfun(soling_table) # use this instead
# competitors a-f, racing at two venues:
x <- data.frame(
venue1=c(1:5,"Ret"),venue2=c("Ret",4,"Ret",1,3,2),
row.names=letters[1:6])
## First consider all competitors; incomplete=FALSE checks that all
## finishing competitors have ranks 1-n in some order for some n:
ordertable2supp(x, incomplete=FALSE) # discouraged
suppfun(ordertable(x), incomplete=FALSE) # use this instead
## Now consider just a-d; must use default incomplete=TRUE as at venue2
## the second and third ranked competitors are not present in x[1:4,]:
ordertable2supp(x[1:4,])
## Function ordervec2supp() is lower-level, used for order vectors:
a1 <- c(a=2,b=3,c=1,d=5,e=4) # a: 2nd, b: 3rd, c: 1st, d: 5th, e: 4th
a2 <- c(a=1,b=0,c=0,d=2,e=3) # a: 2nd, b: DNF, c: DNF, d: 2nd, e: 3rd
a3 <- c(a=1,b=3,c=2) # a: 1st, b: 3rd, c: 2nd. NB only a,b,c competed
a4 <- c(a=1,b=3,c=2,d=0,e=0) # a: 1st, b: 3rd, c: 2nd, d,e: DNF
## results of ordervec2supp() may be added with "+" [if the observations
## are independent]:
H1 <- ordervec2supp(a1) + ordervec2supp(a2) + ordervec2supp(a3)
H2 <- ordervec2supp(a1) + ordervec2supp(a2) + ordervec2supp(a4)
## Thus H1 and H2 are identical except for the third race. In H1, 'd'
## and 'e' did not compete, but in H2, 'd' and 'e' did not finish (and
## notionally came last):
pmax(H1)
pmax(H2) # d,e not finishing affects their estimated strength
Run the code above in your browser using DataLab