Last chance! 50% off unlimited learning
Sale ends in
Fits a Bradley Terry model with ties (intercept-only model) by maximum likelihood estimation.
bratt(refgp = "last", refvalue = 1, ialpha = 1, i0 = 0.01)
Integer whose value must be from the set {1,…,
Numeric. A positive value for the reference group.
Initial values for the
Initial value for
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
.
There are several models that extend the ordinary
Bradley Terry model to handle ties. This family function
implements one of these models. It involves brat
). The probability that Competitor
refvalue
, e.g., 1. By default, this function
chooses the last competitor to have this reference value.
The data can be represented in the form of a
Excluding the reference value/group, this function
chooses
The Bradley Terry model can be fitted with covariates, e.g., a home advantage variable, but unfortunately, this lies outside the VGLM theoretical framework and therefore cannot be handled with this code.
Torsney, B. (2004). Fitting Bradley Terry models using a multiplicative algorithm. In: Antoch, J. (ed.) Proceedings in Computational Statistics COMPSTAT 2004, Physica-Verlag: Heidelberg. Pages 513--526.
brat
,
Brat
,
binomialff
.
# NOT RUN {
# citation statistics: being cited is a 'win'; citing is a 'loss'
journal <- c("Biometrika", "Comm.Statist", "JASA", "JRSS-B")
mat <- matrix(c( NA, 33, 320, 284,
730, NA, 813, 276,
498, 68, NA, 325,
221, 17, 142, NA), 4, 4)
dimnames(mat) <- list(winner = journal, loser = journal)
# Add some ties. This is fictitional data.
ties <- 5 + 0 * mat
ties[2, 1] <- ties[1,2] <- 9
# Now fit the model
fit <- vglm(Brat(mat, ties) ~ 1, bratt(refgp = 1), trace = TRUE)
fit <- vglm(Brat(mat, ties) ~ 1, bratt(refgp = 1), trace = TRUE, crit = "coef")
summary(fit)
c(0, coef(fit)) # Log-abilities (in order of "journal"); last is log(alpha0)
c(1, Coef(fit)) # Abilities (in order of "journal"); last is alpha0
fit@misc$alpha # alpha_1,...,alpha_M
fit@misc$alpha0 # alpha_0
fitted(fit) # Probabilities of winning and tying, in awkward form
predict(fit)
(check <- InverseBrat(fitted(fit))) # Probabilities of winning
qprob <- attr(fitted(fit), "probtie") # Probabilities of a tie
qprobmat <- InverseBrat(c(qprob), NCo = nrow(ties)) # Probabilities of a tie
check + t(check) + qprobmat # Should be 1s in the off-diagonals
# }
Run the code above in your browser using DataLab