I would really appreciate if someone could help me with this question.
I want to simulate $n$ datasets in R with eight predictors where $β=(3,1.5, 0, 0, 2, 0, 0, 0)$ and the pairwise correlation between $x_i$ and $x_j$ is set to be $\text{corr}(i,~j) = 0.5$ for $i-j$ or for all $i=j$.
Best Answer
Here is a suggestion: