3.5.2.43 StdDev/StDev.s

Description

Calculate the sample Standard Deviation.

s = \sqrt{\frac{1}{n-1} \sum_{i=1}^n (x_i - \overline{x})^2}
Notes:
  • StdDev() and StDev.s() are functionally identical. Use either of them as you like.
  • StdDev() and StDev.s() functions calculates SD by column. If you want to calculate SD of multiple datasets by row, you can use syntax sum(vd) to sum datasets by row and generate temporary datasets of related statistics values, and then use _sd (sum(vd)_sd) to get SD value. See the sum() function for more information.

Syntax

double StdDev(dataset vd)
double StDev.s(dataset vd)

Parameters

vd

Input dataset.

Return

Return the Sample Standard Deviation.

Example

EX1

double ee=StdDev(col(A));
ee=;

EX2

//calculate first 10 rows in column A
StDev.s(col(A)[1:10])=;

See Also

StdDevP/StDev.p