Learn R Programming

EGAnet (version 1.2.3)

EGA.estimate: A Sub-routine Function for EGA

Description

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.

Usage

EGA.estimate(
  data,
  n = NULL,
  corr = c("cor_auto", "pearson", "spearman"),
  model = c("glasso", "TMFG"),
  model.args = list(),
  algorithm = c("walktrap", "leiden", "louvain"),
  algorithm.args = list(),
  consensus.method = c("highest_modularity", "most_common", "iterative", "lowest_tefi"),
  consensus.iter = 100,
  ...
)

Value

Returns a list containing:

estimated.network

A symmetric network estimated using either the EBICglasso.qgraph or TMFG

wc

A vector representing the community (dimension) membership of each node in the network. NA values mean that the node was disconnected from the network

n.dim

A scalar of how many total dimensions were identified in the network

cor.data

The zero-order correlation matrix

Arguments

data

Matrix or data frame. Variables (down columns) or correlation matrix. If the input is a correlation matrix, then argument n (number of cases) is required

n

Integer. Sample size if data provided is a correlation matrix

corr

Type of correlation matrix to compute. The default uses cor_auto. Current options are:

  • cor_auto Computes the correlation matrix using the cor_auto function from qgraph.

  • pearson Computes Pearson's correlation coefficient using the pairwise complete observations via the cor function.

  • spearman Computes Spearman's correlation coefficient using the pairwise complete observations via the cor function.

model

Character. A string indicating the method to use.

Current options are:

  • glasso Estimates the Gaussian graphical model using graphical LASSO with extended Bayesian information criterion to select optimal regularization parameter. This is the default method

  • TMFG Estimates a Triangulated Maximally Filtered Graph

model.args

List. A list of additional arguments for EBICglasso.qgraph or TMFG

algorithm

A string indicating the algorithm to use or a function from igraph Current options are:

algorithm.args

List. A list of additional arguments for cluster_walktrap, cluster_louvain, or some other community detection algorithm function (see examples)

consensus.method

Character. What consensus clustering method should be used? Defaults to "highest_modularity". Current options are:

  • highest_modularity Uses the community solution that achieves the highest modularity across iterations

  • most_common Uses the community solution that is found the most across iterations

  • iterative Identifies the most common community solutions across iterations and determines how often nodes appear in the same community together. A threshold of 0.30 is used to set low proportions to zero. This process repeats iteratively until all nodes have a proportion of 1 in the community solution.

  • lowest_tefi Uses the community solution that achieves the lowest tefi across iterations

consensus.iter

Numeric. Number of iterations to perform in consensus clustering for the Louvain algorithm (see Lancichinetti & Fortunato, 2012). Defaults to 100

...

Additional arguments. Used for deprecated arguments from previous versions of EGA

Author

Alexander P. Christensen <alexpaulchristensen at gmail.com> and Hudson Golino <hfg9s at virginia.edu>

Details

Two community detection algorithms, Walktrap (Pons & Latapy, 2006) and Louvain (Blondel et al., 2008), are pre-programmed 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).

References

# 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
Christensen, A. P., & Golino, H. (under review). Estimating factors with psychometric networks: A Monte Carlo simulation comparing community detection algorithms. 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, 54-70.

# 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, 292-320.

# Walktrap algorithm
Pons, P., & Latapy, M. (2006). Computing communities in large networks using random walks. Journal of Graph Algorithms and Applications, 10, 191-218.

See Also

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.

Examples

Run this code
# Obtain data
wmt <- wmt2[,7:24]

if (FALSE) {
# Estimate EGA
ega.wmt <- EGA.estimate(data = wmt)

# Estimate EGAtmfg
ega.wmt.tmfg <- EGA.estimate(data = wmt, model = "TMFG")

# Estimate EGA with Louvain algorithm
ega.wmt.louvain <- EGA.estimate(data = wmt, algorithm = "louvain")

# Estimate EGA with Spinglass algorithm
ega.wmt.spinglass <- EGA.estimate(
  data = wmt,
  algorithm = igraph::cluster_spinglass # any {igraph} algorithm
)}

Run the code above in your browser using DataLab