weighted.cov | R Documentation |
Computes the weighted covariance between two distributions.
weighted.cov(x, y, weights = NULL, na.rm = FALSE)
x |
numeric vector |
y |
numeric vector |
weights |
numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used. |
na.rm |
logical, indicating whether NA values should be silently removed before the computation proceeds. Default is FALSE. |
a length-one numeric vector
Nicolas Robette
weighted.sd
, weighted.cor
, weighted.cov2
data(Movies)
weighted.cov(Movies$Critics, Movies$BoxOffice, weights = rep(c(.8,1.2), 500))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.