STDDEV

The STDDEV function computes the standard deviation of an n-element vector.

Note: STDDEV uses the MOMENT function to compute the standard deviation. See MOMENT for details on how the value is calculated.

Tip: You may want to use the RUNNING_STATS function instead, which allows you to compute the variance (the square of the standard deviation), and avoids overflow for large values and also allows you to combine calculations for data sets that do not fit into memory.

Examples

; Define the n-element vector of sample data:

x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71, 66, 65, 70]



; Compute the standard deviation:

result = STDDEV(x)



PRINT, result

IDL prints:

2.65832

Syntax

Result = STDDEV( X  [, DIMENSION=value] [, /DOUBLE] [, /NAN] )

Return Value

The result is the standard deviation of the given vector.

Arguments

X

A numeric vector.

Keywords

DIMENSION

Set this keyword to a scalar indicating the dimension across which to calculate the standard deviation. If this keyword is not present or is zero, then the standard deviation is computed across all dimensions of the input array. If this keyword is present, then the standard deviation is only calculated only across a single dimension. In this case the result is an array with one less dimension than the input.

DOUBLE

If this keyword is set, computations are performed in double precision arithmetic.

NAN

Set this keyword to cause the routine to check for occurrences of the IEEE floating-point values NaN or Infinity in the input data. Elements with the value NaN or Infinity are treated as missing data.

Version History

5.1

Introduced

8.0

Added DIMENSION keyword

See Also

KURTOSIS, MEAN, MEANABSDEV, MOMENT, RUNNING_STATS, SKEWNESS, VARIANCE