Learn R Programming

EGAnet (version 0.9.8)

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,
  model = c("glasso", "TMFG"),
  model.args = list(),
  algorithm = c("walktrap", "louvain"),
  algorithm.args = list(),
  corr = c("cor_auto", "pearson", "spearman"),
  verbose = TRUE,
  ...
)

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

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)

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.

verbose

Boolean. Should network estimation parameters be printed? Defaults to TRUE. Set to FALSE for no print out

...

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

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

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. 10.31234/osf.io/hz89e

# 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.. 10.1371/journal.pone.0174035

Golino, H. F., & Demetriou, A. (2017). Estimating the dimensionality of intelligence like data using Exploratory Graph Analysis. Intelligence, 62, 54-70. 10.1016/j.intell.2017.02.007

# 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. 10.1037/met0000255

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

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
# NOT RUN {
# }
# NOT RUN {
# Estimate EGA
ega.wmt <- EGA.estimate(data = wmt2[,7:24], model = "glasso")

# Estimate EGAtmfg
ega.wmt <- EGA.estimate(data = wmt2[,7:24], model = "TMFG")

# Estimate EGA with Spinglass
ega.wmt <- EGA.estimate(data = wmt2[,7:24], model = "glasso",
algorithm = igraph::cluster_spinglass)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab