[Eeglablist] Source roi package - group average

Arnaud Delorme adelorme at ucsd.edu
Thu Mar 21 18:12:26 PDT 2024


Hi Montana,

There are two ways to aggregate results for ROIconnect at the group level. The simplest way is to run ROIconnect on all datasets and then gather the matrices and run stats on them. 

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 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 (not tested)

% agregate all subject for each condition in one matrix
numSubject = length(ALLEEG)/2; % number os subjects
cond1 = zeros( [ size(ALLEEG(1).roi.MIM) numSubject] ); % dimensions are frequency x roi x roi x subject
cond2 = zeros( [ size(ALLEEG(1).roi.MIM) numSubject] );
for iSubj = 1:numSubject
	cond1(:,:,:,iSubj) = ALLEEG(((iSubj-1)*2+1)).roi.MIM; % get the MIM (multivariate interaction measure) for all odd datasets 
	cond2(:,:,:,iSubj) = ALLEEG(((iSubj-1)*2+2)).roi.MIM; % get the MIM (multivariate interaction measure) for all even datasets 
end

% compute statistics and plot
[t,df,p] = statcond({ cond1 cond2 }); % parametric here but you can also use permutations
[~,indAlpha] = min(abs(ALLEEG(1).roi.freqs - 10));
tAlpha = squeeze(t(indAlpha,:,:));
pAlpha = squeeze(pFdr(indAlpha,:,:));
figure; subplot(1,2,1); imagesc(tAlpha); title('t-value');
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 ...)');
% or replace matrix MIM in one of the dataset and plot using the ROIconnect menus or command line functions

Alternatively to read the 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://urldefense.com/v3/__https://github.com/sccn/eegstats__;!!Mih3wA!D1BRON-1U5hQ0VM7-LWl2Tu1iN1jMVG6TV2ST51HZBhGxl6ivTOxr5UodF8sVPg5FmdHbOxHFr38IT8LT7ZDSDhQ$ 

[~,condsMat] = std_readdata(STUDY, ALLEEG, 'customread', 'std_readeegfield', 'customparams', {{ 'roi', 'MIM' }}, 'ndim', 4, 'singletrials', 'on’);

Then proceed to use the  compute statistics and plot as above (in this case condsMat = { cond1 cond2 })

Arno

> On Mar 21, 2024, at 10:51 AM, Hunter, Montana R. (Dr.) via eeglablist <eeglablist at sccn.ucsd.edu> wrote:
> 
> Hi
> 
> I have an EEGlab question regarding the source roi package. We have calculated connectivity using the source roi package and would like to use the plotting function to visualise the group average. However I am having trouble doing this. I have created a STUDY with the EEG files, but the option for "plot ROI connectivity" is not showing up in the GUI. I have also tried to run the function pop_roi_connectplot but it does not work because the EEG structure now has multiple files within it. Can you please advise on the best way to run pop_roi_connectplot on group data rather than single participants?
> 
> Kind regards,
> Montana
> 
> Dr Montana Hunter PhD, BPsych(Hons)
> Early Career Fellow
> School of Psychology and Vision Sciences
> University of Leicester, University Road, Leicester, LE1 7RH, UK
> 
> e:  mrh45 at leicester.ac.uk<mailto:mrh45 at leicester.ac.uk>
> w: https://urldefense.com/v3/__http://www.le.ac.uk__;!!Mih3wA!DDK3tYhrL2RgFZpl0lT_AuRI5c0IHLCr6yXjHW8A9iOZAh2hcaMndAo1plSyMt_-S7fj_MP9p1UcNQYDCZ-_aKThdg$ 
> <https://urldefense.com/v3/__https://www.le.ac.uk/__;!!Mih3wA!DDK3tYhrL2RgFZpl0lT_AuRI5c0IHLCr6yXjHW8A9iOZAh2hcaMndAo1plSyMt_-S7fj_MP9p1UcNQYDCZ8O_SV9Ug$ >
> Follow us on Twitter<https://urldefense.com/v3/__https://twitter.com/uniofleicester__;!!Mih3wA!DDK3tYhrL2RgFZpl0lT_AuRI5c0IHLCr6yXjHW8A9iOZAh2hcaMndAo1plSyMt_-S7fj_MP9p1UcNQYDCZ-TMujOQg$ > or visit our Facebook<https://urldefense.com/v3/__https://www.facebook.com/uniofleicester__;!!Mih3wA!DDK3tYhrL2RgFZpl0lT_AuRI5c0IHLCr6yXjHW8A9iOZAh2hcaMndAo1plSyMt_-S7fj_MP9p1UcNQYDCZ_uI2MSww$ > page
> 
> [EMSig-450x60px-CofC300 (002)]
> 
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu



More information about the eeglablist mailing list