weighted_cov: Computes the weighted covariance
Description
Computes covariance between x and y using case weights in w
Usage
weighted_cov(x, y, w, use_df = TRUE)
Value
the weighted covariance between x and y
Arguments
- x
Numeric vector. First variable
- y
Numeric vector. Second variable
- w
Numeric vector. case weights
- use_df
Logical. should the divisor be sum of weights - 1 (TRUE) or N - 1 (FALSE)