weighted.cov {Rrepest}R Documentation

Weighted Bivariate Covariance

Description

Compute weighted covariance coefficient of two numeric vectors

Usage

weighted.cov(x, y, w, na.rm = TRUE)

Arguments

x

(numeric vector) variable from where to get covariance

y

(numeric vector) variable from where to get covariance

w

(numeric vector) vector of weights

na.rm

(bool) True: NAs be stripped before computation proceeds

Value

Pearson correlation coefficient

Examples

data(df_talis18) 

weighted.cov(x = df_talis18$T3STAKE, y = df_talis18$T3TEAM, w = df_talis18$TCHWGT)

[Package Rrepest version 1.3.0 Index]