Learn R Programming

GGMridge (version 1.4)

transFisher: Fisher's Z-Transformation

Description

Fisher's Z-transformation of (partial) correlation.

Usage

transFisher(x)

Value

Fisher's Z-transformed values.

Arguments

x

A vector having entries between -1 and 1.

Author

Min Jin Ha

Examples

Run this code
 ###############################
 # Simulate data
 ###############################
 simulation <- simulateData(G = 100, etaA = 0.02, n = 50, r = 1)
 dat <- simulation$data[[1L]]
 stddat <- scale(x = dat, center = TRUE, scale = TRUE)

 shrinkage.lambda <- lambda.TargetD(x = stddat)

 ###############################
 # the ridge parameter
 ###############################
 ridge.lambda <- shrinkage.lambda / (1.0 - shrinkage.lambda)

 ###############################
 # partial correlation matrix
 ###############################
 partial <- solve(cor(dat) + ridge.lambda * diag(ncol(dat)))
 partial <- -scaledMat(x = partial)

 ###############################
 # Fisher's Z transformation of 
 # upper diagonal of the partial 
 # correlation matrix
 ###############################
 w.upper <- which(upper.tri(diag(nrow(dat))))
 psi <- transFisher(x = partial[w.upper])
 

Run the code above in your browser using DataLab