dataFrame.column.stat — variationCoef()

Description

The variationCoef() method of the stat object returns the coefficient of variation of the values in the selected column.

Signature

dataFrame.column(columnName).stat.variationCoef({ estimator: 'sample' })
Scope
column
Family
stat
Returns
number

Argument

columnName (string)
The name of the column from which to compute the coefficient of variation.
options (object)
Coefficient of variation calculation options.

Option

estimator (string)
The estimator used to compute the coefficient of variation.
  • population
  • sample (default)
  • robust

Returns

coef (number)
The coefficient of variation of the values in the selected column.

Notes

  • The coefficient of variation is a normalized measure of dispersion relative to the central tendency of the data.
  • The population estimator uses the population standard deviation.
  • The sample estimator uses the sample standard deviation.
  • The robust estimator uses robust measures of central tendency and dispersion to reduce the influence of outliers.

Example

// get the coefficient of variation of the values of a column of the dataFrame
var coef = dataFrame.column('revenue').stat.variationCoef();

// log the coefficient of variation
notebook.log(coef);