[SciPy-Dev] stats.sem default ddof

josef.pktd@gmai... josef.pktd@gmai...
Thu Jun 24 07:44:03 CDT 2010


On Thu, Jun 24, 2010 at 7:41 AM, Angus McMorland <amcmorl@gmail.com> wrote:
> Hi all,
>
> I had a look at the stats.sem docstring this morning, and noticed that
> the default value for the ddof argument is 1. While this might be the
> most commonly used value for SEM, the default in numpy.std is 0, and
> I'd thought I'd see whether you think consistency or ease-of-use is
> the rule to follow here.

>From what I remember, SEM is supposed to have one denominator with n
and one with (n-1).
I think that's the standard normalization for the t-test

>>> import numpy as np
>>> from scipy import stats
>>> x = np.random.randn(20)

>>> stats.ttest_1samp(x, 0)
(1.5496926824178252, 0.13771199831758346)
>>> x.mean()/stats.sem(x)
1.5496926824178252

Josef

>
> I can't remember (and my laptop battery is about to go flat) but I'm
> guessing that the rewritten stats.nanstd will have ddof=0 as the
> default(?)
>
> ... I've also just noticed that stats.tsem doesn't have the usual ddof
> and axis keywords at all - I think this should be changed.
>
> I can file tickets if we think that's the way to go.
>
> Best,
>
> Angus.
> --
> AJC McMorland
> Post-doctoral research fellow
> Neurobiology, University of Pittsburgh
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>


More information about the SciPy-Dev mailing list