Function to calculate z-scores from p-values

Description

Function to calculate z-score from a normal distribution from a two-tailed p-value and sign vector (e.g. log2 fold change). To avoid -Inf/Inf z-scores, p-values < 'limit' are set to 'limit'.

Usage

1
zScores(pval, direction=NULL, tails=2, limit=.Machine$double.xmin)

Arguments

pval

Vector with p-values

direction

Vector that will be used to determine the sign of the z-scores. Only the sign of the values is considered, so any suitable vectors (e.g. log2 fold change) can be supplied.

limit

Numeric (default: .Machine$double.xmin). pvalues < 'limit' will be set to 'limit' to avoid Inf/-Inf z-scores. Set to NULL to disable.

tails

Numeric, either 1 for p-values from one-tailed or 2 for p-values from two-tailed tests.

Value

A vector of z-scores

Author(s)

Thomas Sandmann

See Also

qnorm

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.