Description Usage Format Details Source References See Also Examples
The win/lose/draw results for five seasons of the English Premier League football results, from 2008/9 to 2012/13
1 |
A data frame with 1881 observations on the following 4 variables.
a factor with levels 2008-9
,
2009-10
, 2010-11
, 2011-12
, 2012-13
a factor specifying the home team, with 29 levels
Ars
(Arsenal), ... , Wol
(Wolverhampton)
a factor specifying the away team, with the same levels
as home
.
a 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.
These data were downloaded from http://soccernet.espn.go.com in 2013. The site has since moved and the new site does not appear to have an equivalent source.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ### 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
### - subset to first and last season for illustration
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,
subset = season %in% c("2008-9", "2012-13"))
### see ?GenDavidson for further analysis
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.