So I am asked to simulate data for 50 patients. Each patient has 15 features. I am told that the first 10 variables come from a multivariable Gaussian distribution with mean = 0 and a covariance matrix that equals to an identity matrix. The variance must be equal to 1. So in R, I did the following.
library(mvtnorm)
#create a 10x10 matrix with 0 values everywhere.Then fill with 1 the diagonal.
mat <- matrix(0, 10, 10)
diag(mat) <- 1
#This is how I sampled for the 10 first features.
rmvnorm(50, mean = c(0, 0, 0, 0, 0, 0 ,0 ,0 ,0 ,0 ), sigma = mat)
For the rest 5 features, I am given the following formula to sample from.
$$\mathrm{X}_{\mathrm{ij}} \sim \mathrm{N}\left(0.2 \mathrm{X}_{\mathrm{i} 1}+0.4 \mathrm{X}_{\mathrm{i} 2}+0.6 \mathrm{X}_{\mathrm{i} 3}+0.8 \mathrm{X}_{\mathrm{i} 4}+1.1 \mathrm{X}_{\mathrm{i} 5}, 1\right), \mathrm{j}=11, \ldots, 15 \text{ and } \mathrm{i}=1, \ldots, 50$$
I am not sure how to express the covariance matrix.
The same applies to the y variable (target) which is given by the following formula.
$$Y_{i} \sim N\left(4+2 X_{i 1}-X_{i 5}+2.5 X_{i 7}+1.5 X_{i 11}+0.5 X_{i 13}, 1.5^{2}\right), i=1, \ldots, 50$$
Can this somehow be done with r norm package? It seems highly unlikely.