p2z: Transforms p-values to z-values

Description Usage Arguments Value See Also Examples

View source: R/p2z.R

Description

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

Usage

1
p2z(p, alternative = "two.sided")

Arguments

p

a vector of p-values

alternative

Specifies direction of the alternative of the p-value. Either "less", "greater", "one.sided", or "two.sided". Defaults to "two.sided". If "one.sided" or "two.sided", it is assumed that the z-value is positive.

Value

A numeric vector of z-values

See Also

z2p

Examples

1
2
3
4
5
6
7
8
9
p2z(p = c(0.005, 0.01, 0.05))
p2z(p = c(0.005, 0.01, 0.05), alternative = "greater")
p2z(p = c(0.005, 0.01, 0.05), alternative = "less")

p <- seq(0.001, 0.05, 0.0001)
plot(p, p2z(p), type = "l", ylim = c(0, 3.5), 
ylab = "z")
lines(p, p2z(p, alternative = "greater"), lty = 2)
legend("bottomleft", c("two-sided", "greater"), lty = c(1, 2), bty = "n")

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