extract.elo: extract Elo ratings from elo object

Description Usage Arguments Value Author(s) Examples

View source: R/extract.elo.R

Description

extract Elo ratings from elo object

Usage

1
2
extract.elo(eloobject, extractdate, standardize = FALSE, IDs = NULL,
            NA.interpolate = FALSE, daterange = 1)

Arguments

eloobject

result from elo.seq

extractdate

date on which Elo ratings should be obtained, defaults to the last day in the data set

standardize

should the returned ratings be scaled between 0 and 1. Default is FALSE. See scale.elo

IDs

specify IDs for which ratings are returned. By default, returns all that were present on the date or at least on one day of the date range

NA.interpolate

if FALSE (default), the last known rating is returned, which might not be from the specified date itself (but older). If TRUE, ratings on days without observations are linearly interpolated between days with known ratings (i.e. dates with observed interactions)

daterange

if averaged ratings are desired, supply here the number of days from
extractdate - 1. By default (daterange = 1), the ratings of the single extractdate are returned. daterange = 2 produces average ratings from extractdate and the day after, and so on...

Value

named (IDs) vector of (average) Elo ratings

Author(s)

Christof Neumann

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(adv)
SEQ <- elo.seq(winner=adv$winner, loser=adv$loser, Date=adv$Date)
extract.elo(SEQ, "2010-01-30")
extract.elo(SEQ, "2010-01-30", standardize=TRUE)

# same ratings (regardless of NA.interpolate),
# since "g" was observed on both days
extract.elo(SEQ, "2010-01-29", IDs="g")
extract.elo(SEQ, "2010-01-29", IDs="g", NA.interpolate=TRUE)

extract.elo(SEQ, "2010-01-31", IDs="g")
extract.elo(SEQ, "2010-01-31", IDs="g", NA.interpolate=TRUE)

# different ratings (depending on NA.interpolate),
# since "g" was not observed that day
extract.elo(SEQ, "2010-01-30", IDs="g")
extract.elo(SEQ, "2010-01-30", IDs="g", NA.interpolate=TRUE)

extract.elo(SEQ, "2010-01-10", daterange=5)
extract.elo(SEQ, "2010-01-10", daterange=5, NA.interpolate=TRUE)

EloRating documentation built on May 29, 2017, 7:14 p.m.