fisherz: Function to compute Fisher z transformation

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

Description

The function computes the Fisher z transformation useful to calculate the confidence interval of Pearson's correlation coefficient.

Usage

1
fisherz(x, inv = FALSE, eps = 1e-16)

Arguments

x

value, e.g. Pearson's correlation coefficient

inv

TRUE for inverse Fisher z transformation, FALSE otherwise

eps

tolerance for extreme cases, i.e.

|x| \approx 1

when inv = FALSE and

|x| \approx Inf

when inv = TRUE

Details

The sampling distribution of Pearson's ρ is not normally distributed. R. A. Fisher developed a transformation now called “Fisher's z transformation” that converts Pearson's ρ to the normally distributed variable z. The formula for the transformation is

z = 1 / 2 [ \log(1 + ρ) - \log(1 - ρ) ]

Two attributes of the distribution of the z statistic: (1) It is normally distributed and (2) it has a known standard error of

σ_z = 1 / √{N - 3}

where N is the number of samples.

Fisher's z is used for computing confidence intervals on Pearson's correlation and for confidence intervals on the difference between correlations.

Value

Fisher's z statistic

Author(s)

Benjamin Haibe-Kains

References

R. A. Fisher (1915) "Frequency distribution of the values of the correlation coefficient in samples of an indefinitely large population". Biometrika, 10,pages 507–521.

See Also

cor

Examples

1
2
3
4
5
6
7
set.seed(12345)
x1 <- rnorm(100, 50, 10)
x2 <- runif(100,.5,2)
cc <- cor(x1, x2)
z <- fisherz(x=cc, inv=FALSE)
z.se <- 1 / sqrt(100 - 3)
fisherz(z, inv=TRUE)

Example output

Loading required package: survival
Loading required package: prodlim
[1] -0.1327014

survcomp documentation built on Nov. 8, 2020, 4:54 p.m.