residuals_fbRanks: Residuals function for fbRanks Objects

Description Usage Arguments Value Author(s) See Also Examples

Description

The rank.teams function outputs fbRanks objects. residuals(fbRanks)., where fbRanks is one's output from a rank.teams call, returns the model response residuals (data minus fitted values) for each match in the fbRanks$scores data frame. The output is organized as a list by team. If you just want the response residuals for each match, that is in fbRanks$scores$home.residuals and $away.residuals.

Usage

1
2
## S3 method for class 'fbRanks'
residuals(object, ...)

Arguments

object

A fbRanks object.

...

Other filters to apply when returning residuals. These must match column names in either x$teams or x$scores. For example, if x$teams has a column named 'country' with values 'UK','Canada' and 'Germany', you can pass in country="UK" to only show UK residuals.

Value

A list of the response residuals (data minus fitted values) for each team. It's rather verbose. You probably want to assign it to a variable and work with that. Look at predict.fbRanks. That provides similar output in the $scores variable.

Author(s)

Eli Holmes, Seattle, USA.

eeholmes(at)u(dot)washington(dot)com

See Also

predict.fbRanks

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 

data(B00data) #load a set of games
#fit a model using just the matches from the RCL D1 league
x=rank.teams(scores=B00.scores, teams=B00.teams, venue="RCL D1")

#Show the predicted versus actual scores
b00.resids=residuals(x)

## Not run: 
#you can compare to the residuals for a model to fit to all the data (including RCL D1)
x=rank.teams(scores=B00.scores, teams=B00.teams)

#Just a printing of the ranks with no extra info shown.
b00.resids=residuals(x, venue="RCL D1")

## End(Not run)

fbRanks documentation built on May 1, 2019, 8:01 p.m.