var_wt: Calculates the weighted variance

View source: R/var-wt.R

var_wtR Documentation

Calculates the weighted variance

Description

Calculates the weighted variance

Usage

var_wt(x, wt, na.rm = FALSE)

Arguments

x

numeric vector

wt

weights

na.rm

If TRUE, indices where x is NA will be removed

Value

A numeric vector containing weighted variance of the elements of x

Examples

x <- sample(1:10, size = 10, replace = TRUE)
x.weight <- seq(0, 1, length.out = 10)
var_wt(x, wt = x.weight)

rineq documentation built on April 4, 2025, 4:47 a.m.