如何计算统计"t-检验"?与numpy的 [英] How to calculate the statistics "t-test" with numpy

查看:112
本文介绍了如何计算统计"t-检验"?与numpy的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关我在python中创建的模型的一些统计信息.我想在上面生成t检验,但想知道是否有简单的方法可以使用numpy/scipy进行此操作.周围有什么好的解释吗?

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]

现在,我想对他们进行学生的t检验.

Now, I would like to do the student's t-test on them.

推荐答案

scipy.stats 包中的ttest_...函数很少.请参见此处:

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-检验"?与numpy的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆