Skip to content

Commit 7721a73

Browse files
authored
Merge pull request #77 from sccn/edit_readme
Edit readme
2 parents b397fcd + fb71d33 commit 7721a73

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,40 @@ pop_roi_connectplot(EEG, 'measure', 'mim', 'plotcortex', 'on', 'freqrange', [8 1
145145
   
146146
</p>
147147

148+
### Group analysis
149+
150+
The ROIconnect plugin is compatible with EEGLAB STUDY framework. This means that if you have created a STUDY for group analysis, you can select ROIconnect menus to compute connectivity on a group of datasets. Once connectivity has been computed, there are two ways to aggregate results for ROIconnect at the group level. At this stage, both ways involve command line code. The simplest way is to run ROIconnect on all datasets and then gather the matrices and run statistics on them.
151+
152+
Assuming that you have computed connectivity (for example, the multivariate interaction measure) for all datasets and that for each subject, you have a dataset for condition 1 and a dataset for condition 2 (so in sequence, the first dataset is subject 1 condition 1, the second subject 1 condition 2, the third is subject 2 condition 1, etc, you could use the code:
153+
154+
```matlab
155+
% aggregate all subjects for each condition in one matrix
156+
numSubject = length(ALLEEG)/2; % number os subjects
157+
cond1 = zeros( [ size(ALLEEG(1).roi.MIM) numSubject] ); % dimensions are frequency x roi x roi x subject
158+
cond2 = zeros( [ size(ALLEEG(1).roi.MIM) numSubject] );
159+
for iSubj = 1:numSubject
160+
cond1(:,:,:,iSubj) = ALLEEG(((iSubj-1)*2+1)).roi.MIM; % get the MIM (multivariate interaction measure) for all odd datasets
161+
cond2(:,:,:,iSubj) = ALLEEG(((iSubj-1)*2+2)).roi.MIM; % get the MIM (multivariate interaction measure) for all even datasets
162+
end
163+
164+
% compute statistics and plot
165+
[t,df,p] = statcond({ cond1 cond2 }); % parametric here but you can also use permutations
166+
[~,indAlpha] = min(abs(ALLEEG(1).roi.freqs - 10));
167+
tAlpha = squeeze(t(indAlpha,:,:));
168+
pAlpha = squeeze(pFdr(indAlpha,:,:));
169+
figure; subplot(1,2,1); imagesc(tAlpha); title('t-value');
170+
figure; subplot(1,2,2); imagesc(-log10(pAlpha)); title('p-value (0 for p=1; 1 for p=0.1; 2 for p=0.01 ...)');
171+
% or replace matrix MIM in one of the dataset and plot using the ROIconnect menus or command line functions
172+
```
173+
174+
Alternatively, to get ROIconnect data from an arbitrary study design (including 2-way ANOVA), you can use the powerful std_readdata function as outlined in the documentation of the [eegstats plugin](https://github.com/sccn/eegstats).
175+
176+
```matlab
177+
[~,condsMat] = std_readdata(STUDY, ALLEEG, 'customread', 'std_readeegfield', 'customparams', {{ 'roi', 'MIM' }}, 'ndim', 4, 'singletrials', 'on’);
178+
```
179+
180+
Then, proceed to use the compute statistics and plot as above (in this case *condsMat = { cond1 cond2 }*). For more information on how to create a STUDY and STUDY design, refer to the [EEGLAB documentation](https://eeglab.org/tutorials/10_Group_analysis/study_creation.html).
181+
148182
# References
149183
<a id="1">[1]</a>
150184
Pellegrini, F., Delorme, A., Nikulin, V., & Haufe, S. (2023). Identifying good practices for detecting inter-regional linear functional connectivity from EEG. NeuroImage, 120218. [doi: 10.1016/j.neuroimage.2023.120218](https://doi.org/10.1016/j.neuroimage.2023.120218)

0 commit comments

Comments
 (0)