Generating p-values from datasets

Greetings everyone,

I have a quick question on generating p-values from datasets in AFNI.

I have a 3 3dDatasets. One dataset contains coefficients (X), one contains the mean (Mu), the other contains standard deviation (SD). I would like to get the corresponding p-value (2-tailed) for these values. I’ve modeled my 3dcalc code after SAS commands, where the pvalues would correspond to one half of the distribution as:

[b]2*stat2cdf(X,11,mu,SD,0) [/b]

and the other half is:

[b]2*(1-stat2cdf(X,11,mu,SD,0) [/b]

depending on whether or not X is greater than Mu or not.

My question is, am I using the 3dcalc command correctly here, or am I overcomplicating the cdf command? I would use code 2 , but the coeffecient is not a correlation coeffecient.

Thank you and apologies if I am being confusing!


I think you’re correct. If X > Mu, do this:

2*(1-stat2cdf(X,11,mu,SD,0)) \

else if X < Mu,

2*stat2cdf(X,11,mu,SD,0) \

Awesome! Thanks Dr. Chen!

Out of curiosity, now that I have a dataset of p-values, is there anyway within AFNI to calculate the q-values (i.e., an option in 3dFDR, given the dataset is not technically a non-statistical dataset)?

Thank you once again!


Try this:

  1. use fizt_p2t in 3dcalc to convert the p-values to z-score;

  2. label the sub-brick as z-stat:

3drefit -substatpar ? type fizt YourFile

  1. obtain FDR:

3drefit -addFDR -FDRmask ? YourFile

Brilliant! That works great!

Thanks again!