TransWikia.com

lmer or binomial GLMM

Cross Validated Asked on December 25, 2021

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

One Answer

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),
       family = binomial, data = mydata)

Answered by Robert Long on December 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP