> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Calculates the population variance.

# varPop

<h2 id="varPop">
  varPop
</h2>

Introduced in: v1.1.0

Calculates the population variance.

The population variance is calculated using the formula:

$$
\frac{\Sigma{(x - \bar{x})^2}}{n}
$$

<br />

Where:

* $x$ is each value in the population
* $\bar{x}$ is the population mean
* $n$ is the population size

<Note>
  This function uses a numerically unstable algorithm. If you need [numerical stability](https://en.wikipedia.org/wiki/Numerical_stability) in calculations, use the [`varPopStable`](/reference/functions/aggregate-functions/varPopStable) function. It works slower but provides a lower computational error.
</Note>

**Syntax**

```sql theme={null}
varPop(x)
```

**Aliases**: `VAR_POP`

**Arguments**

* `x` — Population of values to find the population variance of. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal*`](/reference/data-types/decimal)

**Returned value**

Returns the population variance of `x`. [`Float64`](/reference/data-types/float)

**Examples**

**Computing population variance**

```sql title=Query theme={null}
DROP TABLE IF EXISTS test_data;
CREATE TABLE test_data
(
    x UInt8,
)
ENGINE = Memory;

INSERT INTO test_data VALUES (3), (3), (3), (4), (4), (5), (5), (7), (11), (15);

SELECT
    varPop(x) AS var_pop
FROM test_data;
```

```response title=Response theme={null}
┌─var_pop─┐
│    14.4 │
└─────────┘
```
