Learn R Programming

survcomp (version 1.22.0)

fisherz: Function to compute Fisher z transformation

Description

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

Usage

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. $$latex$$ when inv = FALSE and $$latex$$ when inv = TRUE

Value

Fisher's z statistic

Details

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

Two attributes of the distribution of the z statistic: (1) It is normally distributed and (2) it has a known standard error of $$latex$$ 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.

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

Run this code
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)

Run the code above in your browser using DataLab