All formulas

Statistics

Standard error of the mean

stats.standard-errorAlso called standard error, standard error of the mean, sem, se

SE=sn\mathrm{SE} = \frac{s}{\sqrt{n}}

wheres=1n−1∑i=1n(xi−xˉ)2s = \sqrt{\frac{1}{n-1}\sum_{i=1}^{n}(x_i - \bar{x})^2}

wherexˉ=1n∑j=1nxj\bar{x} = \frac{1}{n}\sum_{j=1}^{n} x_j

Estimated standard deviation of the sample mean: the sample standard deviation divided by the square root of n.

Notation

xx

observations

x ∈ ℝn

nn

number of observations

Size, at least 2

SE\mathrm{SE}

Result: the standard error

scalar

Worked examples

Each result is solved exactly and confirmed by two independent computations.

  1. Given

    x=[2,4,4,4,5,5,7,9]x = [2, 4, 4, 4, 5, 5, 7, 9]

    Result

    SE=277\displaystyle \mathrm{SE} = \frac{2 \sqrt{7}}{7}

    ≈ 0.755928946018

  2. Given

    x=[1,2,3,4]x = [1, 2, 3, 4]

    Result

    SE=156\displaystyle \mathrm{SE} = \frac{\sqrt{15}}{6}

    ≈ 0.645497224368

  3. Given

    x=[1,3]x = [1, 3]

    Result

    SE=1\displaystyle \mathrm{SE} = 1

Common mistakes

  • Uses the population standard deviation

    The standard deviation divides by n instead of n − 1 (scipy.stats.sem uses n − 1).

    Fix: Use the sample standard deviation, ddof=1.

  • Divides by n instead of sqrt(n)

    The standard deviation is divided by n, not by its square root.

    Fix: Divide by sqrt(n).

Source

  • Casella and Berger 2002

    Casella, George; Berger, Roger L. Statistical Inference. 2nd ed. Duxbury, 2002.