View source: R/covariancecorrelation.R
CovarianceAndCorrelationMatrix | R Documentation |
CovarianceAndCorrelationMatrix
Generate a covariance or correlation matrix from weighted or unweighted data using either the set of complete observations, or using pairwise-complete observations.
CovarianceAndCorrelationMatrix(
data,
weights = NULL,
pairwise = FALSE,
use.correlation = TRUE
)
data |
A data frame containing the input data. |
weights |
A numeric vector containing the value of the weight for each
row of |
pairwise |
A logical value. If |
use.correlation |
A logical value specifying whether a correlation or covariance matrix should be returned. |
my.data <- cbind(c(-0.9, 0.05, 0.1, 0.8), c(1, NaN, 0, -0.9))
my.weight <- c(1.2, 0.8, 0.8, 1.2)
CovarianceAndCorrelationMatrix(my.data, weights = my.weight, pairwise = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.