| wt_cov | R Documentation | 
Compute the weighted covariance among variables in a matrix or between the variables in two separate matrices/vectors.
wt_cov(
  x,
  y = NULL,
  wt = NULL,
  as_cor = FALSE,
  use = c("everything", "listwise", "pairwise"),
  unbiased = TRUE
)
wt_cor(x, y = NULL, wt = NULL, use = "everything")
x | 
 Vector or matrix of x variables.  | 
y | 
 Vector or matrix of y variables  | 
wt | 
 Vector of weights  | 
as_cor | 
 Logical scalar that determines whether the covariances should be standardized (TRUE) or unstandardized (FALSE).  | 
use | 
 Method for handling missing values. "everything" uses all values and does not account for missingness, "listwise" uses only complete cases, and "pairwise" uses pairwise deletion.  | 
unbiased | 
 Logical scalar determining whether variance should be unbiased (TRUE) or maximum-likelihood (FALSE).  | 
Scalar, vector, or matrix of covariances.
wt_cov(x = c(1, 0, 2), y = c(1, 2, 3), wt = c(1, 2, 2), as_cor = FALSE, use = "everything")
wt_cov(x = c(1, 0, 2), y = c(1, 2, 3), wt = c(1, 2, 2), as_cor = TRUE, use = "everything")
wt_cov(x = cbind(c(1, 0, 2), c(1, 2, 3)), wt = c(1, 2, 2), as_cor = FALSE, use = "everything")
wt_cov(x = cbind(c(1, 0, 2), c(1, 2, 3)), wt = c(1, 2, 2), as_cor = TRUE, use = "everything")
wt_cov(x = cbind(c(1, 0, 2, NA), c(1, 2, 3, 3)),
       wt = c(1, 2, 2, 1), as_cor = FALSE, use = "listwise")
wt_cov(x = cbind(c(1, 0, 2, NA), c(1, 2, 3, 3)),
       wt = c(1, 2, 2, 1), as_cor = TRUE, use = "listwise")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.