I'm trying to calculate correlations in Perl. I found out how to calculate correlations between arrays in CPAN, but I can't seem to find out how to get the t-statistics and p-values of those correlations (R gives these automatically). Is that even possible in Perl? I hope someone can help because I need to determine the significance of the correlations. Many thanks in advance!
我尝试用Perl来计算相关性。我发现了如何计算CPAN中数组之间的相关性,但我似乎不知道如何得到这些相关性的t统计值和p值(R自动给出)。这在Perl中是可能的吗?我希望有人能帮忙,因为我需要确定相关性的重要性。提前感谢!
-Abdel
阿卜杜勒•
3 个解决方案
#1
3
This might help. The p value is basically whether the correlation coefficient is significantly different from 0 or not, so this is a t test: t=r/sqrt[(1-r²)/(N-2)] with n-1 degrees of freedom. Again Math::GSL will get the p value of t for you.
这可能会有所帮助。p值基本上是相关系数是否明显不同于0,这是一个t测试:t = r /√((第一轮²)/(n - 2)与n - 1*度。再一次的数学::GSL将为你获得t的p值。
#1
3
This might help. The p value is basically whether the correlation coefficient is significantly different from 0 or not, so this is a t test: t=r/sqrt[(1-r²)/(N-2)] with n-1 degrees of freedom. Again Math::GSL will get the p value of t for you.
这可能会有所帮助。p值基本上是相关系数是否明显不同于0,这是一个t测试:t = r /√((第一轮²)/(n - 2)与n - 1*度。再一次的数学::GSL将为你获得t的p值。