var_pop: Calculate population variance and standard deviation

View source: R/var_pop.R

var_popR Documentation

Calculate population variance and standard deviation

Description

Calculate the population variance or standard deviation of a vector.

Usage

var_pop(x)

sd_pop(x)

Arguments

x

(Numeric) vector.

Details

Unlike var, which returns the sample variance, var_pop() returns the population variance. sd_pop() returns the standard deviation based on the population variance.

Value

The population variance or standard deviation of x.

Examples

data(efc)

# sampling variance
var(efc$c12hour, na.rm = TRUE)
# population variance
var_pop(efc$c12hour)

# sampling sd
sd(efc$c12hour, na.rm = TRUE)
# population sd
sd_pop(efc$c12hour)

sjstats documentation built on May 29, 2024, 12:09 p.m.