VAR {easyCODA}R Documentation

Variance of a vector of observations, dividing by n rather than n-1

Description

This function computes the usual variance but divides by n, not by n-1.

Usage

VAR(x)

Arguments

x

Vector of values for which variance is computed

Details

To think of each of n observations weighted by 1/n this function VAR computes squared deviations from the mean and averages them. Thus, the sum of squared deviations is divided by n rather than by n-1, as for the unbiased estimate of the variance.

Value

The value of the variance.

Author(s)

Michael Greenacre

References

Greenacre, M. (2018), Compositional Data Analysis in Practice, Chapman & Hall / CRC.

See Also

LR.VAR, CLOSE

Examples

data(cups)
cups <- CLOSE(cups)

# variances using base R function var
apply(cups, 2, var)

# variances using easyCODA function VAR
apply(cups, 2, VAR)

[Package easyCODA version 0.34.3 Index]