# NOT RUN {
#### VISUALIZE CORRELATION MATRIX ###
eta=matrix(rnorm(200*5),ncol=5)
lam=matrix(0,nrow=100,ncol=5)
for (i in 1:5) lam[(20*i-19):(20*i),i]=rnorm(20,0.7,0.3)
eps=matrix(rnorm(200*100),ncol=100)
Y=eta%*%t(lam)+eps
tooltips=paste("item",1:100)
groups=list(1:20,21:40,41:60,61:80,81:100)
names(groups)=paste("Factor",LETTERS[1:5])
# Run qgraph:
qgraph.svg(cor(Y),groups=groups,tooltips=tooltips,vsize=3)
# }
Run the code above in your browser using DataLab