Changeset 163 for misclib


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.

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