I have a dataset containing the outcomes of head-to-head matches of a game. I would like to fit a logistic regression model with target variable being the winner of the match and using var_a and var_b as two predictors. The first, var_a is a continuous variable and the second, var_b is a binary variable. For this, I am considering using the difference in var_a between the player and the other player in the match as a predictor rather than the raw values of var_a.

An example few rows might look like this:

match_id winner var_a var_b
1 0 80 1
1 1 76 0
2 0 54 0
2 1 68 0
3 0 71 0
3 1 78 1

As you can see, there are two observations per match.

I feel like if I simply fit a model using all rows of my data, I will run into problems based on the fact that each match would be included twice. This feels almost like a paired samples t-test except for the fact that I have a third variable, var_b which may or may not be present in a given match. For example, in match 2, neither player had var_b.

My thought was to do a bootstrap-esque procedure where I randomly select one observation per match, fit a model, and record the coefficients and then repeat a few thousand times to generate confidence intervals for my coefficient estimates. This is not the same as the bootstrap, since I would not be sampling with replacement, but I'm not sure if any kind of standard bootstrap approach would be appropriate. Perhaps a cluster bootstrap could work?

Is the procedure that I have outlined a reasonable approach or is there some other method which could give me better estimates for the coefficients?


1 Answer 1


You could try fitting a logistic regression with 4 predictors: var_a[player_1], var_a[player_2], var_b[player_1], var_b[player_2], the target variable being 0 or 1 (0 if player_1 wins or 1 if player_2).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.