lmer or binomial GLMM

I am running a mixed model in R. However I am having some difficulty understanding the type of model I should be running for the data that I have.

Let's call the dependant variable the number of early button presses in a computerised experiment. An experiment is made up of multiple trials. In each trial a participant has to press a button to react to a target appearing on a screen. However they may press the button too early and this is what is being measured as the outcome variable. So for example, participant A may have in total 3 early button presses in an experiment across trials whereas participant B may have 15.

In a straightforward linear regression model using the lm command in R, I would think this outcome is a continuous numerical variable. As well... its a number that participants score on in the experiment. However I am not trying to run a linear regression, I am trying to run a mixed model with random effects. My understanding of a mixed model in R is that the data format that the model takes from should be structured to show every participant by every trial. When the data is structured like this at trial level suddenly I have a lot of 1s and 0s in my outcome column. As of course at a trial level participants may accidently press the button too early scoring a 1, or not and score a 0.

Does this sound like something that needs to be considered as categorical. If so would it then be looked at through the glmer function with family set to binomial?

Thanks

• I would use a binomial GLMM, your data is exactly the same as accuracy data. – CatM Jun 22 at 20:01
• I agree, that seems to make the most sense. Thanks and appreciated @CatM – Guest Jun 23 at 20:55

In this case you can think of these data as a number of successes out of a total number of trials for each participant, so you can use a binomial glmm, for example, using lme4:glmer:
model <- glmer(cbind(success, total - success) ~ covariates + (1|ID),