scipy.stats.tsem#

scipy.stats.tsem(a, limits=None, inclusive=(True, True), axis=0, ddof=1)[source]#

Compute the trimmed standard error of the mean.

This function finds the standard error of the mean for given values, ignoring values outside the given limits.

Parameters
aarray_like

Array of values.

limitsNone or (lower limit, upper limit), optional

Values in the input array less than the lower limit or greater than the upper limit will be ignored. When limits is None, then all values are used. Either of the limit values in the tuple can also be None representing a half-open interval. The default value is None.

inclusive(bool, bool), optional

A tuple consisting of the (lower flag, upper flag). These flags determine whether values exactly equal to the lower or upper limits are included. The default value is (True, True).

axisint or None, optional

Axis along which to operate. Default is 0. If None, compute over the whole array a.

ddofint, optional

Delta degrees of freedom. Default is 1.

Returns
tsemfloat

Trimmed standard error of the mean.

Notes

tsem uses unbiased sample standard deviation, i.e. it uses a correction factor n / (n - 1).

Examples

>>> from scipy import stats
>>> x = np.arange(20)
>>> stats.tsem(x)
1.3228756555322954
>>> stats.tsem(x, (3,17))
1.1547005383792515