The SKEWNESS function computes the statistical skewness of an *n*-element vector. Skewness determines whether a distribution is symmetric about its maximum. Positive skewness indicates the distribution is skewed to the right, with a longer tail to the right of the distribution maximum. Negative skewness indicates the distribution is skewed to the left, with a longer tail to the left of the distribution maximum.

SKEWNESS calls the IDL function MOMENT.

## 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 skewness:

result = SKEWNESS(x)

PRINT, 'Skewness = ', result

IDL prints:

`Skewness = -0.0942851`

## Syntax

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

## Return Value

Returns the floating point or double precision statistical skewness. If the variance of the vector is zero, the skewness is not defined, and SKEWNESS returns !VALUES.F_NAN as the result.

## Arguments

### X

A numeric vector.

## Keywords

### DIMENSION

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

### DOUBLE

Set this keyword to force computations to be done 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, STDDEV, VARIANCE