4
$\begingroup$

I'm new to data analysis and I'm trying to perform a mixed-effect logistic regression.
My data look like this:

NS    Trial    Groupe    Ospan    PrReward    PrTransition    Stay  
10    14    PG    1    1    1    1  
10    15    PG    1    1    0    0  
10    16    PG    1    0    1    1  
11    14    HC    0    1    0    1  
11    15    HC    0    1    1    0  
11    16    HC    0    0    1    0

NS is the number of the subject (58 different participants).
Trial is the number of the trial (200/participants).
Groupe is the subject's group (they are two groups : PG and HC)
PrReward is dichotomous and tells if the previous trial was a success or not.
PrTransition is dichotomous and tells if the previous trial's transition was common or rare.
Ospan is their appartenance two a group of high IQ or low IQ. Stay is dichotomous and tells if the subject repeated the same choice than during the previous trial. It is my dependent variable.

I need to make a logistic regression to see if the Stay variable is dependent on the group, the Ospan, the PrReward, the PrTransition ; and the interaction between those variables.
So far, using R, I've put this formula :

LRM <- glmer(Stay ~ (1|NS) + (1|Trial) + Groupe*PrReward*PrTransition*Ospan,   
  family = binomial, data = d)

but I'm totally not sure that it is written properly and that I get what I asked for (to be honest, it certainly does not look correct).
Could someone confirm me the good way to write this equation?
Thank you in advance.
Florent

Edit : At the moment, I hesitate between those 3 formulas:

LRM <- glmer(Stay ~ (1+PrReward*PrTransition|NS) + Groupe*PrReward*PrTransition*Ospan,  
   family = binomial, data = d)  
LRM2 <- glmer(Stay ~ (1|NS) + (1|Trial) + Groupe*PrReward*PrTransition*Ospan,   
   family = binomial, data = d)  
LRM3 <- glmer(Stay ~ (1|NS) + Groupe*PrReward*PrTransition*Ospan,  
   family = binomial, data = d)  

I actually don't exactly know if I shoud cross "Trial" with "NS" since all the subject did several trials or if it is already implied in the formula. And I don't exactly know the difference between those 3 models.

$\endgroup$
  • $\begingroup$ Is Trial not important? $\endgroup$ – StatsStudent Jan 10 at 14:58
  • 1
    $\begingroup$ I'm actually not sure. I guess I should add it somewhere. $\endgroup$ – Florent Wyckmans Jan 10 at 15:03
  • 1
    $\begingroup$ You have the most complex model possible in terms of the fixed effects there, with all possible 2-, 3-, and 4-way interactions. You have 4 + 6 + 4 + 1 = 15 total effects. Do you have multiple trials for every combination of factors? Do you really need all of the interactions in there? The model could be hard to interpret. $\endgroup$ – if_the_correlations_are_zero Jan 10 at 17:14
  • 1
    $\begingroup$ You might want to try a simpler model, maybe stopping at 2-way interactions. As @if_the_correlations_are_zero said above, it would be very hard to interpret as is. You could do this with: LRM <- glmer(Stay ~ (1|NS) + (1|Trial) + (Groupe + PrReward + PrTransition + Ospan)^2, family = binomial, data = d) $\endgroup$ – André.B Jan 10 at 20:01
  • $\begingroup$ Thank you all for your answers. I fully realise that this model is hard to interpretate. Sadly, I have to redo the same analysis than another lab (and I cannot contact them to help me with the model) ; and they took each factor with every analysis. As long as I know that it was coded correctly, we are fine with that. About the number of trials, it depends on how the participant responded. We are interested on how probable it is that he takes the same choice than during the previous trial (depending on the transition during the previous trial). $\endgroup$ – Florent Wyckmans Jan 10 at 22:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.