How to set up data for Bradley-Terry model in R? I am trying to use the package BradleyTerry2 in R to assess sports teams.  I am using the paper "Bradley-Terry Models in R: The BradleyTerry2 Package" written by Turner and Firth to guide me.  I have gotten the model to work, but now would like to include player-specific predictor variables.  
Currently, my data is set up as such:  First column is the winning team, second column is the losing team, third column is the frequency.  I am not sure how to insert the predictor variables.  I tried including a fourth column with the winning team's variables and a fifth column with the losing team's variables, but have not gotten this to work.  I am not sure if I am just not setting the data up correctly, or if my code is wrong.  
So, one step at a time.  I guess for now, my question is--I am setting up the data correctly?  If not, how should it be set up?
 A: The general advice is to start with a working example from the package, play with it enough to understand it, then adjust it to your problem.  
So, first take a look at the structure of the flatlizards data.  (Load it with data(flatlizards))  This is the data for the BTm model fitting function, but unlike usual it's a list not a data.frame.  It has two components inside which are data.frames, and they have canonical names: 'contests' and 'predictors'.  Looking now at the first one of these, flatlizards$contests, you'll see that it has two column names 'winner' and 'loser' and that in the columns are lizard identifiers.  These identifiers are the row labels in the other data.frame, flatlizards$predictors.  Together these two data.frames tell you who won each match and provide each player's attributes.  This gives you a picture of what you need, viz. a list with two appropriately named data.frames with row and column labels as above but with your data in.
One small difference from the example in the paper is that since you have apparently already aggregated wins and losses by pairs, your first argument to BTm is probably not simply 1 as it is in the example but rather the number of times the particular contest between two individuals turned out this way.
Hope that's enough to get you going.
