[R] Fisher r-to-z transformation
Chuck Cleland
ccleland at optonline.net
Fri Jul 26 11:04:52 CEST 2002
Tim Wilson wrote:
> I want to use the Fisher r-to-z transformation as part of a hypothesis
> test of r. I can't find an R function that can do that. Am I missing
> it?
Tim:
Below is a Fisher transformation I wrote some time ago.
Hope it helps,
Chuck Cleland
fisher.z <- function(x)
{
ifelse(x == 0, 0, 0.5 * log((1 + abs(x))/(1 - abs(x))) * (x/abs(x)))
}
> fisher.z(seq(-1, 1, .05))
[1] -Inf -1.83178082 -1.47221949 -1.25615281 -1.09861229
[6] -0.97295507 -0.86730053 -0.77529871 -0.69314718 -0.61838131
[11] -0.54930614 -0.48470028 -0.42364893 -0.36544375 -0.30951960
[16] -0.25541281 -0.20273255 -0.15114044 -0.10033535 -0.05004173
[21] 0.00000000 0.05004173 0.10033535 0.15114044 0.20273255
[26] 0.25541281 0.30951960 0.36544375 0.42364893 0.48470028
[31] 0.54930614 0.61838131 0.69314718 0.77529871 0.86730053
[36] 0.97295507 1.09861229 1.25615281 1.47221949 1.83178082
[41] Inf
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list