Description Usage Arguments Details Value Author(s) See Also Examples
Compute z-score equivalents of non-normal random deviates.
1 2 3 4 5 | zscore(q, distribution, ...)
zscoreGamma(q, shape, rate = 1, scale = 1/rate)
zscoreT(x, df)
tZscore(x, df)
zscoreHyper(q, m, n, k)
|
q, x |
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 |
shape |
gamma shape parameter (>0) |
rate |
gamma rate parameter (>0) |
scale |
gamma scale parameter (>0) |
df |
degrees of freedom (>0 for |
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 <- zscoreT(x,df=df)
then pnorm(z)
equals pt(x,df=df)
.
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
, zscoreT
and zscoreHyper
are specific functions for the gamma, t and hypergeometric distributions respectively.
tZscore
is the inverse of zscoreT
, and computes t-distribution equivalents for standard normal deviates.
Care is taken to do the computations accurately in both tails of the distributions.
Numeric vector giving equivalent deviates from the standard normal distribution.
The exception is tZscore
which gives deviates from the specified t-distribution.
Gordon Smyth
qnorm
, pgamma
, pt
in the stats package.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.