elo (version 2.1.1)

predict.elo: Make Predictions on an elo Object

Description

Make Predictions on an elo Object

Usage

# S3 method for elo.run
predict(object, newdata, ...)

# S3 method for elo.run.regressed predict(object, newdata, regressed = FALSE, ...)

# S3 method for elo.glm predict(object, newdata, type = "response", ...)

# S3 method for elo.running predict(object, newdata, running = TRUE, ...)

# S3 method for elo.markovchain predict(object, newdata, ...)

# S3 method for elo.colley predict(object, newdata, ...)

# S3 method for elo.winpct predict(object, newdata, ...)

Arguments

object

An model from which to get predictions.

newdata

A new dataset containing the same variables as the call that made object. If missing, the predicted win probabilities from object will be returned.

...

Other arguments.

regressed

See the note on final.elos.

type
running

logical, denoting whether to use the running predicted values. Only makes sense if newdata is missing.

Value

A vector of win probabilities.

Details

Note that the "elo.glm.running" objects will use a model fit on all the data to predict.

Examples

Run this code
# NOT RUN {
data(tournament)
t1 <- head(tournament, -3)
t2 <- tail(tournament, 3)
results <- elo.run(score(points.Home, points.Visitor) ~ team.Home + team.Visitor,
                   data = t1, k = 20)
predict(results)
predict(results, newdata = t2)

results <- elo.glm(score(points.Home, points.Visitor) ~ team.Home + team.Visitor, data = t1,
  subset = points.Home != points.Visitor)
predict(results)
predict(results, newdata = t2)

results <- elo.markovchain(score(points.Home, points.Visitor) ~ team.Home + team.Visitor, data = t1,
  subset = points.Home != points.Visitor, k = 0.7)
predict(results)
predict(results, newdata = t2)

results <- elo.colley(score(points.Home, points.Visitor) ~ team.Home + team.Visitor, data = t1,
  subset = points.Home != points.Visitor)
predict(results)
predict(results, newdata = t2)

results <- elo.winpct(score(points.Home, points.Visitor) ~ team.Home + team.Visitor, data = t1,
  subset = points.Home != points.Visitor, k = 0.7)
predict(results)
predict(results, newdata = t2)
# }

Run the code above in your browser using DataLab