z2p {ReplicationSuccess}R Documentation

Transforms z-values to p-values

Description

Transforms z-values to the corresponding one- or two-sided p-values.

Usage

z2p(z, alternative = "two.sided")

Arguments

z

a vector of z-values

alternative

Specifies direction of the alternative of p-value. Either "less", "greater", "one.sided", "two.sided". Defaults to "two.sided".

Value

A numeric vector of p-values

See Also

p2z

Examples

z2p(z = c(1, 2, 5))
z2p(z = c(1, 2, 5), alternative = "less")
z2p(z = c(1, 2, 5), alternative = "greater")

z <- seq(-3, 3, by = 0.01)
plot(z, z2p(z), type = "l", 
      xlab = "z", ylab = "p", 
      ylim = c(0, 1))
lines(z, z2p(z, alternative = "greater"), lty = 2)
legend("topright", c("two-sided", "greater"), lty = c(1, 2), bty = "n")

[Package ReplicationSuccess version 0.1-3 Index]