statistics

Alan James Salmoni alan_salmoni at yahoo.com
Fri Dec 20 09:59:48 EST 2002


Hi Andreas,

There are a couple of modules you can use: Firstly, there is Gary
Strangmans stats.py module
(http://www.nmr.mgh.harvard.edu/Neural_Systems_Group/gary/python.html)
which is very comprehensive, and Scientific Python has some basic
stats (http://www.scipy.org/).

Alternatively (shamless plug here), I have adapted Gary's unit for my
own application, SalStat (http://salstat.sunsite.dk) which will
calculate what you want with a wxPython GUI. If you download the
source, the stats module will also do what you want. The unit is
"salstat_stats.py" and is more object oriented than the others. Once
installed in the site-packages dir, use it like this:

import salstat_stats
a = [2,3,4,3,4,5] # first data set
b = [6,7,8,7,8,4] # second data set
x = salstat_stats.TwoSampleTests(a,b)
x.TTestUnpaired()
print x.df # prints out the degrees of freedom
print x.t  # t statistic
print x.prob # probability from the t statistic and the df

for a paired t-test just replace x.TTestUnpaired() with
x.TTestPaired(a,b). There are other tests too: Pearsons, F-test,
Spearmans, Kendalls tau, Kolmogorov-Smirnov, Wilcoxon rank-sums (and
signed ranks), Mann-Whitney U etc. Alternatively, you can perform an
anova instead of a t-test if you wish.

Have fun!

Alan James Salmoni
HCI Group
University of Cardiff.

Andreas Steffen <LisaBizarre at gmx.de> wrote in message news:<3E02F736.C3097168 at gmx.de>...
> Hi,
> i am looking for a  module which deals with statistic problems. Is there
> something?
> In particular I need a function that calculates the values for the
> t-test (and gives out the t-value from the t-table).
> Thanks in advance, Andreas.



More information about the Python-list mailing list