Description Usage Arguments Details Value Author(s) References See Also Examples

Computes the (baseline) ability of each player from a model object of class
`"BTm"`

.

1 | ```
BTabilities(model)
``` |

`model` |
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 `predict.BTm()`

.

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 `"separate"`

, which
identifies those players whose ability was estimated separately. For an
example, see `flatlizards()`

.

A two-column numeric matrix of class `c("BTabilities", "matrix")`

, with columns named `"ability"`

and `"se"`

; has one row
for each player; has attributes named `"vcov"`

, `"modelcall"`

,
`"factorname"`

and (sometimes — see below) `"separate"`

. The
first three attributes are not printed by the method
`print.BTabilities`

.

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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.