I'm trying to create artificial correlated data using the genCorData function, in the simstudy package. I'm running the following in R:
set.seed(1234)
n=50
p=200
X=genCorData(n=n,mu=rep(0,p),sigma=rep(4,p),rho=0)
X=X[,-1]
beta = rnorm(p)
y <- as.matrix(X)%*%beta + rnorm(n) # calculate response
intercept <- mean(y)
y <- y - intercept
Why do I get the exact same X, and therefore, y, when I change the rho parameter. I've tried with 0, 0.3, and 0.9. They all lead to the same output. Why is this? And how do I generate correlated data?