[R] creating a multivariate set of variables with given intercorrelations

Adaikalavan Ramasamy ramasamy at cancer.org.uk
Sun May 20 04:40:31 CEST 2007


I presume you want to generate normally or t-distributed values ? If so 
either have a look mvrnorm in the MASS package or the mvtnorm package.



Dimitri Liakhovitski wrote:
> Hi!
> I was wondering if there is a package in R that allows one to create a
> multivariate data set with pre-specified intercorrelations among
> variables, e.g., a set of 4 variables (with a length of N each), such
> that the correlations between variables are:
> 
>      a     b     c     d
> a   1     r1    r2    r3
> b          1     r4    r5
> c                 1     r6
> d                         1
> 
> Thank you very much!
> Dimitri Liakhovitski
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 
>



More information about the R-help mailing list