%% ROI Analysis % Isolate data for region of interest % Derive network visualisations & perform DR for isolated data % Select just data within overall spectrum: all_coherence_overall = all_coherence(:,143:end); % Can select any anatomic / frequency criteria for selecting data g1_coherence_overall = all_coherence_overall(group1,:); g2_coherence_overall = all_coherence_overall(group2,:); % Perform analyses as above using isolated data: % Get covariances matrices for all & groups: g1_cov_overall = cov(g1_coherence_overall); % Group 1 coherence - for visualisation g2_cov_overall = cov(g2_coherence_overall); % Group 2 coherence - for visualisation all_pca_overall = pca(all_coherence_overall'); % Get PCA coefficients for all subjects g1_pca_overall = all_pca_overall(group1,:); % Isolate group 1 g2_pca_overall = all_pca_overall(group2,:); % Isolate group 2 % Compare networks based on first principal component: p = ranksum(g1_pca_overall(:,1), g2_pca_overall(:,1)); % Compare first principal components disp(['Group 1 vs. Group 2, Overall Spectrum Only: P = ' num2str(p) ', Wilcoxon rank sum test']);