fisherz {survcomp} | R Documentation |
The function computes the Fisher z transformation useful to calculate the confidence interval of Pearson's correlation coefficient.
fisherz(x, inv = FALSE, eps = 1e-16)
x |
value, e.g. Pearson's correlation coefficient |
inv |
|
eps |
tolerance for extreme cases, i.e. |x| \approx 1 when inv = |x| \approx Inf when inv = |
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.
Fisher's z statistic
Benjamin Haibe-Kains
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.
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)