Hi Sandy,
I understand that you want to know, what the different dimensions used in 4D connectivity analysis matrices represent, and how we can compute the p-value for comparison using a t-test.
In the context of EEG data, a connectivity matrix represents the functional connectivity between different brain regions or electrodes. Each dimension of the 4D connectivity matrix has a specific meaning:
- Dimension 1: Represents the source region or electrode from which the connectivity is measured.
- Dimension 2: Represents the target region or electrode to which the connectivity is measured.
- Dimension 3: Represents the frequency or frequency band at which the connectivity is measured.
- Dimension 4: Represents the trial or sample number
Since you want to compare the connectivity matrices across all dimensions, you can reshape the matrices into 2D arrays before performing the t-test and compare connectivity across all trials (4th dimension).
DTF_trial1_2D = reshape(DTF_trial1, [], size(DTF_trial1, 4));
DTF_trial2_2D = reshape(DTF_trial2, [], size(DTF_trial2, 4));
[H, P] = ttest2(DTF_trial1_2D, DTF_trial2_2D);
Please refer to the following documentation for more information on the functions used in the code above.
Hope this helps.