powered by
Computes a matrix of weighted covariances between the columns of x and the columns of y.
x
y
weighted.cov2(x, y = NULL, weights = NULL, na.rm = FALSE)
a matrix of covariances
a data frame of numeric vectors
an optional data frame of numeric vectors. Default is NULL, which means that covariances between the columns of x are computed.
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.cov
data(Movies) weighted.cov2(Movies[,c("Budget", "Critics", "BoxOffice")], weights = rep(c(.8,1.2), 500))
Run the code above in your browser using DataLab