jackscott / python-statlib

Exported from google.code, needed to get this crusty code working in a modern world
https://archive.org/web/
Other
0 stars 0 forks source link

lsterr and lsem are the same #13

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. start python
2.
>>> from statlib import stats
>>> a = [1,2,3,4,5,6]
>>> stats.sterr(a)
0.76376261582597338
>>> stats.sterr(a) == stats.sem(a)
True
>>> 

I am not sure about the expected output, but shouldn't these be different 
anyway? sterr is supposed to divide by n-1 in it's variance estimate, while the 
sem computes the variance dividing by n. 

I've checked the code of the both functions -- it looks identical to me.

statlib-1.1 on Mac OS 10.5

Please provide any additional information below.

Original issue reported on code.google.com by mezh...@gmail.com on 26 Jul 2010 at 12:22

GoogleCodeExporter commented 8 years ago
Yes, valid issue. For now you should subtract 1 from the len(inlist) like so:

return stdev(inlist) / float(math.sqrt(len(inlist)-1))

Original comment by istvan.a...@gmail.com on 26 Jul 2010 at 6:31