Description Usage Arguments Details Value Author(s) See Also Examples
Compute z-score equivalents of non-normal random deviates.
1 2 3 | zscore(q, distribution, ...)
zscoreGamma(q, shape, rate = 1, scale = 1/rate)
zscoreHyper(q, m, n, k)
|
q |
numeric vector or matrix giving deviates of a random variable |
distribution |
character name of probabability distribution for which a cumulative distribution function exists |
... |
other arguments specify distributional parameters and are passed to the cumulative distribution function |
shape |
gamma shape parameter (>0) |
rate |
gamma rate parameter (>0) |
scale |
gamma scale parameter (>0) |
m |
as for |
n |
as for |
k |
as for |
These functions compute the standard normal deviates which have the same quantiles as the given values in the specified distribution.
For example, if z <- zscoreGamma(x, shape, rate)
then pnorm(z)
equals pgamma(x, shape, rate)
.
zscore
works for any distribution for which a cumulative distribution function (like pnorm
) exists in R.
The argument distribution
is the name of the cumulative distribution function with the "p"
removed.
zscoreGamma
and zscoreHyper
are specific functions for the gamma and hypergeometric distributions respectively.
The transformation to z-scores is done by converting to log tail probabilities, and then using qnorm
.
For numerical accuracy, the left or right tail is used, depending on which is likely to be smaller.
Numeric vector or matrix of equivalent deviates from the standard normal distribution.
Gordon Smyth
zscoreNBinom
in the edgeR package.
qnorm
in the stats package.
1 2 3 4 |
[1] 0.4752328 1.2063240
[1] 0.4752328 1.2063240
[1] 0.4752328 1.2063240
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.