Hi AFNI gods,
We're trying to shamelessly rip off AFNI code for Caret purposes. We want to convert t-stats and DOFs (unpooled, s1!=s2) to p-values, so we can develop a surface-based 3dFDR-like functionality. We tried using this code from mri_stats.c:
double student_t2p( double tt , double dof )
{
double bb , xx , pp ;
if( tt <= 0.0 || dof < 1.0 ) return 1.0 ;
bb = lnbeta( 0.5*dof , 0.5 ) ;
xx = dof/(dof + tt*tt) ;
pp = incbeta( xx , 0.5*dof , 0.5 , bb ) ;
return pp ;
}
But I see now that it returns 1 if t<0, so I'm guessing it's taking advantage of the symmetry. My question is then if we abs value negative t's before inputting to this routine, will we need to divide the resulting p by two if we want a two-tailed test? I'll probably have a "D'oh" moment of clarity later, but if anyone is still at work today and knows, I'll be grateful.
I tried this with my "1D" data files, but evidently I need at least one real volume:
3dcalc -a tstat_asdvcon_young_left.1D -b dof_asdvcon_young_left.1D -expr 'fitt_t2p(a,b)'
Donna Hanlon
Van Essen Lab