Learn R Programming

ordinalTables (version 1.0.0.3)

weighted_var: Computes the weighted variance

Description

Computes variance between x and y using case weights in w

Usage

weighted_var(x, w, use_df = TRUE)

Value

the weighted covariance between x and y

Arguments

x

Numeric vector. First variable

w

Numeric vector. Case weights

use_df

Logical. Should the divisor be sum of weights - 1 (TRUE) or N - 1 (FALSE)