# Permutation test for ROI based conectivity (scout level)

I'm trying to learn how to analyze the ROI connectivity by ciPLV on brainstorm. With the same data from a previous study from a lab member(undergrad student's data), I couldn't get any positive results after multiple comparisons (the previous study was analyzed by elorera software). I wonder what I did wrong during my analysis.
Step after preprocessing(default anatomy was used):
1, the head model was calculated for each subject.
2, Data split into blocks ( one subject with two conditions)
3, Noise covariance was calculated from data.
4, for each block, source was calculated by sloreta( MNI, sloreta. constrained)
5, for each condition's blocks, an average of ciPLV was calculated.( for example:for condition A,`Preformatted text` with 30 blocks, 30 source result was selected and the average connectivity matrix was saved)
6, permutation test follows with statistic threshold.

Q1: Was there any mistake in my step? Or was there a miss chosen option during permutation test?
Q2: For the multiple comparisons, for connectivity permutation test result, what's in signals dims ciPLV matrix result's t-test result? and what about time dims (which dims should I choose for connectivity permutation test since I have a 666 x 1 x 5 matrix [36scouts 5 freq]? All three of them?)
Q3: Should I apply head model to each subject since I used default anatomy?
Q4: Is there any other matlab toolbox for permutation tests that can be used for connectivity matrix?

It does not seems to be anything wrong with the chosen parameters.

The first dimension of the matrix (666) comes from the fact that ciPLV is a symmetric metric, thus only the lower triangle plus the diagonal of the connectivity matrix are saved: (((36 * 36) - 36) / 2) + 36. Then it's the number of time points (1), and the number of frequency points (5). The number of signals that is used for the multiple-comparison correction is only the lower triangle of the connectivity matrix (630). If using Bonferroni correction the three dimensions should be used.

Keep in mind that Bonferroni correction is very conservative leading to a high rate of false negatives. This happens as Bonferroni correction is used with the assumption that all tests are independent, this may not be case as neighbouring Scouts can lead to correlated tests.

Yes, compute the head model for each subject depends on the anatomy and the channel file

In Brainstorm, permutation tests are carried on with the `bst_permtest`. About other toolboxes, there are some in FileExchange, however we have not test them. @Sylvain, any additional suggestion?

Regarding the aggregation of computation of ciPLV (and other connectivity metric) values across trials. For the moment the ciPLV values are averaged across trials. However, this approach is not ideal, as ciPLV should be computed with the data from all trials. In the next weeks will update the connectivity functions to do so. @Marc.Lalancette

Best,
Raymundo

Dear Raymundo