Matlab function that can calculate pvalues from z-scores rho-values in a connectivity matrix
    17 views (last 30 days)
  
       Show older comments
    
    Chiara Bulgarelli
 on 17 Jul 2017
  
    
    
    
    
    Commented: turquoise_squid
 on 6 Jul 2018
            I am performing connectivity analyses and my output for each subject is a very big matrix (44x44) 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
1 Comment
  turquoise_squid
 on 6 Jul 2018
				Dear Chiara, did you find an answer for you question? I can replicate the same finding that you had with the diagonals having the value 0.8413 instead of the expected p-value of 0 in the p-value matrix. Any help on this would be greatly appreciated.
Accepted Answer
  Star Strider
      
      
 on 17 Jul 2017
        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’
8 Comments
  Star Strider
      
      
 on 19 Jul 2017
				My pleasure.
The Fisher’s z-score is the correct statistic to use.
The matrix diagonal I was referring to are in the ‘P’ matrices returned by corr and corrcoef. Those should be zero, but are actually calculated correctly as 1. So if yours are also 1, the calculation is correct, although the interpretation implies that they should be 0.
You need to calculate the p-value individually for every element in your z matrix. The normcdf function will accept matrix arguments, and do this automatically.
I do not understand the p-value of 0.8413, or what the problem is with it. The normcdf function (without other arguments) assumes a mean of 0 and a standard deviation of 1, so your z-scores should work.
More Answers (0)
See Also
Categories
				Find more on Descriptive Statistics in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

