zsc {dotgen} | R Documentation |
Calculate Z-scores from P-values and estimated effects
Description
zsc()
recovers Z-scores from P-values and corresponding effect directions
(or beta coefficients) reported by a genetic association analysis.
Usage
zsc(P, BETA)
Arguments
P |
vector of P-values. |
BETA |
vector of effect directions or beta coefficients. |
Details
For any genetic variant, its two-sided P-value (p
) and the sign of
estimated effect (\beta
) is used to recover the Z-score (z
), that
is, z = sign(\beta) \Phi^{-1}(p/2)
.
Value
A vector of Z-scores.
See Also
Examples
## result of per-variant analysis (P-values and estimated effects)
res <- readRDS(system.file("extdata", 'rs208294_res.rds', package="dotgen"))
## recover Z-score statistics
stt <- with(res, zsc(P, BETA))
## checking
stopifnot(all.equal(pnorm(abs(stt), lower.tail = FALSE) * 2, res$P))
[Package dotgen version 0.1.0 Index]