| football {BradleyTerry2} | R Documentation |
The win/lose/draw results for five seasons of the English Premier League football results, from 2008/9 to 2012/13
football
A data frame with 1881 observations on the following 4 variables.
seasona factor with levels 2008-9, 2009-10, 2010-11, 2011-12, 2012-13
homea factor specifying the home team, with 29 levels
Ars (Arsenal), ... , Wol (Wolverhampton)
awaya factor specifying the away team, with the same
levels as home.
resulta numeric vector giving the result for the home team: 1 for a win, 0 for a draw, -1 for a loss.
In each season, there are 20 teams, each of which plays one home game and one away game against all the other teams in the league. The results in 380 games per season.
http://soccernet.espn.go.com/grid?league=eng.1&season=2011&view=n&cc=5739
Davidson, R. R. (1970). On extending the Bradley-Terry model to accommodate ties in paired comparison experiments. Journal of the American Statistical Association, 65, 317–328.
### example requires gnm
if (require(gnm)) {
### convert to trinomial counts
football.tri <- expandCategorical(football, "result", idvar = "match")
head(football.tri)
### add variable to indicate whether team playing at home
football.tri$at.home <- !logical(nrow(football.tri))
### fit Davidson model for ties
Davidson <- gnm(count ~
GenDavidson(result == 1, result == 0, result == -1,
home:season, away:season,
home.adv = ~1, tie.max = ~1,
at.home1 = at.home, at.home2 = !at.home) - 1,
eliminate = match, family = poisson, data = football.tri)
}