Python 中的 T 检验

T-test in Python

如何在 Python 中进行 t 检验?

#*-* coding: utf-8 *-*
from __future__ import division
from scipy import stats
import numpy as np

x=([ 0.01082045  0.00225922  0.00022592  0.00011891  0.00525565  0.00156956])
y=([ 0.00096333  0.00019453  0.00038384  0.00058286  0.00078786])
ttest=stats.ttest_ind(x,y)
print 't-test independent', ttest

我得到两个数字:t-test independent (array(1.5061708454111165), 0.1662878376677496)

我不知道他们是什么意思。你能帮我吗? "array" 是什么意思?

我有样品和两台不同的机器。我必须用t-test比较这两种方法。

非常感谢您的帮助!

来自manual

Returns:
statistic : float or array The calculated t-statistic.

pvalue : float or array The two-tailed p-value.

也就是说,1.5 是您的双尾标准正态 Z 分数,而 .166 是相应的 p 值。