I have an EEG dataset where I have several subjects in multiple sleep stages (~10 subjects, 5 stages). I want to see which of a number of EEG-derived metrics (measured in each subject in each sleep stage) can predict what sleep stage a subject is in. I then want to be able to compare models to see which metrics are best. For this, I was planning on doing a multinomial mixed-effects logistic regression, with random intercepts by subject (since the EEG metrics will be correlated), the different EEG metrics as fixed effects, and the different sleep stages as a categorical outcome variable.

The mlogit package in R seems to be able to do multinomial mixed-effects logistic regression, but it's framed in the language of choice-modelling, which I don't have experience with. My question is: how do I translate my problem into language mlogit understands? Specifically, how do I classify the EEG metrics? They're not subject-specific variables really (since they vary between sleep stages in the same subject), but nor are they alternative specific variables, unless I misunderstand something.

I'm also open to using other packages besides mlogit, or even other programming languages (MATLAB or Python should be fine), so if anyone has other suggestions for how to do this, they are welcome. However, I've tried the brms package and it doesn't seem to work well with my data (the sampler throws all kinds of warnings, none of the commonly suggested fixes work, and I don't have enough experience with Bayesian methods to diagnose the problem).

EDIT: Looking more into it, I'm not sure it's possible to do this in mlogit - I think my EEG metrics would be individual-specific variables, but it doesn't seem possible to include subject-specific random intercepts in mlogit since I don't have any alternative-specific variables (see discussion here). Any other suggestions for how to do this in mlogit or any other package are still very much welcome!


1 Answer 1


I don't believe you can easily do this with the mlogit package. MCMCglmm supports both random effects and the multinomial distribution, but you'd have to be willing to go bayesian.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.