Changeset 163 for misclib/pcorr.m
 Timestamp:
 May 18, 2011, 11:32:07 AM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

misclib/pcorr.m
r162 r163 1 function [ cc,p] = pcorr(X)1 function [pc,p,cc] = pcorr(X) 2 2 % PCORR  Calculate partial correlation coefficients 3 3 % … … 42 42 43 43 cc = diag(ones(1,size(X,2))); 44 pc = diag(ones(1,size(X,2))); 44 45 p = zeros(size(cc)); 45 46 … … 55 56 56 57 % 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)); 59 66 60 67 % Pvalues
Note: See TracChangeset
for help on using the changeset viewer.