var_samp()

Aggregate. Computes the statistical variance of a sample consisting of a numeric-expression, as a float.

Syntax

var_samp ( numeric-expression )

Parameters

numeric-expression

A set of rows. expression is commonly a column name.

Usage

This function converts its argument to float, performs the computation in double-precision floating point, and returns a float. The variance (s2) of numeric-expression (x) is computed according to this formula, which assumes a normal distribution:


This variance does not include rows where numeric-expression is NULL. The function returns NULL for a group containing either 0 or 1 rows.

The variance of a sample could be used as a measure of assessing risk for a specific portfolio.