EGA.estimate: A Sub-routine Function for 'EGA'

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/EGA.estimate.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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:

  • walktrap Computes the Walktrap algorithm using cluster_walktrap

  • louvain Computes the Walktrap algorithm using cluster_louvain

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

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).

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

Author(s)

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

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. doi: 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.. doi: 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. doi: 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. doi: 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. doi: 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

1
2
3
4
5
6
7
8
9
# 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)

EGAnet documentation built on Feb. 17, 2021, 1:06 a.m.