# NOT RUN {
##
## Fit the standard Bradley-Terry model, using the simple 'add 0.5'
## method to handle ties:
##
table3.model <- BTm(outcome = cbind(win1.adj, win2.adj),
player1 = school1, player2 = school2,
formula = ~.. , refcat = "Stockholm",
data = CEMS)
## The results in Table 3 of Dittrich et al (2001) are reproduced
## approximately by a simple re-scaling of the estimates:
table3 <- summary(table3.model)$coef[, 1:2]/1.75
print(table3)
##
## Now fit the 'final model' from Table 6 of Dittrich et al.:
##
table6.model <- BTm(outcome = cbind(win1.adj, win2.adj),
player1 = school1, player2 = school2,
formula = ~ .. +
WOR[student] * Paris[..] +
WOR[student] * Milano[..] +
WOR[student] * Barcelona[..] +
DEG[student] * St.Gallen[..] +
STUD[student] * Paris[..] +
STUD[student] * St.Gallen[..] +
ENG[student] * St.Gallen[..] +
FRA[student] * London[..] +
FRA[student] * Paris[..] +
SPA[student] * Barcelona[..] +
ITA[student] * London[..] +
ITA[student] * Milano[..] +
SEX[student] * Milano[..],
refcat = "Stockholm",
data = CEMS)
##
## Again re-scale to reproduce approximately Table 6 of Dittrich et
## al. (2001):
##
table6 <- summary(table6.model)$coef[, 1:2]/1.75
print(table6)
##
# }
# NOT RUN {
## Now the slightly simplified model of Table 8 of Dittrich et al. (2001):
##
table8.model <- BTm(outcome = cbind(win1.adj, win2.adj),
player1 = school1, player2 = school2,
formula = ~ .. +
WOR[student] * LAT[..] +
DEG[student] * St.Gallen[..] +
STUD[student] * Paris[..] +
STUD[student] * St.Gallen[..] +
ENG[student] * St.Gallen[..] +
FRA[student] * London[..] +
FRA[student] * Paris[..] +
SPA[student] * Barcelona[..] +
ITA[student] * London[..] +
ITA[student] * Milano[..] +
SEX[student] * Milano[..],
refcat = "Stockholm",
data = CEMS)
table8 <- summary(table8.model)$coef[, 1:2]/1.75
##
## Notice some larger than expected discrepancies here (the coefficients
## named "..Barcelona", "..Milano" and "..Paris") from the results in
## Dittrich et al. (2001). Apparently a mistake was made in Table 8 of
## the published Corrigendum note (R. Dittrich personal communication,
## February 2010).
##
print(table8)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab