Displaying 1 result from an estimated 1 matches for "corelset".
Did you mean:
coreset
2007 Apr 05
1
Generate a serie of new vars that correlate with existingvar
...original code by Greg Snow
[mailto:Greg.Snow at intermountainmail.org]
# on April 04, 2007 1:46 AM
# generates ndistr vectors of same mean and sd, with various cor.coeffs
# input :
# x1 : a vector
# ndistr : number of distributions
# coefs : vector o ndistr correl. coeffs
CorelSets<-function(x1= rnorm(100, 15, 5),ndistr=3, coefs=c(0.4,0.5,0.6)){
# x2, x3, and x4 in a matrix, these will be modified to meet the criteria
x234 <- scale(matrix( rnorm(ndistr*length(x1)), ncol=ndistr ))
# put all into 1 matrix for simplicity
x1234 <- cbind(scale(x1),x234)
# find the cur...