# Data simulation in R using covariance method

I simulated my data successfully in R by applying the R codes below. However, I need to simulate errors separately for each different Y outcome by using covariance method in R.

I don't know how to use covariance to simulate errors in R.

Thanks

library(MASS)

## var1(Verb.comp), var2(word.Id), var3(word.att) ~ N(0, 1)
## r_12 = 0.5, r_23 = 0.6, r_13 = 0.5

covmat <- matrix(c(1, 0.5, 0.5,
0.5, 1, 0.7,
0.5, 0.7, 1), ncol = 3, byrow = TRUE)

## this is what my variance-covariance matrix looks like
covmat

## simulate data
df <- mvrnorm(1000, mu = c(0, 0, 0), Sigma = covmat)
## estimate pm-corelations
cor(df)
evalA <- matrix(c(1,1,1,0,1,1,0,0,1),3,3)