0

I am trying to model the number of successes in data where the number of trials is not fixed. I am trying to fit a binomial generalised mixed effects model, with the number of trials as an 'offset' variable, like so:

        glmer(cbind(number of successes, number of failures) ~ 
         offset(number of trials) + other fixed and random 
         effects, data = data, family = binomial())

Is this the correct way to use offset?

Ellen
  • 41

1 Answers1

1

The information on the number of trials is already there. The number of trials = number of successes + number of failures. You can provide inputs for logistic regression as a column of zeroes and ones, probabilities, or two columns for successes and failures. In neither of the cases, there is a reason to provide the number of trials as a separate variable.

Tim
  • 138,066