Learn R Programming

gCMAP (version 1.16.0)

zScores: 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

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

See Also

qnorm