Dear MNE users,
I have a question on cluster-based permutation testing. I have a dataset with 31 participants, each participant performed two tasks and I want to compare the theta power time course between these two tasks at the source level. I used the function source_band_induced_power() to extract the time courses of theta from the whole brain sources.
Now, I want to compare the two tasks. According to this tutorial (Permutation t-test on source data with spatio-temporal clustering โ MNE 0.22.0 documentation) I should compute the difference between the two conditions, and then perform a cluster-based permutation. I tried to follow this pipeline and the code runs.
However, I wonder whether this is actually comparing the two conditions in the way I am interested in. Namely, given that the input matrix X is n_subj * n_timepoints * n_vert, I think the function permutes across time and space.
What I would want to achieve is for each permutation to randomly swap the condition to which the time*space matrix is assigned, without affecting the dependency between time and space. I think this would be a more fair test for the differences between my two tasks.
I am not being able to implement this approach. I think I should use a stat_fun within the permutation_cluster_test analogous to scipy.stats.ttest_rel, but I am not sure how to do this and if it makes sense.
Thanks in advance for any help!
Best,
Silvia