I'm trying to compute a p-value for a two tailed test following Wikipedia formula which indicates that:

one computes Z, and finds the cumulative probability for a standard normal distribution at -|Z|. For a 2-tailed test, multiply that number by two to obtain the p-value

I'm using this Rust's library which computes Tau value and then you can get the significance from this source code.

The problem is that this calculator (with default values) gives a 2-sided p-value = 0.0389842391014099. Which is far from the p-value I'm getting. The steps I'm following are these:

  1. Compute Tau
  2. Compute the statistical significance: Z with significance = kendall::significance(tau, x.len())
  3. Gets the CDF from Gaussian Distribution with sigma = 1 using this GSL library's function: cdf = gaussian_P(-significance.abs(), 1.0)
  4. Multiply that value by 2

I'm getting a very different value: 0.011946505026920469. I don't understand what I'm missing. Perhaps it's a misunderstanding of Gaussian distribution and it's sigma param. Any kind of help would be really appreciated

  • $\begingroup$ Seems to be a bug with the Rust's library: issue $\endgroup$
    – Genarito
    Dec 28, 2020 at 13:45

1 Answer 1


It was a bug with the library. The described math was correct


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.