I have data on pairwise matches between a set of teams in a double round robin tournament (i.e. each team plays every other team twice). For each match I have the winner, the loser, and the score for each team.
I would like to use the Bradley-Terry model in R to calculate ‘ability’ scores for each team, incorporating the score difference information from each match.
I’m using the BradleyTerry2 package in R, and I have got as far as running it without the score difference information using the following code:
m1 <- BTm(1, winner, loser, data = data)
scores_np <- BTabilities(m1)
‘winner’ and ‘loser’ refer to columns in the dataframe that give the names of the winning and losing teams. Each row in the dataframe is a match. The data is complete in that all teams have data for all matches.
This produces sensible results – as in it largely matches the ranking you get if you just add up the number of wins – so I think I’m doing it correctly.
However, I’m now stuck for how to incorporate the score difference information (which in my data is given for each match by a variable called scorediff, but if necessary I could have separate variables for each team’s score).
I’ve had a look at the BradleyTerry2 help file and it doesn’t seem to have an analogous example. Any help would be appreciated!