dataFrame.column.stat — stdDev()

Description

The stdDev() method of the stat object computes the standard deviation of the values in the selected column.

Signature

dataFrame.column(columnName).stat.stdDev({ estimator: 'sample', type: 'pearson' })
Scope
column
Family
stat
Returns
object

Arguments

columnName (string)
The name of the column from which to compute the standard deviation.
options (object)
Standard deviation calculation options.

Options

estimator (string)
The estimator used to compute the standard deviation.
  • population
  • sample (default)
threshold (number)
The standard deviation threshold used to identify outliers. (Default: 3.)

Returns

stat (object)
The statistic details computed for the selected column.
mean (number)
The arithmetic mean of values.
stdDev (number)
The standard deviation.
lcl (number)
The lower control limit computed from the specified threshold.
ucl (number)
The upper control limit computed from the specified threshold.
mask ( number[] )
An array containing the standardized deviations of the values in the selected column.
outlierMask ( boolean[] )
An array indicating whether each value falls outside the control limits (outliers).

Notes

  • The sample estimator applies Bessel's correction.
  • The population estimator uses the full population formula.
  • Values whose standardized deviation exceeds the specified threshold are marked as outliers in outlierMask.

Example

// get the standard deviations statistics of values of a column of the dataFrame
var stat = dataFrame.column('revenue').stat.stdDev();

// log the stat details
notebook.log(stat);

// add standard deviations to the dataFrame
dataFrame.column('stdDev').set(stat.mask);

// add outliers mask to the dataFrame
dataFrame.column('outlier').set(stat.outlierMask);