Convert a correlation to covariance
cor_to_cov(cor, sd = NULL, variance = NULL, tol = .Machine$double.eps^(2/3))
cor | A correlation matrix, or a partial or a semipartial correlation matrix. |
---|---|
sd, variance | A vector that contains the standard deviations, or the variance, of the variables in the correlation matrix. |
tol | Relative tolerance to detect zero singular values. |
A covariance matrix.
#> Sepal.Length Sepal.Width Petal.Length Petal.Width #> Sepal.Length 0.6856935 -0.0424340 1.2743154 0.5162707 #> Sepal.Width -0.0424340 0.1899794 -0.3296564 -0.1216394 #> Petal.Length 1.2743154 -0.3296564 3.1162779 1.2956094 #> Petal.Width 0.5162707 -0.1216394 1.2956094 0.5810063#> Sepal.Length Sepal.Width Petal.Length Petal.Width #> Sepal.Length 0.6856935 -0.0424340 1.2743154 0.5162707 #> Sepal.Width -0.0424340 0.1899794 -0.3296564 -0.1216394 #> Petal.Length 1.2743154 -0.3296564 3.1162779 1.2956094 #> Petal.Width 0.5162707 -0.1216394 1.2956094 0.5810063#> Sepal.Length Sepal.Width Petal.Length Petal.Width #> Sepal.Length 0.6856935 -0.0424340 1.2743154 0.5162707 #> Sepal.Width -0.0424340 0.1899794 -0.3296564 -0.1216394 #> Petal.Length 1.2743154 -0.3296564 3.1162779 1.2956094 #> Petal.Width 0.5162707 -0.1216394 1.2956094 0.5810063