Skip to main content
@overload
atoti.agg.var(
    operand: LevelOrVariableColumnConvertible,
    /,
    *,
    mode: Literal[‘sample’, ‘population’] = 'sample',
) → MeasureDefinition
@overload
atoti.agg.var(
    operand: VariableMeasureConvertible,
    /,
    *,
    mode: Literal[‘sample’, ‘population’] = 'sample',
    scope: CumulativeScope | SiblingsScope | OriginScope,
) → MeasureDefinition
Return a measure equal to the variance of the passed operand across the specified scope.

Parameters

operand

The operand to get the variance of.

mode

One of the supported modes:
  • The sample variance, similar to Excel’s VAR.S, is i=1n(Xim)2n1\frac{\sum_{i=1}^{n} (X_i - m)^{2}}{n - 1} where m is the sample mean and n the size of the sample. Use this mode if the data represents a sample of the population.
  • The population variance, similar to Excel’s VAR.P is i=1n(Xim)2n\frac{\sum_{i=1}^{n}(X_i - m)^{2}}{n} where m is the mean of the Xi elements and n the size of the population. Use this mode if the data represents the entire population.

scope

The aggregation scope.