Changeset 163


Ignore:
Timestamp:
May 18, 2011, 11:32:07 AM (8 years ago)
Author:
tjniskan
Message:
  • Minor changes to partial correlation analysis

M misclib/pcorr.m
M plugins/fmri_plugins/network_analysis.m
M aedes_revision.m

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • aedes_revision.m

    r162 r163  
    9393% bash-script every time it is called so that this file "aedes_revision.m" is
    9494% always in the list of committed files. DO NOT EDIT THE NEXT LINE!!!
    95 % - Svn Hook -
     95% - SVN Hook -
  • misclib/pcorr.m

    r162 r163  
    1 function [cc,p] = pcorr(X)
     1function [pc,p,cc] = pcorr(X)
    22% PCORR - Calculate partial correlation coefficients
    33%   
     
    4242
    4343cc = diag(ones(1,size(X,2)));
     44pc = diag(ones(1,size(X,2)));
    4445p = zeros(size(cc));
    4546
     
    5556       
    5657        % Correlation coefficients
    57         cc(X_ind(ii),Y_ind(ii)) = coef;
    58         cc(Y_ind(ii),X_ind(ii)) = cc(X_ind(ii),Y_ind(ii));
     58        C2 = cov(x,y);
     59        C2=C2./(std(x)*std(y));
     60        cc(X_ind(ii),Y_ind(ii)) = C2(2);
     61        cc(Y_ind(ii),X_ind(ii)) = C2(2);
     62       
     63        % Partial correlation coefficients
     64        pc(X_ind(ii),Y_ind(ii)) = coef;
     65        pc(Y_ind(ii),X_ind(ii)) = cc(X_ind(ii),Y_ind(ii));
    5966       
    6067        % P-values
  • plugins/fmri_plugins/network_analysis.m

    r162 r163  
    6868
    6969% Calculate partial correlations
    70 [C,P] = pcorr(X);
     70[PC,P,CC] = pcorr(X);
    7171
    7272% Linear indexes to unique correlations
    73 ind = find(tril(C,-1)~=0).';
     73ind = find(tril(PC,-1)~=0).';
    7474
    7575% Display results
     
    7878fprintf('***********************************\n');
    7979for ii=ind
    80         [I,J] = ind2sub(size(C),ii);
     80        [I,J] = ind2sub(size(PC),ii);
    8181        if P(ii)<=0.01
    82                 fprintf(2,'%s <-> %s (C=%.4f, P=%.4f)**\n',...
    83                         ROI(J).label,ROI(I).label,C(ii),P(ii));
     82                fprintf(2,'%s <-> %s (PCC=%.4f, CC=%.4f, PCC/CC=%.04f, P=%.4f)**\n',...
     83                        ROI(J).label,ROI(I).label,PC(ii),CC(ii),PC(ii)/CC(ii),P(ii));
    8484        elseif P(ii) <= 0.05
    85                 fprintf(2,'%s <-> %s (C=%.4f, P=%.4f)*\n',...
    86                         ROI(J).label,ROI(I).label,C(ii),P(ii));
     85                fprintf(2,'%s <-> %s (PCC=%.4f, CC=%.4f, PCC/CC=%.04f, P=%.4f)*\n',...
     86                        ROI(J).label,ROI(I).label,PC(ii),CC(ii),PC(ii)/CC(ii),P(ii));
    8787        else
    88                 fprintf(1,'%s <-> %s (C=%.4f, P=%.4f)\n',...
    89                         ROI(J).label,ROI(I).label,C(ii),P(ii));
     88                fprintf(1,'%s <-> %s (PCC=%.4f, CC=%.4f, PCC/CC=%.04f, P=%.4f)\n',...
     89                        ROI(J).label,ROI(I).label,PC(ii),CC(ii),PC(ii)/CC(ii),P(ii));
    9090        end
    9191end
Note: See TracChangeset for help on using the changeset viewer.

Powered by Trac 1.0.9.Copyright © Juha-Pekka Niskanen 2008