Learn R Programming

exactLTRE (version 0.1.2)

variance_complete: A function for variance assuming a complete sample

Description

The variance, assuming a complete sample, is the mean of the squared deviations. When you assume an incomplete sample (the standard assumption in statistics), the variance is calculated as the sum of squared deviations, divided by (N-1), where N is the number of observations in the sample. As such, the output of variance_complete will always be smaller than the output of var.

Usage

variance_complete(x)

Value

The variance of the entries of x, calculated with the assumption that x represents a complete sample. Compare to the output of var.

Arguments

x

A numeric vector that represents a complete sample.

See Also

Examples

Run this code
test<- c(5, 6, 8, 10, 25)
Vc<- variance_complete(test)
# compare this output with that of var()

Run the code above in your browser using DataLab