r2cov: Convert correlation matrix into covariance matrix
Description
r2cov converts correlation matrix and
sample/unbiased standard deviation into sample/unbiased
covariance matrix.
Usage
r2cov(sd, R)
Arguments
sd
a numeric vector contains the sample/unbiased standard deviations
R
a matrix or data frame contains the correlation matrix
Value
Return a matrix containing the sample/unbiased covariance matrix.
encoding
UTF-8
Details
This function converts correlation matrix and
sample/unbiased standard deviation into sample/unbiased
covariance matrix using the following equation: $S = D^{1/2} R
D^{1/2}$, where $S$ is a sample/unbiased covariance matrix,
$R$ is a correlation matrix, and $D^{1/2}$ is a square
matrix with sd on the main diagonal and 0's elsewhere.
The length of sd should be equal to the number of rows
and columns in R.
References
Toyoda H (1998) Introduction to structural equation modeling (in Japanese) Tokyo: Asakura Publishing.