elo.run.helpers {elo}R Documentation

Helper functions for elo.run

Description

as.matrix converts an Elo object into a matrix of running Elos. These are the Elos at the time of grouping, but before any regression takes place.

Usage

## S3 method for class 'elo.run'
as.matrix(x, ...)

## S3 method for class 'elo.run.regressed'
as.matrix(x, ...)

## S3 method for class 'elo.run'
as.data.frame(x, ...)

final.elos(x, ...)

## S3 method for class 'elo.run'
final.elos(x, ...)

## S3 method for class 'elo.run.regressed'
final.elos(x, regressed = FALSE, ...)

Arguments

x

An object of class "elo.run" or class "elo.run.regressed".

...

Other arguments (Not in use at this time).

regressed

Logical, denoting whether to use the post-regressed (TRUE) or pre-regressed (FALSE) final Elos. Note that TRUE only makes sense when the final Elos were regressed one last time (i.e., if the last element of the regress()) vector yields TRUE).

Details

as.data.frame converts the "elos" component of an object from elo.run into a data.frame.

final.elos is a generic function to extract the last Elo per team.

Value

A matrix, a data.frame, or a named vector.

See Also

elo.run

Examples

e <- elo.run(score(points.Home, points.Visitor) ~ team.Home + team.Visitor + group(week),
             data = tournament, k = 20)
head(as.matrix(e))
str(as.data.frame(e))
final.elos(e)

[Package elo version 3.0.2 Index]