# How to convert t-statistic to correlation coefficient or the other way around?

In a linear regression model, the conversion between *t*-statistic and partial *R*^{2} can be obtained through

*R*^{2} = *t*^{2} / (*t*^{2} + *DF*),

where *DF* is number of the degrees of freedom for the *t*-statistic. Taking the square root of *R*^{2}, and assigning the sign of *t*, one gets the correlation coefficient:

3dcalc -a T-stat -expr '(ispositive(a)-isnegative(a))*sqrt(a*a/(a*a+DF))' -prefix corr

The other direction is similar:

*t*^{2} = *DF**R^{2} / (1 - *R*^{2})

Taking the square root of *t*^{2}, and assigning the sign of *R*, one has the *t*-statistic value.

(not specified)

Last modified 2016-02-01 13:23

Last modified 2016-02-01 13:23