z.transform: Variance-Stabilizing Transformations of the Correlation...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/z.transform.R

Description

z.transform implements Fisher's (1921) first-order and Hotelling's (1953) second-order transformations to stabilize the distribution of the correlation coefficient. After the transformation the data follows approximately a normal distribution with constant variance (i.e. independent of the mean).

The Fisher transformation is simply z.transform(r) = atanh(r).

Hotelling's transformation requires the specification of the degree of freedom kappa of the underlying distribution. This depends on the sample size n used to compute the sample correlation and whether simple ot partial correlation coefficients are considered. If there are p variables, with p-2 variables eliminated, the degree of freedom is kappa=n-p+1. (cf. also dcor0).

Usage

1
2

Arguments

r

vector of sample correlations

kappa

degrees of freedom of the distribution of the correlation coefficient

Value

The vector of transformed sample correlation coefficients.

Author(s)

Korbinian Strimmer (https://strimmerlab.github.io).

References

Fisher, R.A. (1921). On the 'probable error' of a coefficient of correlation deduced from a small sample. Metron, 1, 1–32.

Hotelling, H. (1953). New light on the correlation coefficient and its transformation. J. Roy. Statist. Soc. B, 15, 193–232.

See Also

dcor0, kappa2n.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# load GeneNet library
library("GeneNet")

# small example data set 
r <- c(-0.26074194, 0.47251437, 0.23957283,-0.02187209,-0.07699437,
       -0.03809433,-0.06010493, 0.01334491,-0.42383367,-0.25513041)

# transformed data
z1 <- z.transform(r)
z2 <- hotelling.transform(r,7)
z1
z2

Example output

Loading required package: corpcor
Loading required package: longitudinal
Loading required package: fdrtool
 [1] -0.26690430  0.51330253  0.24432088 -0.02187558 -0.07714706 -0.03811277
 [7] -0.06017747  0.01334570 -0.45235595 -0.26089280
 [1] -0.22899520  0.44143031  0.20958747 -0.01875062 -0.06613150 -0.03266875
 [7] -0.05158328  0.01143920 -0.38875232 -0.22382820

GeneNet documentation built on Nov. 15, 2021, 1:07 a.m.

Related to z.transform in GeneNet...