MATLAB: Matlab function that can calculate pvalues from z-scores rho-values in a connectivity matrix

correlationpvaluesrhozscores

I am performing connectivity analyses and my output for each subject is a very big matrix (44×44) with rho values that I transformed in z scores. I then averaged these together among all my subjects. I work with Matlab and I would like to calculate the pvalue from the rho z-scores I have in each of the 1936 cells. I know that there are calculators of pvalues from rho-values available online, but of course I can't do it manually for each of my cell, so I am looking for a Matlab function that can help me doing that in my whole big matrix. Does anyone know anything about this? I haven't been able to find anything except for the classical 'corrcoef' function, but this is not helpful, my correlations have been already performed! Any suggestion is really appreciated! Thanks, Chiara

Best Answer

Your z-scores imply that you are assuming your data are normally distributed.
Use the Statistics and Machine Learning Toolbox normcdf (link) function to calculate the probabilities.
You can also calculate it from the erfc function with:
P = @(z) erfc(-z/sqrt(2))/2; % Equivalent to ‘normcdf’
Related Question