I know the code to generate two correlated variables (r=0.5), for example with 100 numbers each:
xy<-mvrnorm(100, mu=c(50,60), matrix(c(1,0.5,0.5,1),2))
But how can I simulate 1000 samples from a population with let's say rho=0.5. I guess it should work somehow with the replicate-function. After that I want to applicate the cor.test for the Spearman correlation coefficient.
Is it better two generate two variables (say 10.000 numbers each) and sample from this "population" or is it better two repeat the mvrnorm-function 1000 times? Is there a difference between these two methods?
Thanks for your answers!