Generating correlated numbers with predefined correlations I'm trying to generate correlated data (preferably multinormal) with predefined correlations (e.g. 0.35 or 0.9). Any idea how I can do it? I'm using R and I did find a way to generate this (using mvrnorm), but you need to supply a covariance matrix. I have a covariance matrix with correlations around 0.9; however, I don't know how I can modify its entries to change the correlation. If I can do that, I'll be able to generate correlated data with the correlations I need.  
Regards, 
 A: The MASS package has a function called mvrnorm() that can generate a group or random numbers to a specified level of correlation. An example of the setup can be found in the beginning of the example here: http://menugget.blogspot.de/2011/11/propagation-of-error.html
A: Actually this is a trap question: it sounds easy but it is not (+1). The short answer to your question is you can't.
I will give an example. Imagine you have 3 Gaussian variables $X_1, X_2$ and $X_3$. You want the correlation between $X_1$ and $X_2$ to be 0, and all correlations with $X_3$ to be 1. This is obviously impossible because $X_1 = X_3$ and $X_3 = X_1$ says that $X_1 = X_2$ (up to shifting and scaling), which contrasts with the assumption that they are independent!
You would have the same situation if you replace 0 by "close to 0" and 1 by "close to 1" in the previous example. The issue here is that not every matrix is a correlation matrix. The requirement for being a correlation matrix is to be symmetric and positive definite.
You cannot choose arbitrary correlation values, but you can check whether they define a valid correlation matrix. Say that you have a symmetric square matrix mat with required correlation coefficients. You can test that it is positive definite as shown below.
all(eigen(mat)$values >= 0)

For symmetric real matrices, positive definite is equivalent to having all eigenvalues positive.
