3

I recently tested some participants on a navigation task. The success rate in the navigation task is a binomial record of pass (1) and fail (0). I assessed participants in different environmental blocks. I also administered a mental rotation test (MRT). My goal is to see the interaction effect of MRT and blocks on success rate. However, sex/gender of the participants has a significant relationship with success rate. My question is how to control for this variable in my GLMM model. I have a possible model but I am not sure if it is correct.

Success rate data= binomial (1 or 0), Block data = categorical(B1, B2, B3, B4), MRT data = integer between 1 to 12, Sex data = (1 or 0)

I normalized the data before applying the model.

note:I had a repeated measure design as each participant is tested in different blocks.

model1 <- glmer(Success ~ Block * MRT + (1|sex) + (1|Subject),  
                data = data, family = "binomial")
kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
Yasmine
  • 33
  • 3
  • 1
    I don't think you should have sex as a random effect. Because there are only two levels in your data, you should have it as a fixed effect if you want to control for it:https://stats.stackexchange.com/questions/37647/what-is-the-minimum-recommended-number-of-groups-for-a-random-effects-factor – sjp Feb 16 '21 at 01:02

1 Answers1

4

It does not make sense for sex to be a grouping variable for random intecepts. It has only two levels and is in many scenarios it will be a confounding variable, or possible a competing exposure. In either case the best way to control for it, is by fitting fixed effects for it:

glmer(Success ~ Block * MRT + sex + (1|Subject),  
            data = data, family = "binomial")
Robert Long
  • 53,316
  • 10
  • 84
  • 148