I want to test a sample correlation $r$ for significance ($n=16$), using p-values, in Python. As I have understood from this question, I can achieve that by using Fisher's z-transform.
Is there a Python module, which allows easy use of Fisher's z-transform?
I have not been able to find the functionality in SciPy or Statsmodels. So far, I have had to write my own messy temporary function:
import numpy as np
from scipy.stats import zprob
def z_transform(r, n):
z = np.log((1 + r) / (1 - r)) * (np.sqrt(n - 3) / 2)
p = zprob(-z)
return p
z-transform
is a typo, since that's an invalid Python identifier (-
is interpreted as subtraction). $\endgroup$