weighted.var {Rrepest}R Documentation

Weighted variance

Description

Calculate the weighted variance numeric vector

Usage

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

Arguments

x

(numeric vector) variable to analyze

w

(numeric vector) vector of weights

na.rm

(bool) if TRUE remove missing values.

Value

Scalar with Variance or Standard Deviation

Examples

data(df_talis18) 

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

[Package Rrepest version 1.3.0 Index]