Skip to content

Function: pToZ() ​

ts
function pToZ(p): number;

Defined in: utils/statistics.ts:445

Converts a two-tailed p-value to the non-negative equivalent z magnitude.

The estimand is -Phi^-1(p / 2), where Phi is the standard-normal CDF. p = 0 is capped at 38 rather than returning infinity; p = 1 maps to 0.

Parameters ​

p ​

number

Two-tailed p-value in [0, 1]

Returns ​

number

Non-negative z-score magnitude

Throws ​

If p is non-finite or outside [0, 1]

Released under the MIT License.