pop_var: Compute the population variance of a vector

View source: R/general_functions.R

pop_varR Documentation

Compute the population variance of a vector

Description

Computes the population variance as defined by

\sigma^2=\frac{1}{N}\sum_{i=1}^N(x_i-\mu)^2

where \mu is the population mean (\frac{1}{N}\sum_{i=1}^Nx_i) and N is the size of the population

Usage

pop_var(x)

Arguments

x

A numerical vector

Value

The population variance of this vector

Examples

pop_var(c(2, 3, 4, 5))
pop_var(rnorm(20, 1, 0))

graebnerc/DataScienceExercises documentation built on April 11, 2025, 7:57 p.m.