Learn R Programming

rafalib (version 1.0.3)

popvar: population variance

Description

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

Usage

popvar(x, ...)

Arguments

x

a numeric vector, matrix or data frame.

...

further arguments passed along to var

Examples

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

Run the code above in your browser using DataLab