Learn R Programming

qgraph (version 0.4.5)

qgraph.efa: qgraph.efa

Description

This function performs an Exploratory Factor Analysis (EFA) using the factanal (stats) function and sends the acquired factor loadings to qgraph.loadings.

Usage

qgraph.efa( cor, factors=1, rotation="promax", ...)

Arguments

cor
A correlation matrix
factors
The number of factors to extract
rotation
rotation to be used. Can be "varimax", "promax" or "none"
...
arguments passed to qgraph.loadings

References

https://sites.google.com/site/qgraphproject

See Also

qgraph qgraph.pca qgraph.loadings

Examples

Run this code
#### 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

# Run qgraph:
qgraph.efa(cor(Y),5,vsize=c(1,10))

# Show crossloadings:
qgraph.efa(cor(Y),5,crossloadings=T,cut=0,vsize=c(1,10))

# Wider plot with larger nodes:
Q=qgraph.efa(cor(Y),5,vsize=c(2,10),width=17)

# With measurement model:
groups=list(1:20,21:40,41:60,61:80,81:100)
names(groups)=LETTERS[1:5]

qgraph.efa(cor(Y),5,vsize=c(2,10),,Q,groups=groups,legend=FALSE)

# Circulair layout:
qgraph.efa(cor(Y),5,vsize=c(2,10),layout="circle",groups=groups,
	legend=FALSE)

Run the code above in your browser using DataLab