z2p: Transforms z-values to p-values

Description Usage Arguments Value See Also Examples

View source: R/z2p.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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")

ReplicationSuccess documentation built on Dec. 2, 2020, 3 p.m.