필터 지우기
필터 지우기

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

조회 수: 23 (최근 30일)
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
turquoise_squid
turquoise_squid 2018년 7월 6일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2017년 7월 17일
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
Chiara Bulgarelli
Chiara Bulgarelli 2017년 7월 19일
Thanks again for your reply. I am afraid that I am doing something wrong somewhere, I just don't get where. In my Fisher z-scores transformed matrix, the diagonal is composed by 1 and not by 0 , as you suggested. Also, if I am using the normcdf function, the p value of the diagonal is 0.8413. This is not correct, right? I have read about an inverse Fisher transformation, but it is not clear the formula to apply it.
Star Strider
Star Strider 2017년 7월 19일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by