DescTools (version 0.99.8.1)

FisherZ: Fisher r to z and z to r and confidence intervals

Description

Convert a correlation to a z score or z to r using the Fisher transformation or find the confidence intervals for a specified correlation.

Usage

FisherZ(rho)
FisherZInv(z)
CorCI(rho, n, conf.level = 0.95, twotailed = TRUE)

Arguments

rho
a Pearson r
z
A Fisher z
n
Sample size for confidence intervals
conf.level
Confidence interval
twotailed
Treat p as twotailed p

Value

  • z value corresponding to r (FisherZ) \ r corresponding to z (FisherZInv) \ rho, lower and upper confidence intervals (CorCI) \

Examples

Run this code
cors <- seq(-.9,.9,.1)

zs <- FisherZ(cors)
rs <- FisherZInv(zs)
round(zs, 2)
n <- 30
r <- seq(0,.9,.1)
rc <- t(sapply(r, CorCI, n=n))
t <- r*sqrt(n-2)/sqrt(1-r^2)
p <- (1-pt(t,n-2))/2

r.rc <- data.frame(r=r, z=FisherZ(r), lower=rc[,2], upper=rc[,3], t=t, p=p)

round(r.rc,2)

Run the code above in your browser using DataLab