powered by
Computes the weighted covariance coefficient of two numeric vectors.
weighted.cov(x, y, w, na.rm = TRUE)
Scalar containing the covariance
(numeric vector) Variable of interest x for computing the covariance
(numeric vector) Variable of interest y for computing the covariance
(numeric vector) Vector with the weights
(bool) if TRUE: Excludes missing values before computing the covariance
data(df_talis18) weighted.cov(x = df_talis18$t3stake, y = df_talis18$t3team, w = df_talis18$tchwgt)
Run the code above in your browser using DataLab