是否有 python t 测试差异? [英] Is there a python t test for difference?
问题描述
python 包中是否有可以测试差异的 t 测试?有的话怎么用?
Is there a t test in a python package where you can test for difference? If there is how do you use it?
例如测试两个向量:
a=np.random.randn(5, 7)
b=np.random.randn(5, 7)
我在 statsmodels 中找到了 t 检验:ttest_ind.但是我想指定要测试的差异,这不能传递到 ttest_ind 函数中.有人知道另一种方法吗?
I have found the t test : ttest_ind in statsmodels. However I would like to specify the difference to test for, this can not be passed into the ttest_ind function. Does anybody know another way to do this?
推荐答案
ttest_ind
在 statsmodels 中有一个 value
选项,用来检验两者之间的差异的原假设mean 等于 value
ttest_ind
in statsmodels has a value
option, to test the null hypothesis that the difference between the two means is equal to value
http://statsmodels.sourceforge.net/stable/生成/statsmodels.stats.weightstats.ttest_ind.html
这篇关于是否有 python t 测试差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!