The bpcs package is now on CRAN
After some months of work the bpcs package is at version v1.0.0 and is available on CRAN (https://CRAN.R-project.org/package=bpcs). Now we can easily run Bayesian inference on Bradley-Terry models (including many extensions).
See below the description of the package
Models for the analysis of paired comparison data using Stan. The models include Bayesian versions of the Bradley-Terry model, including random effects (1 level), generalized model for predictors, order effect (home advantage) and the variations for the Davidson (1970) model to handle ties. Additionally, we provide a number of functions to facilitate inference and obtaining results with these models.
Features of the bpcs package
- Bayesian computation of different variations of the Bradley-Terry (including with home advantage, random effects and the generalized model).
- Bayesian computation of different variations of the Davidson model to handle ties in the contest (including with home advantage, random effects and the generalized model).
- Accepts a column with the results of the contest or the scores for each player.
- Customize a normal prior distribution for every parameter.
- Compute HDP interval for every parameter with the
- Compute rank of the players with the
- Compute all the probability combinations for one player beating the other with the
- Convert aggregated tables of results into long format (one contest
per row) with the
- Obtain the posterior distribution for every parameter of the model
- Easy predictions using the
- We do not reinforce any table or plotting library! Results are returned as data frames for easier plotting and creating tables
- We reinforce the need to manually specify the model to be used.
- Bradley-Terry (
bt) (Bradley and Terry 1952)
- Davidson model (
davidson) for handling ties (Davidson 1970)
Options to add to the models:
- Order effect (
-ordereffect). E.g. for home advantage (Davidson and Beaver 1977)
- Generalized models (
-generalized). When we have contestant specific predictors (Springall 1973)
- Intercept random effects (
-U). For example, to compensate clustering or repeated measures (Böckenholt 2001)
- Simple BT model:
- Davidson model with random effects:
- Generalized BT model with order effect:
Get the package
To get the latest version of the bpcs package, install it from Github: