EGA {EGAnet}  R Documentation 
Estimates the number of dimensions of a given dataset or correlation matrix
using the graphical lasso (EBICglasso.qgraph
) or the
Triangulated Maximally Filtered Graph (TMFG
)
network estimation methods.
EGA(
data,
n = NULL,
uni.method = c("expand", "LE"),
corr = c("cor_auto", "pearson", "spearman"),
model = c("glasso", "TMFG"),
model.args = list(),
algorithm = c("walktrap", "louvain"),
algorithm.args = list(),
plot.EGA = TRUE,
plot.type = c("GGally", "qgraph"),
plot.args = list(),
verbose = TRUE,
...
)
data 
Matrix or data frame.
Variables (down columns) or correlation matrix.
If the input is a correlation matrix,
then argument 
n 
Integer.
Sample size if 
uni.method 
Character.
What unidimensionality method should be used?
Defaults to

corr 
Type of correlation matrix to compute. The default uses

model 
Character.
A string indicating the method to use.
Defaults to

model.args 
List.
A list of additional arguments for 
algorithm 
A string indicating the algorithm to use or a function from

algorithm.args 
List.
A list of additional arguments for 
plot.EGA 
Boolean.
If 
plot.type 
Character.
Plot system to use.
Current options are 
plot.args 
List.
A list of additional arguments for the network plot.
For
For

verbose 
Boolean.
Should network estimation parameters be printed?
Defaults to 
... 
Additional arguments.
Used for deprecated arguments from previous versions of 
Two community detection algorithms, Walktrap (Pons & Latapy, 2006) and
Louvain (Blondel et al., 2008), are preprogrammed because of their
superior performance in simulation studies on psychological
data generated from factor models (Christensen & Golino; 2020; Golino et al., 2020).
Notably, any community detection algorithm from the igraph
can be used to estimate the number of communities (see examples).
Returns a list containing:
network 
A symmetric network estimated using either the

wc 
A vector representing the community (dimension) membership
of each node in the network. 
n.dim 
A scalar of how many total dimensions were identified in the network 
cor.data 
The zeroorder correlation matrix 
Hudson Golino <hfg9s at virginia.edu>, Alexander P. Christensen <alexpaulchristensen at gmail.com>, Maria Dolores Nieto <acinodam at gmail.com> and Luis E. Garrido <garrido.luiseduardo at gmail.com>
# Louvain algorithm
Blondel, V. D., Guillaume, J.L., Lambiotte, R., & Lefebvre, E. (2008).
Fast unfolding of communities in large networks.
Journal of Statistical Mechanics: Theory and Experiment, 2008, P10008.
# Compared all igraph community detections algorithms, introduced Louvain algorithm, simulation with continuous and polytomous data
# Also implements the Leading Eigenvalue unidimensional method
Christensen, A. P., Garrido, L. E., & Golino, H. (2021).
Comparing community detection algorithms in psychological data: A Monte Carlo simulation.
PsyArXiv.
# Original simulation and implementation of EGA
Golino, H. F., & Epskamp, S. (2017).
Exploratory graph analysis: A new approach for estimating the number of dimensions in psychological research.
PLoS ONE, 12, e0174035.
Golino, H. F., & Demetriou, A. (2017). Estimating the dimensionality of intelligence like data using Exploratory Graph Analysis. Intelligence, 62, 5470.
# Current implementation of EGA, introduced unidimensional checks, continuous and dichotomous data
Golino, H., Shi, D., Christensen, A. P., Garrido, L. E., Nieto, M. D., Sadana, R., & Thiyagarajan, J. A. (2020).
Investigating the performance of Exploratory Graph Analysis and traditional techniques to identify the number of latent factors: A simulation and tutorial.
Psychological Methods, 25, 292320.
# Walktrap algorithm
Pons, P., & Latapy, M. (2006).
Computing communities in large networks using random walks.
Journal of Graph Algorithms and Applications, 10, 191218.
bootEGA
to investigate the stability of EGA's estimation via bootstrap
and CFA
to verify the fit of the structure suggested by EGA using confirmatory factor analysis.
# Estimate EGA
## plot.type = "qqraph" used for CRAN checks
## plot.type = "GGally" is the default
ega.wmt < EGA(data = wmt2[,7:24], plot.type = "qgraph")
# Summary statistics
summary(ega.wmt)
# Estimate EGAtmfg
ega.wmt < EGA(data = wmt2[,7:24], model = "TMFG", plot.type = "qgraph")
# Estimate EGA with Louvain algorithm
ega.wmt < EGA(data = wmt2[,7:24], algorithm = "louvain", plot.type = "qgraph")
# Estimate EGA with Spinglass algorithm
ega.wmt < EGA(data = wmt2[,7:24],
algorithm = igraph::cluster_spinglass, plot.type = "qgraph")
# Estimate EGA
ega.intel < EGA(data = intelligenceBattery[,8:66], model = "glasso", plot.EGA = FALSE)
# Summary statistics
summary(ega.intel)