# How to get P value of correlation coefficient here

I am using this package to get correlation coefficient : https://godoc.org/gonum.org/v1/gonum/stat#Correlation

It works well but it does not give P value of the correlation. Other functions in this package are given above on the same page: https://godoc.org/gonum.org/v1/gonum/stat

Similarly, this package also has correlation function which returns coefficient but not P value.

How can I find P value of correlation coefficient in any of these situations? Thanks for your help.

• 1. Is this for the null hypothesis that the population correlation is 0? Under the assumption of bivariate normality, or something else? 2. Note that a program-specific answer is probably not suitable for this site (see the help center under the section starting with the word "Programming"). Commented Sep 8, 2019 at 7:53
• The most obvious answer is "use a package that does it already", of which there are a number of free possibilities available. However, under the usual assumptions people tend to use for this situation, when testing a null of 0 correlation, it's reasonably simple to use a transformation to Student-t. $t_{n-2}=r{\sqrt {\frac {n-2}{1-r^{2}}}}$ Commented Sep 8, 2019 at 8:01
• See stats.stackexchange.com/questions/400146/… and stats.stackexchange.com/questions/122481/… and stats.stackexchange.com/questions/270612/… (and several others on site) Commented Sep 8, 2019 at 8:08
• Transformation to Student-t seems a good method and thanks for the links. Otherwise, I am not able to find a good statistics library in Go language: golang.org
– rnso
Commented Sep 8, 2019 at 8:09