views:

420

answers:

1

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]

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

A: 

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
van
thanks for responding. it seems to take a random variable. Do i have to generate a random variable out of my sample population beforehand?
Mark
I think you can just use your sample (not "sample population")
van
Sample as in one sample value? I was under the impression that I could use a sample of several results as a parameter, but maybe I was mislead :)
Mark
In statistics, a sample is a subset of a population (see http://en.wikipedia.org/wiki/Sample_%28statistics%29). So what I meant is simple that there is no term "sample population" :) One value is just one value from the sample (which is a set of values).
van