Learn R Programming

EGAnet (version 0.9.6)

EGA.estimate: A Wrapper Function for EGA

Description

Estimates the number of dimensions of a given dataset/instrument using graphical lasso (EBICglasso.qgraph) or the Triangulated Maximally Filtered Graph (TMFG) method and the walktrap community detection algorithm (cluster_walktrap). The glasso regularization parameter is set via EBIC.

Usage

EGA.estimate(
  data,
  n = NULL,
  model = c("glasso", "TMFG"),
  algorithm = c("walktrap", "louvain"),
  steps = 4,
  cor = c("cor_auto", "pearson", "spearman"),
  ...
)

Arguments

data

A dataframe with the variables to be used in the analysis or a correlation matrix. If the data used is a correlation matrix, the argument n will need to be specified.

n

Integer. Sample size, if the data provided is a correlation matrix

model

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

algorithm

A string indicating the algorithm to use. Current options are:

steps

Number of steps to be used in cluster_walktrap algorithm. Defaults to 4.

cor

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.

...

Additional arguments to be passed to EBICglasso.qgraph or TMFG

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

References

Golino, H. F., & Epskamp, S. (2017). Exploratory graph analysis: A new approach for estimating the number of dimensions in psychological research. PloS one, 12(6), e0174035.. doi: 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: j.intell.2017.02.007

Golino, H., Shi, D., Christensen, A. P., Garrido, L. E., Nieto, M. D., Sadana, R., & Thiyagarajan, J. A. (in press). Investigating the performance of Exploratory Graph Analysis and traditional techniques to identify the number of latent factors: A simulation and tutorial. Psychological Methods. doi: 10.31234/osf.io/gzcre

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
ega.intel <- EGA.estimate(data = intelligenceBattery[,8:66], model = "glasso")
# }

Run the code above in your browser using DataLab