Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

zscoreT

Transform t-statistics to standard normal


Description

Compute z-score equivalents of t-distributed random deviates.

Usage

zscoreT(x, df, approx=FALSE, method = "bailey")
tZscore(z, df)

Arguments

x

numeric vector or matrix of values from a t-distribution.

df

degrees of freedom (>0) of the t-distribution.

approx

logical. If TRUE then a fast approximation is used otherwise exact z-scores are computed.

method

character string specifying transformation to be used when approx=TRUE, options being "bailey", "hill" or "wallace".

z

numeric vector or matrix of values from the standard normal distribution.

Details

zscoreT transforms t-distributed values to standard normal. Each value is converted to the equivalent quantile of the normal distribution so that if z <- zscoreT(x, df=df) then pnorm(z) equals pt(x, df=df).

tZscore is the inverse of zscoreT and computes t-distribution equivalents of standard normal deviates.

If approx=FALSE, the transformation is done by converting to log tail probabilities using pt or pnorm and then converting back to quantiles using qnorm or qt. For numerical accuracy, the smaller of the two tail probabilities is used for each deviate.

If approx=TRUE, then an approximate closed-form transformation is used to convert t-statistics to z-scores directly without computing tail probabilities. The method argument provides a choice of three transformations. method="bailey" is equation (5) of Bailey (1980) or equation (7) of Brophy (1987). method="hill" is from Hill (1970) as given by equation (5) of Brophy (1987). method="wallace" is from Wallace (1959) as given by equation equation (2) of Brophy (1987). Bailey's transformation is a modification of Wallace's approximation. The Hill approximation is generally the most accurate for df > 2 but is poor for df < 1. Bailey's approximation is faster than Hill's and gives acceptable two-figure accuracy throughout. Bailey's approximation also works for some extreme values, with very large x or df, for which Hill's approximation fails due to overflow.

Value

Numeric vector or matrix of z-scores or t-distribution deviates.

Note

The default approximation used when approx=TRUE was changed from Hill to Bailey in limma version 3.41.13.

Author(s)

Gordon Smyth

References

Bailey, B. J. R. (1980). Accurate normalizing transformations of a Student's t variate. Journal of the Royal Statistical Society: Series C (Applied Statistics) 29(3), 304–306.

Hill, GW (1970). Algorithm 395: Student's t-distribution. Communications of the ACM 13, 617–620.

Brophy, AL (1987). Efficient estimation of probabilities in the t distribution. Behavior Research Methods 19, 462–466.

Wallace, D. L. (1959). Bounds on normal approximations to Student's and the chi-square distributions. The Annals of Mathematical Statistics, 30(4), 1121–1130.

See Also

zscoreNBinom in the edgeR package.

Examples

zscoreT(4, df=3)
zscoreT(4, df=3, approx=TRUE)
zscoreT(4, df=Inf)
tZscore(2.2, df=3)

limma

Linear Models for Microarray Data

v3.46.0
GPL (>=2)
Authors
Gordon Smyth [cre,aut], Yifang Hu [ctb], Matthew Ritchie [ctb], Jeremy Silver [ctb], James Wettenhall [ctb], Davis McCarthy [ctb], Di Wu [ctb], Wei Shi [ctb], Belinda Phipson [ctb], Aaron Lun [ctb], Natalie Thorne [ctb], Alicia Oshlack [ctb], Carolyn de Graaf [ctb], Yunshun Chen [ctb], Mette Langaas [ctb], Egil Ferkingstad [ctb], Marcus Davy [ctb], Francois Pepin [ctb], Dongseok Choi [ctb]
Initial release
2020-10-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.