ifisherZ: Fisher's Z transformation

Description Usage Arguments Details Value Examples

View source: R/fisherTransform.R

Description

fisherZ returns the inverse (squeezed) Fisher's Z transformed Pearson's r. This will fail if a matrix is used as input instead of a vector.

Usage

1
ifisherZ(cormat)

Arguments

cormat

vector of Fisher's Z transformed Pearson correlations or an eignevector

Details

This function returns the inverse (squeezed) Fisher's Z transformed Pearson's r

Value

Back transformed Fisher's Z

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#Generate a random binary (-1, 1) matrix
mat <- matrix(sample(c(1,-1), 10000, replace = TRUE), ncol = 100)

#Correct matrix diag
diag(mat) <- 1

#Transform
mat.transform <- fisherZ(mat)

#Back transform
mat.transform.inverse <- apply(mat.transform, 1, ifisherZ)

compartmap documentation built on Nov. 8, 2020, 5:34 p.m.