Statistics
Sample standard deviation
stats.sample-stdAlso called sample standard deviation, std, stdev, standard deviation
where
Square root of the sample variance (divisor n − 1).
Notation
observations
x ∈ ℝn
number of observations
Size, at least 2
Result: the sample standard deviation
scalar
Worked examples
Each result is solved exactly and confirmed by two independent computations.
Given
Result
≈ 2.1380899353
Given
Result
≈ 1.29099444874
Given
Result
≈ 1.41421356237
Common mistakes
Divides by n instead of n − 1
This is the population standard deviation (NumPy's np.std default, ddof=0); the result is sqrt((n − 1)/n) times the sample value.
Fix: Divide by n − 1 inside the square root, or call np.std(x, ddof=1).
Returns the variance
The final square root is missing.
Fix: Take the square root of the sample variance.
Source
NIST/SEMATECH e-Handbook, §1.3.5.6
NIST/SEMATECH e-Handbook of Statistical Methods. https://www.itl.nist.gov/div898/handbook/ Last updated 2022-04-27. doi:10.18434/M32189