Learn R Programming

EGAnet (version 0.9.6)

EGA.fit: EGA Optimal Model Fit using the Total Entropy Fit Index (tefi)

Description

Estimates the best fitting model using EGA. The number of steps in the cluster_walktrap detection algorithm is varied and unique community solutions are compared using tefi. Also computes cluster_louvain community detection algorithm.

Usage

EGA.fit(
  data,
  model = c("glasso", "TMFG"),
  steps = c(3, 4, 5, 6, 7, 8),
  n = NULL
)

Arguments

data

A dataset (or a correlation matrix).

model

Character. A string indicating the method to use. Defaults to "glasso".

steps

Numeric vector. Range of steps to be used in the model selection. Defaults from 3 to 8 steps (based on Pons & Latapy, 2006)

n

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

Current options are:

  • "glasso" Estimates the Gaussian graphical model using graphical LASSO with extended Bayesian information criterion to select optimal regularization parameter. See EBICglasso.qgraph

  • "TMFG" Estimates a Triangulated Maximally Filtered Graph. See TMFG

Value

Returns a list containing:

EGA

The EGA output for the best fitting model

steps

The number of steps used in the best fitting model from the cluster_walktrap algorithm

EntropyFit

The tefi Index for the unique solutions given the range of steps (vector names represent the number of steps)

Lowest.EntropyFit

The lowest value for the tefi Index

References

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, EGA to estimate the number of dimensions of an instrument using EGA, and CFA to verify the fit of the structure suggested by EGA using confirmatory factor analysis.

Examples

Run this code
# NOT RUN {
# Load data
wmt <- wmt2[,7:24]

# }
# NOT RUN {
# Estimate normal EGAtmfg
tmfg <- EGA(data = wmt, model = "TMFG")

# Estimate optimal EGAtmfg
tmfg.opt <- EGA.fit(data = wmt, model = "TMFG")

# Compare with CFA
cfa.tmfg <- CFA(tmfg, estimator = "WLSMV", data = wmt)
cfa.opt <- CFA(tmfg.opt$EGA, estimator = "WLSMV", data = wmt)

lavaan::lavTestLRT(cfa.tmfg$fit, cfa.opt$fit, method = "satorra.bentler.2001")

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab