Last chance! 50% off unlimited learning
Sale ends in
Convert a correlation to covariance
cor_to_cov(cor, sd = NULL, variance = NULL, tol = .Machine$double.eps^(2/3))
A correlation matrix, or a partial or a semipartial correlation matrix.
A vector that contains the standard deviations, or the variance, of the variables in the correlation matrix.
Relative tolerance to detect zero singular values.
A covariance matrix.
# NOT RUN {
cor <- cor(iris[1:4])
cov(iris[1:4])
cor_to_cov(cor, sd = sapply(iris[1:4], sd))
cor_to_cov(cor, variance = sapply(iris[1:4], var))
# }
Run the code above in your browser using DataLab