cor_to_cov: Conversion of Correlation Matrix and Vector of Variances to...

Description Usage Arguments Value Examples

View source: R/cov_cor_conversion.R

Description

The same approach as in 'base::cov2cor()' is used to compute the variance-covariance matrix from a matrix of correlations and a vector of variance values.

Usage

1
cor_to_cov(pmat_cor, pvec_var)

Arguments

pmat_cor

correlation matrix

pvec_var

vector of variance components

Value

variance covariance matrix

Examples

1
2
3
4
## Taken from ?cov2cor: Correlation Matrix of Multivariate sample:
Cv <- cov(longley)
Cl <- cor(longley)
stopifnot(all.equal(cor_to_cov(Cl, diag(Cv)), Cv))

pvrqualitasag/rvcetools documentation built on Dec. 31, 2021, 2:09 p.m.