Skip to main content

varSampStable

Introduced in: v1.1.0 Calculate the sample variance of a data set. Unlike varSamp, this function uses a numerically stable algorithm. It works slower but provides a lower computational error. The sample variance is calculated using the same formula as varSamp: Σ(xxˉ)2n1\frac{\Sigma{(x - \bar{x})^2}}{n-1}
Where:
  • xx is each individual data point in the data set
  • xˉ\bar{x} is the arithmetic mean of the data set
  • nn is the number of data points in the data set
Syntax
Arguments
  • x — The population for which you want to calculate the sample variance. (U)Int* or Float* or Decimal*
Returned value Returns the sample variance of the input data set. Float64 Examples Computing stable sample variance
Query
Response
Last modified on June 19, 2026