Computes the (baseline) ability of each player from a model object of class
a model object for which
The player abilities are either directly estimated by the model, in which
case the appropriate parameter estimates are returned, otherwise the
abilities are computed from the terms of the fitted model that involve
player covariates only (those indexed by
model$id in the model
formula). Thus parameters in any other terms are assumed to be zero. If one
player has been set as the reference, then
predict.BTm() can be used to
obtain ability estimates with non-player covariates set to other values,
see examples for
If the abilities are structured according to a linear predictor, and if
there are player covariates with missing values, the abilities for the
corresponding players are estimated as separate parameters. In this event
the resultant matrix has an attribute, named
identifies those players whose ability was estimated separately. For an
A two-column numeric matrix of class
c("BTabilities", "matrix"), with columns named
"se"; has one row
for each player; has attributes named
"factorname" and (sometimes — see below)
first three attributes are not printed by the method
David Firth and Heather Turner
Firth, D. (2005) Bradley-Terry models in R. Journal of Statistical Software, 12(1), 1–12.
Turner, H. and Firth, D. (2012) Bradley-Terry models in R: The BradleyTerry2 package. Journal of Statistical Software, 48(9), 1–21.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
### citations example ## Convert frequencies to success/failure data citations.sf <- countsToBinomial(citations) names(citations.sf)[1:2] <- c("journal1", "journal2") ## Fit the "standard" Bradley-Terry model citeModel <- BTm(cbind(win1, win2), journal1, journal2, data = citations.sf) BTabilities(citeModel) ### baseball example data(baseball) # start with baseball data as provided by package ## Fit mode with home advantage baseball$home.team <- data.frame(team = baseball$home.team, at.home = 1) baseball$away.team <- data.frame(team = baseball$away.team, at.home = 0) baseballModel2 <- BTm(cbind(home.wins, away.wins), home.team, away.team, formula = ~ team + at.home, id = "team", data = baseball) ## Estimate abilities for each team, relative to Baltimore, when ## playing away from home: BTabilities(baseballModel2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.