Learn R Programming

elo (version 3.0.2)

elo.prob: Elo probability

Description

Calculate the probability that team A beats team B. This is vectorized.

Usage

elo.prob(elo.A, ...)

# S3 method for default elo.prob(elo.A, elo.B, ..., elos = NULL, adjust.A = 0, adjust.B = 0)

# S3 method for formula elo.prob(formula, data, na.action, subset, ..., elos = NULL)

# S3 method for elo.multiteam.matrix elo.prob(elo.A, ..., elos = NULL)

Value

A vector of Elo probabilities.

Arguments

elo.A, elo.B

Numeric vectors of elo scores, or else vectors of teams.

...

Other arguments (not in use at this time).

elos

An optional named vector containing Elo ratings for all teams in formula or elo.A and elo.B.

adjust.A, adjust.B

Numeric vectors to adjust elo.A and elo.B by.

formula

A formula. See the help page for formulas for details.

data

A data.frame in which to look for objects in formula.

na.action

A function which indicates what should happen when the data contain NAs.

subset

An optional vector specifying a subset of observations.

Details

Note that formula can be missing the wins.A component. If present, it's ignored by elo.model.frame.

See Also

elo.update, elo.calc, elo.model.frame

Examples

Run this code
elo.prob(1500, 1500)
elo.prob(c(1500, 1500), c(1500, 1600))

dat <- data.frame(wins.A = c(1, 0), elo.A = c(1500, 1500),
                  elo.B = c(1500, 1600), k = c(20, 20))
elo.prob(~ elo.A + elo.B, data = dat)

## Also works to include the wins and k:
elo.prob(wins.A ~ elo.A + elo.B + k(k), data = dat)

## Also allows teams
elo.prob(c("A", "B"), c("C", "C"), elos = c(A = 1500, B = 1600, C = 1500))

Run the code above in your browser using DataLab