bundles / scipy latest / scipy / stats / _mstats_basic / sem
function
scipy.stats._mstats_basic:sem
Signature
def sem ( a , axis = 0 , ddof = 1 ) Summary
Calculates the standard error of the mean of the input array.
Extended Summary
Also sometimes called standard error of measurement.
Parameters
a: array_likeAn array containing the values for which the standard error is returned.
axis: int or None, optionalIf axis is None, ravel
afirst. If axis is an integer, this will be the axis over which to operate. Defaults to 0.ddof: int, optionalDelta degrees-of-freedom. How many degrees of freedom to adjust for bias in limited samples relative to the population estimate of variance. Defaults to 1.
Returns
s: ndarray or floatThe standard error of the mean in the sample(s), along the input axis.
Notes
The default value for ddof changed in scipy 0.15.0 to be consistent with scipy.stats.sem as well as with the most common definition used (like in the R documentation).
Examples
Find standard error along the first axis:import numpy as np from scipy import stats a = np.arange(20).reshape(5,4) print(stats.mstats.sem(a))✓
print(stats.mstats.sem(a, axis=None, ddof=0))
✓Aliases
-
scipy.stats._mstats_basic.sem