var_pop: Calculate population variance and standard deviation

Description Usage Arguments Details Value Examples

View source: R/var_pop.R

Description

Calculate the population variance or standard deviation of a vector.

Usage

1
2
3

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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 Jan. 13, 2021, 6:06 p.m.