powered by
Computes the weighted covariance between two distributions.
weighted.cov(x, y, weights = NULL, na.rm = FALSE)
a length-one numeric vector
numeric vector
numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used.
logical, indicating whether NA values should be silently removed before the computation proceeds. Default is FALSE.
Nicolas Robette
weighted.sd, weighted.cor, weighted.cov2
weighted.sd
weighted.cor
weighted.cov2
data(Movies) weighted.cov(Movies$Critics, Movies$BoxOffice, weights = rep(c(.8,1.2), 500))
Run the code above in your browser using DataLab