baseball {BradleyTerry}R Documentation

Baseball data from Agresti (2002)

Description

Baseball results for games in the 1987 season between 7 teams in the Eastern Division of the American League.

Usage

data(baseball)

Format

A data frame with 98 observations on the following 4 variables.

winner
a factor with levels Milwaukee Detroit Toronto New York Boston Cleveland Baltimore
loser
a factor with levels Milwaukee Detroit Toronto New York Boston Cleveland Baltimore
Freq
a numeric vector
home.adv
a numeric vector

Details

The home.adv variable is 1 for games where the home team won, and -1 for games where the away team won.

Source

page 438 of Agresti, A (2002) Categorcal Data Analysis (2nd Edn.). Wiley, New York.

References

Firth, D. (2005) Bradley-Terry models in R. Journal of Statistical Software, to appear.

See Also

BTm

Examples

data(baseball)
##  The data in collapsed tabular form as on p438 of Agresti
xtabs(Freq ~ winner + loser, baseball)
##  Simple Bradley-Terry model as in Agresti p437
print(baseballModel <- BTm(baseball ~ ..))
##  Introduce order effect as in Agresti p438
update(baseballModel, order.effect = baseball$home.adv) 

[Package BradleyTerry version 0.8-7 Index]