s2: Population variance

Description Usage Arguments Value Details Examples

View source: R/s2.R

Description

The function to estimate population variance S^2.

Usage

1
s2(y, w = NULL)

Arguments

y

Study variable.

w

Survey weight (optional). If not defined, it is assumed to be 1 for each element.

Value

Population variance S^2 or the estimate of population variance s^2.

Details

If w is not defined, the result is equal to the result of the function var.

Examples

1
2
3
s2(1:10)
s2(1:10, rep(1:2, each = 5))
all.equal(s2(1:10), var(1:10))

surveyplanning documentation built on July 1, 2020, 10:38 p.m.