Skip to content

Function: pToZ()

ts
function pToZ(p): number;

Defined in: src/utils/statistics.ts:278

Converts a two-tailed p-value to a z-score.

Uses the Abramowitz & Stegun rational approximation for the inverse normal CDF (also known as the probit function).

For a two-tailed test: z = inverseNormalCDF(1 - p/2)

Time complexity: O(1)

Parameters

p

number

Two-tailed p-value in (0, 1)

Returns

number

Z-score (positive for small p-values)

Throws

If p is not in (0, 1)

Released under the MIT License.