Results from repeated games among seven baseball teams, following Agresti

data(baseball)

Format

A hyper2 object that gives a likelihood function

Details

Agresti discusses results from seven baseball teams in the 1987 season of the Eastern Division of the American League.

A results table and likelihood function is given in the package as baseball_table and baseball respectively. The maximum likelihood estimate is given as baseball_maxp, but can be reproduced by maxp(baseball).

These objects can be generated by running script inst/home_advantage.Rmd, which includes some further discussion and technical documentation, and creates file baseball.rda which resides in the data/ directory.

References

A. Agresti 2002. “Categorical data analysis”. John Wiley and Sons; p437

See also

Examples

baseball_table
#>           Milwaukee Detroit Toronto New York Boston Cleveland Baltimore
#> Milwaukee        NA    3+3i    2+5i     3+3i   5+1i      2+5i      2+5i
#> Detroit        4+3i      NA    4+3i     5+1i   2+5i      3+3i      1+5i
#> Toronto        4+2i    4+2i      NA     2+5i   3+3i      3+4i      1+6i
#> New York       4+3i    4+3i    2+4i       NA   4+2i      4+3i      2+4i
#> Boston         6+1i    6+0i    4+3i     4+3i     NA      4+2i      1+6i
#> Cleveland      4+2i    6+1i    4+2i     4+2i   5+2i        NA      3+4i
#> Baltimore      6+0i    4+3i    6+0i     6+1i   6+0i      2+4i        NA
baseball_table[1:3,1:3] 
#>           Milwaukee Detroit Toronto
#> Milwaukee        NA    3+3i    2+5i
#> Detroit        4+3i      NA    4+3i
#> Toronto        4+2i    4+2i      NA
home_away3(baseball_table[1:3,1:3],1.3)
#> log( (Detroit=1)^5 * (Detroit=1, Milwaukee=1.3)^-6 * (Detroit=1,
#> Toronto=1.3)^-6 * (Detroit=1.3)^8 * (Detroit=1.3, Milwaukee=1)^-7 *
#> (Detroit=1.3, Toronto=1)^-7 * (Milwaukee=1)^5 * (Milwaukee=1,
#> Toronto=1.3)^-6 * (Milwaukee=1.3)^5 * (Milwaukee=1.3, Toronto=1)^-7 *
#> (Toronto=1)^8 * (Toronto=1.3)^8)