Is there a python t test for difference? [duplicate]

末鹿安然 提交于 2019-12-13 05:07:18

问题


Is there a t test in a python package where you can test for difference? If there is how do you use it?

For example test two vectors:

a=np.random.randn(5, 7)
b=np.random.randn(5, 7)

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?


回答1:


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/generated/statsmodels.stats.weightstats.ttest_ind.html



来源:https://stackoverflow.com/questions/20682795/is-there-a-python-t-test-for-difference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!