Hi there. This is not really working. Here what I have for the moment.
library(ecodist) x <- 1:100 y1 <- corgen(x=x, r=.85, epsilon=.01)$y y2 <- corgen(x=x, r=.5, epsilon=.01)$y y3 <- corgen(x=x, r=.25, epsilon=.01)$y a = poly(cbind(y1, y2, y3), degree=1) cor(a[,1], a[,2]) In that case, the correlation between y1 and y2 is the same as a[,1] and a[,2]. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Generation-of-correlated-variables-tp4475799p4475891.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.