Usage
rank.teams(scores=NULL, teams=NULL, family="poisson", fun="glm", max.date="2100-6-1", min.date="1900-5-1", date.format="%Y-%m-%d", time.weight.eta=0, add=NULL, silent=FALSE, ...)
Arguments
scores
A data frame of match results. Must have columns "date", "home.team", "home.score", "away.team", "away.score". Missing scores must be denoted NaN. Extra columns to be used for filtering in print results or as explanatory variables can be included, e.g. surface or attack.adv.
teams
A data frame with the team data. Must have columns "name" and "alt.name.x", where x can be anything, e.g. 1. Extra columns to be used for filtering in print results or as explanatory variables can be included, e.g. age. None of the column names in the teams data frame are allowed to be the same as names in the scores data frame.
family
Passed to glm or glmer. If you are using speedglm, use the glm notation for family, e.g. "poisson", rather than the equivalent speedglm notation, e.g. poisson(log).
fun
"glm", "glmnet", or "speedglm"
max.date
Latest match date to use when fitting the model.
min.date
Earliest match date to use when fitting the model.
date.format
The date formate for max.date, min.date and dates in the scores dataframe.
add
Vector of explanatory variables to add to the model. Must be a character vector that corresponds to names of columns in scores or teams dataframes.
time.weight.eta
How much time weighting to include. 0 is no weighting. 0.1 would weight the most recent games quite strongly.
silent
Suppresses printing.
...
Other filters to apply when ranking. These must match column names in either teams or scores. For example, if teams has a column named 'country' with values 'UK','Canada' and 'Germany', you can pass in country="UK" to only rank using the matches for UK teams.