StdDev

The StdDev function computes the standard deviation of a column or group. It measures the spread of a set of observations (numbers) around the mean and is calculated as the square root of the variance. A low standard deviation suggests data points are clustered near the mean, whereas a high standard deviation suggests data points are generally far from the mean.

Standard deviation is a useful measure of spread for symmetrical distributions with no outliers. It is expressed in the same units of measurement as the data and can help determine the statistical distribution of a dataset.

Sigma calls the underlying Cloud Data Warehouse's Standard Deviation function that uses the statistical sample definition. Check the documentation of the database you use for details on the function called.

📘

The StdDev function is an aggregate function.

Aggregate functions evaluate one or more rows of data and return a single value.

In a table element, the aggregate is calculated for each grouping. For information on how to add a grouping with an aggregate calculation to a table, see Group columns in a table.

In a table with no groupings, the aggregate is calculated for each row. For information on how to calculate summary statistics across all rows in a table, see Add summary statistics to a table.

To learn more about using aggregate functions, see Building complex formulas with grouped data.

Syntax

StdDev(column)

Function arguments:

  • column (required) - The column of numbers to be measured.

The underlying formula is as follows:

√(x_i-x)^2/n-1

where x_i is the value of one observation, x is the mean value of all observations, and n is the number of observations (sample size). 

Example

StdDev([x])
  • Return the sample standard deviation of non-null records in the x column for each group K.