(1) Research background:
My research design involves having each participant complete multiple trials to assess their happiness rating while simultaneously recording EEG data. Each participant has different EEG channels. I aim to use EEG data metrics (such as avg_HFB and peri_HFB) from each channel to predict happiness ratings. Since participants underwent repeated measurements at different times, I constructed a linear mixed model with subject and channel as random variables. Channels are nested within subjects, and happiness rating (zrating) is the dependent variable, as follows:
zrating ~ avg_HFB * peri_HFB + (1|subject/channels)
(2) Problem Encountered:
However, during fitting, I encountered a singular fit issue where the variance of subject:channels was equal to 0.
(3) Sample Data:
Here is data structure and some example data:
There are about 15 participants, each with 1-8 channels, and 30-140 trials.
(4) Attempts I have Made:
- In the linear mixed model, if the random factor includes only subject or channels, the model can be fitted successfully.
- By duplicating the data for a few participants (approximately 600 observations), the nested model could be fitted.
(5) My guess:
For a given subject, the channels simutaneously recorded the EEG data while subjects are doing happyratings, which means that all channels of a subject correspond to the same set of dependent variable data (the happyrating data). Therefore, I assume that the variation in the dependent variable is only reflected between participants. Within the same participant, there might be no variation between channels (although the number of trials and specific trials may vary). If so, having either subject or channel as a random factor should be sufficient to capture this variability. Thus, I speculate that the reason for having only subject variance when both subject and channel are treated as random factors might be due to this.
The distribution of zratings across various channels for a given subject:
However, this is only my logical or intuitive speculation. I'm unsure if this reasoning is right, and it cannot explain why replicating the data allows the model to fit (as the data structure should remain unchanged). And another question is that, similar models in other literature are exactly specified as (1|subject/channels)
, I don't know how they can make it...
This is the first time that I ask a question on this platform, so if any further information is required, please let me know.
Thanks!
Thanks to BenP's suggestion, I tested the variation across channels in all subjects, and the result is as follows:
(There are 12 subjects instead of 13 since one of them has only one channel.)
The p value of subject2 is less than 0.05, so I checked the data:
It seems that it's because one of his channels contains different specific trials.