如何获得Perl中相关性的t统计和p值?

时间:2023-02-15 18:39:45

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值。

#2


3  

Statistics::Distributions can help you with that.

统计学::发行版可以帮助您实现这一点。

#3


1  

Is Statistics::LineFit what you are searching for?

统计信息::LineFit你在搜索什么?

#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值。

#2


3  

Statistics::Distributions can help you with that.

统计学::发行版可以帮助您实现这一点。

#3


1  

Is Statistics::LineFit what you are searching for?

统计信息::LineFit你在搜索什么?