Cluster-test permutation with mixed model

  • MNE version 1.3.1 using PyCharm 2023.3.2.
  • operating system: e.g. macOS Sonoma 14.1.1.

Hello,

I would like to perform ANOVA cluster-test permutation to identify the electrodes of interest on which to continue my analyses. To contextualize, I have data from participants who took part in a study with a mixed design: 1 within-subjects factor (Time in my script) (pre- or post-intervention) and 1 between-subjects factor (Group) (active or placebo).

Nevertheless, when I run my code, I suspect that I can only perform an ANOVA with within-subjects factors. Python does indeed create a list with my data, which it then uses to run the ANOVA, but this list contains a lot of zeros. I think Python searches for data for all conditions and all groups as if it was a within-subject design only, but since some conditions don’t exist for some subjects, it creates false data (the lot of zeros).

Is this because MNE doesn’t support these mixed designs?

Here I create my list with all my data for my subject :

for ri, r in enumerate(config.Group):
    for di, d in enumerate(config.Time):

        if ri == 0 and di == 0:
            cidx = 0
        else:
            cidx = cidx + 1

        for si, sid in enumerate(sid_list):

            try:
                print(f'Processing: {sid}')
                evo_in = f'{config.evo_dir}{sid}_1s_{config.Group[ri]}_{config.Time[di]}-ave.fif'
                tmp = mne.read_evokeds(evo_in)[0].apply_baseline(baseline=bsln)
                tmp.comment = f'{sid} {cnames[cidx]}'

                data[cidx][si] = np.transpose(tmp.data)

            except:
                print(KeyError)
                print(f'Missing: {evo_in} ')

        n = n + tmp.nave

In my sid_list I have all my participants.

Thank you for your help,
Ondine