SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
BradleyTerry2: Flexible Models for Paired
                         Comparisons

                                Heather Turner and David Firth

                                        Department of Statistics
                                       University of Warwick, UK


                                             21 July 2010



H. Turner and D. Firth (Warwick, UK)           BradleyTerry2       useR! 2010   1 / 15
Pair Comparisons


 In situations where one object is pitted against another, e.g.

         players/teams in sport
         consumer products in market research
         images in psychology experiments
         plants in pest-resistance trials
         alleles in transmission from parent to child




H. Turner and D. Firth (Warwick, UK)        BradleyTerry2    useR! 2010   2 / 15
Bradley-Terry Models

 In a contest between two players i and j, the basic Bradley-Terry
 Model is given by

                                        pr(i beats j)   αi /(αi + αj )   αi
             odds(i beats j) =                        =                =
                                        pr(j beats i)   αj /(αi + αj )   αj

 where αi , αj > 0 are the player abilities.

 The abilities can be estimated via maximum likelihood by re-framing
 the model as a logistic model:

                                  logit(pr(i beats j)) = λi − λj


H. Turner and D. Firth (Warwick, UK)         BradleyTerry2             useR! 2010   3 / 15
Structured Bradley-Terry Models
 Contest-specific effects

                                       λik = αi +              βr xikr
                                                        r

 Ability modelled by player attributes

                                        λi =        βr xir + ei
                                                r

 The prediction error ei

         allows for variability between players with equal covariate values
         induces correlation between comparisons with a common player

H. Turner and D. Firth (Warwick, UK)           BradleyTerry2             useR! 2010   4 / 15
The BradleyTerry2 package
 New features to accommodate general Bradley-Terry model

         flexible formula interface to modelling fitting function BTm():
         allows player-specific, judge-specific, contest-specific variables
         and random effects
         PQL algorithm for estimation of GLMMs
         efficient data management of multiple data frames

 Best of original BradleyTerry package

         translation of ability formula to design matrix
         methods for fitted model object, e.g. anova, BTabilities
         handling of missing data in player covariates
H. Turner and D. Firth (Warwick, UK)   BradleyTerry2           useR! 2010   5 / 15
College Ice Hockey: Men’s Division I
                                       1083 games from the 2009-10
                                       composite schedule

                                       58 teams from 6 conferences

                                       Results in data frame icehockey
                                           visitor visiting team
                                           opponent usually home
                                           team
                                           result 1, 0 or 0.5




H. Turner and D. Firth (Warwick, UK)   BradleyTerry2            useR! 2010   6 / 15
KRACH Ratings

 Ken’s Ratings for American College Hockey are obtained from a
 standard Bradley-Terry model with a separate ability for each team:
 > standardBT <- BTm(outcome = result,
 +      player1 = data.frame(team = visitor),
 +      player2 = data.frame(team = opponent),
 +      id = "team", formula = ~ team, data = icehockey)
 The default behaviour provides some simplification
 > standardBT <- BTm(outcome = result,
 +      player1 = visitor, player2 = opponent,
 +      id = "team", data = icehockey)




H. Turner and D. Firth (Warwick, UK)       BradleyTerry2   useR! 2010   7 / 15
Converting BTm Results to KRACH
 The BTabilities function returns the log-abilities and s.e.
 > head(BTabilities(standardBT), 4)
                       ability      s.e.
 Alaska-Anchorage    0.0000000 0.0000000
 Air Force          -1.4135091 0.6560509
 Alabama-Huntsville -0.6825408 0.6052347
 American Int’l     -2.9316119 0.7121359
 KRACH rescales the abilities so that KRACH = 100 ⇒ RRWP = 0.5
 > KRACH <- exp(BTabilities(standardBT)[,1])*scale
 > head(sort(round(KRACH, 1), decr = TRUE))
            Denver                      Miami       Wisconsin
             543.0                      488.2           481.3
      North Dakota             Boston College St. Cloud State
             434.3                      346.2           345.3

H. Turner and D. Firth (Warwick, UK)      BradleyTerry2         useR! 2010   8 / 15
Home Ice Advantage
 The official NCAA ranking gives more credit for neutral-site/road
 wins. Equivalently we can adjust for home ice advantage
 > levelBT <- BTm(result,
 +    data.frame(team = visitor, home.ice = 0),
 +    data.frame(team = opponent, home.ice = home.ice),
 +    ~ team + home.ice, id = "team", data = icehockey)
                      10 15 20 25 30 35
          No. Teams
                      5
                      0




                                          −4   −3    −2   −1    0         1          2   3   4   5   6
                                                                    Change in Rank


H. Turner and D. Firth (Warwick, UK)                           BradleyTerry2                         useR! 2010   9 / 15
Effect on Selection?
 The 6 regional winners automatically qualify for the NCAA
 tournament, whilst another 10 are selected by ranking

                   KRACH                    level KRACH            NCAA
                 Denver                         Denver              Miami
                 Miami                          Miami               Denver
               Wisconsin                      Wisconsin           Wisconsin
            St. Cloud State                St. Cloud State     St. Cloud State
           Minnesota Duluth                 Bemidji State       Bemidji State
           Northern Michigan              Northern Michigan          Yale
            Colorado College               New Hampshire      Northern Michigan
            New Hampshire                 Minnesota Duluth     New Hampshire
               Minnesota                   Colorado College         Alaska
             Bemidji State                     Vermont             Vermont

H. Turner and D. Firth (Warwick, UK)          BradleyTerry2              useR! 2010   10 / 15
Lizards Data Revisited




H. Turner and D. Firth (Warwick, UK)     BradleyTerry2    useR! 2010   11 / 15
Data Structure in R

 > str(flatlizards)
 List of 2
  $ contests :’data.frame’: 100 obs. of 2 variables:
   ..$ winner: Factor w/ 77 levels "lizard003","lizard005",..: 27 33
   ..$ loser : Factor w/ 77 levels "lizard003","lizard005",..: 3 6 7
  $ predictors:’data.frame’: 77 obs. of 18 variables:
   ..$ id           : Factor w/ 77 levels "3","5","6","9",..: 1 2 3 4
   ..$ throat.PC1 : num [1:77] -1.16 -13.19 -12.47 4.75 -13.47 ...
   ..$ throat.PC2 : num [1:77] 1.066 2.127 -0.771 8.399 -1.968 ...
   ..$ throat.PC3 : num [1:77] 3.2152 0.8776 -1.6139 0.0786 0.4982 .
   ...




H. Turner and D. Firth (Warwick, UK)         BradleyTerry2   useR! 2010   12 / 15
Model in Whiting et al, Animal Behaviour, 2006
 > liz <- BTm(1, winner, loser, ~throat.PC1[..] + throat.PC3[..] +
      head.length[..] + SVL[..] + (1|..), data = flatlizards)

                                   No random effects            Random effects
                                 Estimate Std. Error Estimate Std. Error
          lizard096                    16.42                   36.68
          lizard099                     0.84            1.16    0.95        1.28
          throat.PC1                   −0.09            0.03   −0.09        0.04
          throat.PC3                    0.34            0.11    0.37        0.15
          head.length                  −1.13            0.49   −1.38        0.74
          SVL                           0.19            0.10    0.17        0.14
          σe                                                    1.1         0.3

H. Turner and D. Firth (Warwick, UK)           BradleyTerry2            useR! 2010   13 / 15
Main conclusions from original study:

         Overall brightness (PC1) and UV intensity (PC3) of the throat
         are clearly significant predictors of fight-winning ability.
         PC3 has by far the largest effect: in a contest between lizards at
         ±2 standard deviations the odds are estimated as ≈ 30 in favour
         of the lizard with greater UV reflectance on the throat.




 Thankfully unaffected by allowing for variation between lizards with
 the same covariate values!



H. Turner and D. Firth (Warwick, UK)   BradleyTerry2          useR! 2010   14 / 15
Summary


 BradleyTerry2 can be downloaded from
 http://cran.r-project.org/package=BradleyTerry2

 Package vignette gives further examples.

 Further development planned, e.g.

         better handling of ties
         random effects for judges




H. Turner and D. Firth (Warwick, UK)    BradleyTerry2   useR! 2010   15 / 15

Weitere ähnliche Inhalte

Was ist angesagt?

ολο το κεφ 1 ασκ (δ) new
ολο το κεφ 1 ασκ (δ) newολο το κεφ 1 ασκ (δ) new
ολο το κεφ 1 ασκ (δ) new
Chris Tsoukatos
 
διαγωνισμα αλγεβρα α λυκειου ανισωσεις απολυτα ριζες
διαγωνισμα αλγεβρα α λυκειου ανισωσεις απολυτα ριζεςδιαγωνισμα αλγεβρα α λυκειου ανισωσεις απολυτα ριζες
διαγωνισμα αλγεβρα α λυκειου ανισωσεις απολυτα ριζες
paris1967
 
ΒΑΣΙΚΕΣ ΑΣΚΗΣΕΙΣ ΕΟΚ.pdf
ΒΑΣΙΚΕΣ ΑΣΚΗΣΕΙΣ ΕΟΚ.pdfΒΑΣΙΚΕΣ ΑΣΚΗΣΕΙΣ ΕΟΚ.pdf
ΒΑΣΙΚΕΣ ΑΣΚΗΣΕΙΣ ΕΟΚ.pdf
GEORGEPOURIS2
 
สมดุล 2
สมดุล 2สมดุล 2
สมดุล 2
krusarawut
 
เรื่องที่18คลื่นแม่เหล็กไฟฟ้า
เรื่องที่18คลื่นแม่เหล็กไฟฟ้าเรื่องที่18คลื่นแม่เหล็กไฟฟ้า
เรื่องที่18คลื่นแม่เหล็กไฟฟ้า
Apinya Phuadsing
 
แผนการจัดการเรียนรู้ที่ 1 แบบทดสอบก่อนและหลังเรียน
แผนการจัดการเรียนรู้ที่  1 แบบทดสอบก่อนและหลังเรียนแผนการจัดการเรียนรู้ที่  1 แบบทดสอบก่อนและหลังเรียน
แผนการจัดการเรียนรู้ที่ 1 แบบทดสอบก่อนและหลังเรียน
jirupi
 
χημεία β λυκείου (τράπεζα θεμάτων) κεφάλαιο 2 (αλκένια αλκίνια-περιβάλλον)
χημεία β λυκείου (τράπεζα θεμάτων) κεφάλαιο 2 (αλκένια αλκίνια-περιβάλλον)χημεία β λυκείου (τράπεζα θεμάτων) κεφάλαιο 2 (αλκένια αλκίνια-περιβάλλον)
χημεία β λυκείου (τράπεζα θεμάτων) κεφάλαιο 2 (αλκένια αλκίνια-περιβάλλον)
Xristos Koutras
 

Was ist angesagt? (14)

ολο το κεφ 1 ασκ (δ) new
ολο το κεφ 1 ασκ (δ) newολο το κεφ 1 ασκ (δ) new
ολο το κεφ 1 ασκ (δ) new
 
διαγωνισμα αλγεβρα α λυκειου ανισωσεις απολυτα ριζες
διαγωνισμα αλγεβρα α λυκειου ανισωσεις απολυτα ριζεςδιαγωνισμα αλγεβρα α λυκειου ανισωσεις απολυτα ριζες
διαγωνισμα αλγεβρα α λυκειου ανισωσεις απολυτα ριζες
 
Βασικές γνώσεις Γ Λυκείου Μαθηματικά και Στοιχεία Στατιστικής
Βασικές γνώσεις Γ Λυκείου Μαθηματικά και Στοιχεία ΣτατιστικήςΒασικές γνώσεις Γ Λυκείου Μαθηματικά και Στοιχεία Στατιστικής
Βασικές γνώσεις Γ Λυκείου Μαθηματικά και Στοιχεία Στατιστικής
 
ΒΑΣΙΚΕΣ ΑΣΚΗΣΕΙΣ ΕΟΚ.pdf
ΒΑΣΙΚΕΣ ΑΣΚΗΣΕΙΣ ΕΟΚ.pdfΒΑΣΙΚΕΣ ΑΣΚΗΣΕΙΣ ΕΟΚ.pdf
ΒΑΣΙΚΕΣ ΑΣΚΗΣΕΙΣ ΕΟΚ.pdf
 
Επαναληπτικές ασκήσεις ΕΠΑΛ 2017
Επαναληπτικές ασκήσεις ΕΠΑΛ  2017Επαναληπτικές ασκήσεις ΕΠΑΛ  2017
Επαναληπτικές ασκήσεις ΕΠΑΛ 2017
 
Γραπτές Δοκιμασίες Β΄ Λυκείου
Γραπτές Δοκιμασίες Β΄ ΛυκείουΓραπτές Δοκιμασίες Β΄ Λυκείου
Γραπτές Δοκιμασίες Β΄ Λυκείου
 
สมดุล 2
สมดุล 2สมดุล 2
สมดุล 2
 
เรื่องที่18คลื่นแม่เหล็กไฟฟ้า
เรื่องที่18คลื่นแม่เหล็กไฟฟ้าเรื่องที่18คลื่นแม่เหล็กไฟฟ้า
เรื่องที่18คลื่นแม่เหล็กไฟฟ้า
 
แผนการจัดการเรียนรู้ที่ 1 แบบทดสอบก่อนและหลังเรียน
แผนการจัดการเรียนรู้ที่  1 แบบทดสอบก่อนและหลังเรียนแผนการจัดการเรียนรู้ที่  1 แบบทดสอบก่อนและหลังเรียน
แผนการจัดการเรียนรู้ที่ 1 แบบทดสอบก่อนและหลังเรียน
 
F laplace
F laplaceF laplace
F laplace
 
Pyradiomics Customization [CDM]
Pyradiomics Customization [CDM]Pyradiomics Customization [CDM]
Pyradiomics Customization [CDM]
 
Gestire la bibliografia- Introduzione all'uso di Zotero
Gestire la bibliografia- Introduzione all'uso di Zotero Gestire la bibliografia- Introduzione all'uso di Zotero
Gestire la bibliografia- Introduzione all'uso di Zotero
 
χημεία β λυκείου (τράπεζα θεμάτων) κεφάλαιο 2 (αλκένια αλκίνια-περιβάλλον)
χημεία β λυκείου (τράπεζα θεμάτων) κεφάλαιο 2 (αλκένια αλκίνια-περιβάλλον)χημεία β λυκείου (τράπεζα θεμάτων) κεφάλαιο 2 (αλκένια αλκίνια-περιβάλλον)
χημεία β λυκείου (τράπεζα θεμάτων) κεφάλαιο 2 (αλκένια αλκίνια-περιβάλλον)
 
Άλγεβρα Α Λυκείου - Εξισώσεις - Ανισώσεις 2020 [75 σελίδες]
Άλγεβρα Α Λυκείου - Εξισώσεις - Ανισώσεις 2020 [75 σελίδες]Άλγεβρα Α Λυκείου - Εξισώσεις - Ανισώσεις 2020 [75 σελίδες]
Άλγεβρα Α Λυκείου - Εξισώσεις - Ανισώσεις 2020 [75 σελίδες]
 

Andere mochten auch

Detecting Drug Effects in the Brain
Detecting Drug Effects in the BrainDetecting Drug Effects in the Brain
Detecting Drug Effects in the Brain
htstatistics
 
From L to N: Nonlinear Predictors in Generalized Models
From L to N: Nonlinear Predictors in Generalized ModelsFrom L to N: Nonlinear Predictors in Generalized Models
From L to N: Nonlinear Predictors in Generalized Models
htstatistics
 
Modelling the Diluting Effect of Social Mobility on Health Inequality
Modelling the Diluting Effect of Social Mobility on Health InequalityModelling the Diluting Effect of Social Mobility on Health Inequality
Modelling the Diluting Effect of Social Mobility on Health Inequality
htstatistics
 
Custom Functions for Specifying Nonlinear Terms to gnm
Custom Functions for Specifying Nonlinear Terms to gnmCustom Functions for Specifying Nonlinear Terms to gnm
Custom Functions for Specifying Nonlinear Terms to gnm
htstatistics
 
gnm: a Package for Generalized Nonlinear Models
gnm: a Package for Generalized Nonlinear Modelsgnm: a Package for Generalized Nonlinear Models
gnm: a Package for Generalized Nonlinear Models
htstatistics
 
Nonlinear Discrete-time Hazard Models for Entry into Marriage
Nonlinear Discrete-time Hazard Models for Entry into MarriageNonlinear Discrete-time Hazard Models for Entry into Marriage
Nonlinear Discrete-time Hazard Models for Entry into Marriage
htstatistics
 
Multiplicative Interaction Models in R
Multiplicative Interaction Models in RMultiplicative Interaction Models in R
Multiplicative Interaction Models in R
htstatistics
 
Clustering Microarray Data
Clustering Microarray DataClustering Microarray Data
Clustering Microarray Data
htstatistics
 
Знаменские чтения
Знаменские чтенияЗнаменские чтения
Знаменские чтения
Ekaterina Kushnir
 

Andere mochten auch (20)

Detecting Drug Effects in the Brain
Detecting Drug Effects in the BrainDetecting Drug Effects in the Brain
Detecting Drug Effects in the Brain
 
From L to N: Nonlinear Predictors in Generalized Models
From L to N: Nonlinear Predictors in Generalized ModelsFrom L to N: Nonlinear Predictors in Generalized Models
From L to N: Nonlinear Predictors in Generalized Models
 
Modelling the Diluting Effect of Social Mobility on Health Inequality
Modelling the Diluting Effect of Social Mobility on Health InequalityModelling the Diluting Effect of Social Mobility on Health Inequality
Modelling the Diluting Effect of Social Mobility on Health Inequality
 
Custom Functions for Specifying Nonlinear Terms to gnm
Custom Functions for Specifying Nonlinear Terms to gnmCustom Functions for Specifying Nonlinear Terms to gnm
Custom Functions for Specifying Nonlinear Terms to gnm
 
gnm: a Package for Generalized Nonlinear Models
gnm: a Package for Generalized Nonlinear Modelsgnm: a Package for Generalized Nonlinear Models
gnm: a Package for Generalized Nonlinear Models
 
Nonlinear Discrete-time Hazard Models for Entry into Marriage
Nonlinear Discrete-time Hazard Models for Entry into MarriageNonlinear Discrete-time Hazard Models for Entry into Marriage
Nonlinear Discrete-time Hazard Models for Entry into Marriage
 
Multiplicative Interaction Models in R
Multiplicative Interaction Models in RMultiplicative Interaction Models in R
Multiplicative Interaction Models in R
 
Clustering Microarray Data
Clustering Microarray DataClustering Microarray Data
Clustering Microarray Data
 
Sample slides from "Programming with R" course
Sample slides from "Programming with R" courseSample slides from "Programming with R" course
Sample slides from "Programming with R" course
 
Sample slides from "Getting Started with R" course
Sample slides from "Getting Started with R" courseSample slides from "Getting Started with R" course
Sample slides from "Getting Started with R" course
 
Social Business as the New Organizing Principle
Social Business as the New Organizing PrincipleSocial Business as the New Organizing Principle
Social Business as the New Organizing Principle
 
Знаменские чтения
Знаменские чтенияЗнаменские чтения
Знаменские чтения
 
Три хита по управлению проектами от компании "Гибкие технологии"
Три хита по управлению проектами от компании "Гибкие технологии"Три хита по управлению проектами от компании "Гибкие технологии"
Три хита по управлению проектами от компании "Гибкие технологии"
 
הומור בסין חלק ב
הומור בסין חלק בהומור בסין חלק ב
הומור בסין חלק ב
 
בני כלאיים באמנות עכשווית
בני כלאיים באמנות עכשוויתבני כלאיים באמנות עכשווית
בני כלאיים באמנות עכשווית
 
Astralpool
Astralpool Astralpool
Astralpool
 
Resume
ResumeResume
Resume
 
Delivering Reviews - ICA
Delivering Reviews - ICADelivering Reviews - ICA
Delivering Reviews - ICA
 
Zhao
ZhaoZhao
Zhao
 
Foresight metaskills
Foresight metaskillsForesight metaskills
Foresight metaskills
 

BradleyTerry2: Flexible Models for Paired Comparisons

  • 1. BradleyTerry2: Flexible Models for Paired Comparisons Heather Turner and David Firth Department of Statistics University of Warwick, UK 21 July 2010 H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 1 / 15
  • 2. Pair Comparisons In situations where one object is pitted against another, e.g. players/teams in sport consumer products in market research images in psychology experiments plants in pest-resistance trials alleles in transmission from parent to child H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 2 / 15
  • 3. Bradley-Terry Models In a contest between two players i and j, the basic Bradley-Terry Model is given by pr(i beats j) αi /(αi + αj ) αi odds(i beats j) = = = pr(j beats i) αj /(αi + αj ) αj where αi , αj > 0 are the player abilities. The abilities can be estimated via maximum likelihood by re-framing the model as a logistic model: logit(pr(i beats j)) = λi − λj H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 3 / 15
  • 4. Structured Bradley-Terry Models Contest-specific effects λik = αi + βr xikr r Ability modelled by player attributes λi = βr xir + ei r The prediction error ei allows for variability between players with equal covariate values induces correlation between comparisons with a common player H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 4 / 15
  • 5. The BradleyTerry2 package New features to accommodate general Bradley-Terry model flexible formula interface to modelling fitting function BTm(): allows player-specific, judge-specific, contest-specific variables and random effects PQL algorithm for estimation of GLMMs efficient data management of multiple data frames Best of original BradleyTerry package translation of ability formula to design matrix methods for fitted model object, e.g. anova, BTabilities handling of missing data in player covariates H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 5 / 15
  • 6. College Ice Hockey: Men’s Division I 1083 games from the 2009-10 composite schedule 58 teams from 6 conferences Results in data frame icehockey visitor visiting team opponent usually home team result 1, 0 or 0.5 H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 6 / 15
  • 7. KRACH Ratings Ken’s Ratings for American College Hockey are obtained from a standard Bradley-Terry model with a separate ability for each team: > standardBT <- BTm(outcome = result, + player1 = data.frame(team = visitor), + player2 = data.frame(team = opponent), + id = "team", formula = ~ team, data = icehockey) The default behaviour provides some simplification > standardBT <- BTm(outcome = result, + player1 = visitor, player2 = opponent, + id = "team", data = icehockey) H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 7 / 15
  • 8. Converting BTm Results to KRACH The BTabilities function returns the log-abilities and s.e. > head(BTabilities(standardBT), 4) ability s.e. Alaska-Anchorage 0.0000000 0.0000000 Air Force -1.4135091 0.6560509 Alabama-Huntsville -0.6825408 0.6052347 American Int’l -2.9316119 0.7121359 KRACH rescales the abilities so that KRACH = 100 ⇒ RRWP = 0.5 > KRACH <- exp(BTabilities(standardBT)[,1])*scale > head(sort(round(KRACH, 1), decr = TRUE)) Denver Miami Wisconsin 543.0 488.2 481.3 North Dakota Boston College St. Cloud State 434.3 346.2 345.3 H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 8 / 15
  • 9. Home Ice Advantage The official NCAA ranking gives more credit for neutral-site/road wins. Equivalently we can adjust for home ice advantage > levelBT <- BTm(result, + data.frame(team = visitor, home.ice = 0), + data.frame(team = opponent, home.ice = home.ice), + ~ team + home.ice, id = "team", data = icehockey) 10 15 20 25 30 35 No. Teams 5 0 −4 −3 −2 −1 0 1 2 3 4 5 6 Change in Rank H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 9 / 15
  • 10. Effect on Selection? The 6 regional winners automatically qualify for the NCAA tournament, whilst another 10 are selected by ranking KRACH level KRACH NCAA Denver Denver Miami Miami Miami Denver Wisconsin Wisconsin Wisconsin St. Cloud State St. Cloud State St. Cloud State Minnesota Duluth Bemidji State Bemidji State Northern Michigan Northern Michigan Yale Colorado College New Hampshire Northern Michigan New Hampshire Minnesota Duluth New Hampshire Minnesota Colorado College Alaska Bemidji State Vermont Vermont H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 10 / 15
  • 11. Lizards Data Revisited H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 11 / 15
  • 12. Data Structure in R > str(flatlizards) List of 2 $ contests :’data.frame’: 100 obs. of 2 variables: ..$ winner: Factor w/ 77 levels "lizard003","lizard005",..: 27 33 ..$ loser : Factor w/ 77 levels "lizard003","lizard005",..: 3 6 7 $ predictors:’data.frame’: 77 obs. of 18 variables: ..$ id : Factor w/ 77 levels "3","5","6","9",..: 1 2 3 4 ..$ throat.PC1 : num [1:77] -1.16 -13.19 -12.47 4.75 -13.47 ... ..$ throat.PC2 : num [1:77] 1.066 2.127 -0.771 8.399 -1.968 ... ..$ throat.PC3 : num [1:77] 3.2152 0.8776 -1.6139 0.0786 0.4982 . ... H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 12 / 15
  • 13. Model in Whiting et al, Animal Behaviour, 2006 > liz <- BTm(1, winner, loser, ~throat.PC1[..] + throat.PC3[..] + head.length[..] + SVL[..] + (1|..), data = flatlizards) No random effects Random effects Estimate Std. Error Estimate Std. Error lizard096 16.42 36.68 lizard099 0.84 1.16 0.95 1.28 throat.PC1 −0.09 0.03 −0.09 0.04 throat.PC3 0.34 0.11 0.37 0.15 head.length −1.13 0.49 −1.38 0.74 SVL 0.19 0.10 0.17 0.14 σe 1.1 0.3 H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 13 / 15
  • 14. Main conclusions from original study: Overall brightness (PC1) and UV intensity (PC3) of the throat are clearly significant predictors of fight-winning ability. PC3 has by far the largest effect: in a contest between lizards at ±2 standard deviations the odds are estimated as ≈ 30 in favour of the lizard with greater UV reflectance on the throat. Thankfully unaffected by allowing for variation between lizards with the same covariate values! H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 14 / 15
  • 15. Summary BradleyTerry2 can be downloaded from http://cran.r-project.org/package=BradleyTerry2 Package vignette gives further examples. Further development planned, e.g. better handling of ties random effects for judges H. Turner and D. Firth (Warwick, UK) BradleyTerry2 useR! 2010 15 / 15