# How to use cluster permutation on eeg data? Question about seed, stat_fun,and others

• MNE version: 1.6.1_0
• operating system: macOS(M3)

I have some questions about the usage of permutation_cluster_test.

I am working on EEG source space connectivity data from MATLAB. I have two condition data from 38 subjects; data were in the shape of 38sub4Freq528, of which 528 is the connectivity value from the ROI pairs.

Here’s my code:

``````data_condition1 = file['A'][:]
data_condition2 = file['B'][:]

# Data  shape to ( n_subjects,frequency,ROIs)
condition_A = data_condition1.transpose(2,1,0)
condition_B = data_condition2.transpose(2,1,0)```
rng = Generator(PCG64())
tfc_adjacency = combine_adjacency(condition_A.shape[1]*condition_A.shape[2])
#TFCE
threshold_tfce = dict(start=0, step=0.01)

F_obs, clusters, cluster_p_values, H0 = permutation_cluster_test([condition_A, condition_B],
out_type='mask',
n_permutations=2000,
tail=0,
threshold=threshold_tfce,
adjacency=tfc_adjacency,
seed=rng,
check_disjoint=True)

``````

Here’s my question:

1,Before trying cluster permutation, I only used normal non-parametric permutation and FDR correction on ROI-based connectivity data. I checked some papers but could not decide which method should be used for multible correction.

2,From the usage page, it said that:
Note that the last dimension of each element of X should correspond to the dimension represented in the adjacency parameter (e.g., spectral data should be provided as (observations, frequencies, and channels/vertices)).
In this case, should last dimension be ROI pairs (528; that is,. DLPFC L × PCC R connectivity value) or not?

3,About “seed” input, it says that “To achieve reproducible results, pass a value here to explicitly initialize the RNG with a defined state.”
How should I decide the value that I need to pass to ‘seed’ inorder to achieve reproducible results?

4,https://mne.tools/stable/auto_tutorials/stats-sensor-space/10_background_stats.html
On this page, I have attempted TFCE. Is there an ideal starter and step value for the TFCE?

5, About within-subjects data, since my data are paired data that each subject practiced in both conditions. Which stat_fun function should I use in the permutation_cluster_test? I understand that the default is F_oneway, in which samples need to be :
The samples are independent

Each sample is from a normally distributed population

The population standard deviations of the groups are all equal. This property is known as homoscedasticity.

Should I use Kruskal-Wallis H-test (scipy.stats.kruskal()) or ttest_rel() from scipy, or other stat function?

6,Since I want to see the result of condtion A substract condition B , Should I use permutation_cluster_1samp_test which I substract A-B. Or should I use permutation_cluster. Futher more since my data is ROI connectivity , should I use spatio permutation cluster instead?

Best regards,
Felix