如何计算统计“t-test"与麻木 [英] How to calculate the statistics "t-test" with numpy
本文介绍了如何计算统计“t-test"与麻木的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望生成有关我在 Python 中创建的模型的一些统计信息.我想对其进行 t 检验,但想知道是否有一种简单的方法可以使用 numpy/scipy 来做到这一点.周围有什么好的解释吗?
例如,我有三个相关的数据集,如下所示:
[55.0, 55.0, 47.0, 47.0, 55.0, 55.0, 55.0, 63.0]
现在,我想对他们进行学生的 t 检验.
解决方案
在 scipy.stats 包有几个 ttest_...
函数.请参阅此处的示例:
I'm looking to generate some statistics about a model I created in python. I'd like to generate the t-test on it, but was wondering if there was an easy way to do this with numpy/scipy. Are there any good explanations around?
For example, I have three related datasets that look like this:
[55.0, 55.0, 47.0, 47.0, 55.0, 55.0, 55.0, 63.0]
Now, I would like to do the student's t-test on them.
解决方案
In a scipy.stats package there are few ttest_...
functions. See example from here:
>>> print 't-statistic = %6.3f pvalue = %6.4f' % stats.ttest_1samp(x, m)
t-statistic = 0.391 pvalue = 0.6955
这篇关于如何计算统计“t-test"与麻木的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文