Amelie B. Blackstone
Amelie B. Blackstone

Reputation: 129

T-test in Python

How do I make a t-test in Python?

#*-* 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

I get two numbers out: t-test independent (array(1.5061708454111165), 0.1662878376677496)

I don't know what they mean. Could you maybe help me? And what does the one "array" mean?

I have samples and two different machines. I have to compare the two methods with t-test.

Thank you very much for help!

Upvotes: 0

Views: 2207

Answers (1)

MichaelChirico
MichaelChirico

Reputation: 34703

From the manual:

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

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

That is, 1.5 is your two-tailed, standard normal Z score & .166 is the corresponding p-value.

Upvotes: 2

Related Questions