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' })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.
populationsample(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
populationestimator uses the population standard deviation. - The
sampleestimator uses the sample standard deviation. - The
robustestimator 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);