Learn R Programming

sirt (version 1.9-0)

btm: Extended Bradley-Terry Model

Description

Estimates an extended Bradley-Terry model (Hunter, 2004; see Details).

Usage

btm(data, ignore.ties = FALSE, fix.eta = NULL, fix.delta = NULL, fix.theta = NULL, 
       maxiter = 100, conv = 1e-04, eps = 0.3)

## S3 method for class 'btm':
summary(object, file=NULL, digits=4,...)

Arguments

data
Data frame with three columns. The first two columns contain labels from the units in the pair comparison. The third column contains the result of the comparison. "1" means that the first units wins, "0" means that the second unit wins and "0.5" means
ignore.ties
Logical indicating whether ties should be ignored.
fix.eta
Numeric value for a fixed $\eta$ value
fix.delta
Numeric value for a fixed $\delta$ value
fix.theta
A vector with entries for fixed theta values.
maxiter
Maximum number of iterations
conv
Convergence criterion
eps
The $\varepsilon$ parameter for the $\varepsilon$-adjustment method (see Bertoli-Barsotti & Punzo, 2012) which reduces bias in ability estimates. In case of $\varepsilon=0$, persons with extreme scores are removed from the pairwise comparison.
object
Object of class btm
file
Optional file name for sinking the summary into
digits
Number of digits after decimal to print
...
Further arguments to be passed.

Value

  • List with following entries
  • parsParameter summary for $\eta$ and $\delta$
  • effectsParameter estimates for $\theta$ and outfit and infit statistics
  • summary.effectsSummary of $\theta$ parameter estimates
  • mle.relMLE reliability, also known as separation reliability
  • sepGSeparation index $G$
  • probsEstimated probabilities
  • dataUsed dataset with integer identifiers

Details

The extended Bradley-Terry model for the comparison of individuals $i$ and $j$ is defined as $$P(X_{ij} = 1 ) \propto \exp( \eta + \theta_i )$$ $$P(X_{ij} = 0 ) \propto \exp( \theta_j )$$ $$P(X_{ij} = 0.5) \propto \exp( \delta + ( \eta + \theta_i +\theta_j )/2 )$$ The parameters $\theta_i$ denote the abilities, $\delta$ is the tendency of the occurence of ties and $\eta$ is the home-advantage effect.

References

Bertoli-Barsotti, L., & Punzo, A. (2012). Comparison of two bias reduction techniques for the Rasch model. Electronic Journal of Applied Statistical Analysis, 5, 360-366. Hunter, D. R. (2004). MM algorithms for generalized Bradley-Terry models. Annals of Statistics, 32, 384-406.

See Also

See also the Rpackages BradleyTerry2, psychotools, psychomix and prefmod.

Examples

Run this code
#############################################################################
# EXAMPLE 1: Bradley-Terry model | data.pw01
#############################################################################

data(data.pw01)

dat <- data.pw01
dat <- dat[ , c("home_team" , "away_team" , "result") ]

# recode results according to needed input
dat$result[ dat$result == 0 ] <- 1/2   # code for ties
dat$result[ dat$result == 2 ] <- 0     # code for victory of away team

#********************
# Model 1: Estimation with ties and home advantage
mod1 <- btm( dat)
summary(mod1)

#********************
# Model 2: Estimation with ties, no epsilon adjustment
mod2 <- btm( dat , eps=0 , fix.eta=0)
summary(mod2)

#********************
# Model 3: Some fixed abilities
fix.theta <- c("Anhalt Dessau" = -1 )
mod3 <- btm( dat , eps=0, fix.theta=fix.theta)
summary(mod3)

#********************
# Model 4: Ignoring ties, no home advantage effect
mod4 <- btm( dat , ignore.ties=TRUE , fix.eta = 0)
summary(mod4)

#********************
# Model 5: Ignoring ties, no home advantage effect (JML approach -> eps=0)
mod5 <- btm( dat , ignore.ties=TRUE , fix.eta = 0 , eps=0)
summary(mod5)

#############################################################################
# EXAMPLE 2: Venice chess data 
#############################################################################

# See http://www.rasch.org/rmt/rmt113o.htm
# Linacre, J. M. (1997). Paired Comparisons with Standard Rasch Software.
# Rasch Measurement Transactions, 11:3, 584-585.

# dataset with chess games -> "D" denotes a draw (tie)
chessdata <- scan( what="character")
    1D.0..1...1....1.....1......D.......D........1.........1.......... Browne
    0.1.D..0...1....1.....1......D.......1........D.........1......... Mariotti
    .D0..0..1...D....D.....1......1.......1........1.........D........ Tatai
    ...1D1...D...D....1.....D......D.......D........1.........0....... Hort
    ......010D....D....D.....1......D.......1........1.........D...... Kavalek
    ..........00DDD.....D.....D......D.......1........D.........1..... Damjanovic
    ...............00D0DD......D......1.......1........1.........0.... Gligoric
    .....................000D0DD.......D.......1........D.........1... Radulov
    ............................DD0DDD0D........0........0.........1.. Bobotsov
    ....................................D00D00001.........1.........1. Cosulich
    .............................................0D000D0D10..........1 Westerinen
    .......................................................00D1D010000 Zichichi 

L <- length(chessdata) / 2
games <- matrix( chessdata , nrow=L , ncol=2 , byrow=TRUE )
G <- nchar(games[1,1])
# create matrix with results
results <- matrix( NA , nrow=G , ncol=3 )
for (gg in 1:G){
    games.gg <- substring( games[,1] , gg , gg )
    ind.gg <- which( games.gg != "." )
    results[gg , 1:2 ] <- games[ ind.gg , 2]
    results[gg, 3 ] <- games.gg[ ind.gg[1] ]
            }
results <- as.data.frame(results)            
results[,3] <- paste(results[,3] )
results[ results[,3] == "D" , 3] <- 1/2
results[,3] <- as.numeric( results[,3] )

# fit model ignoring draws
mod1 <- btm( results , ignore.ties=TRUE , fix.eta = 0 , eps=0 )
summary(mod1)

# fit model with draws
mod2 <- btm( results , fix.eta = 0 , eps=0 )
summary(mod2)

Run the code above in your browser using DataLab