weighted.var: Weighted variance

View source: R/repest_auxiliaries.R View source: R/weighted_variance.R

weighted.varR Documentation

Weighted variance

Description

Computes the weighted variance of a numeric vector.

Usage

weighted.var(x, w, na.rm = TRUE)

Arguments

x

(numeric vector) Variable of interest for which to compute the variance

w

(numeric vector) Vector with weights

na.rm

(bool) if TRUE: Excludes missing values before computing the variance

Value

Scalar containing the variance

Examples

data(df_talis18) 

weighted.var(df_talis18$TT3G02, df_talis18$TRWGT1)

Rrepest documentation built on April 4, 2025, 2:07 a.m.