popvar: population variance

Description Usage Arguments Examples

View source: R/popvar.R

Description

Returns the population variance. Note that var returns the unbiased sample estimate of the population varaince. It simply multiplies the result of var by (n-1) / n with n the populaton size.

Usage

1
popvar(x, ...)

Arguments

x

a numeric vector, matrix or data frame.

...

further arguments passed along to var

Examples

1
2
3
x <- c(0,1) ##variance should be 0.5^2=0.25
var(x) 
popvar(x)

rafalab/rafalib documentation built on April 17, 2021, 6:47 p.m.