Skip to content

Function: tToZ() ​

ts
function tToZ(t, df): number;

Defined in: utils/statistics.ts:472

Converts a signed Student-t statistic to its equivalent standard-normal z.

The transformation preserves the signed cumulative probability: z = Phi^-1(F_t(t; df)). Equivalently, it computes the exact two-tailed Student-t probability with the regularized incomplete beta function and applies the sign of t to the corresponding normal z magnitude.

The incomplete-beta continued fraction is evaluated to about 3e-14 relative convergence. Normal quantiles use a rational approximation with about 1e-9 absolute error. If the two-tailed probability underflows to zero, the finite result is capped at +/-38, matching pToZ(0).

Parameters ​

t ​

number

Finite Student-t statistic

df ​

number

Finite positive degrees of freedom; non-integers are supported

Returns ​

number

Signed equivalent z-score

Throws ​

If t is non-finite or df is non-finite/non-positive

Released under the MIT License.