Population-level variance

Description

Variance of a vector giving the elements of a population.

Usage

1
var.(x, p)

Arguments

x

A numeric vector giving the population.

p

An optional vector of weights. If missing, equal weights are used.

Value

The variance of x.

Examples

1
2
3
4
5
# Note the difference between population and sample variance
var.(1:10)
var(1:10)
# But we can make up the difference with,
var(1:10)*(9/10)