Skip to contents

Estimates EGA using the lower-order solution of the Louvain algorithm (cluster_louvain)to identify the lower-order dimensions and then uses factor or network loadings to estimate factor or network scores, which are used to estimate the higher-order dimensions (for more details, see Jiménez et al., 2023)


  loading.method = c("BRM", "experimental"),
  rotation = NULL,
  scores = c("factor", "network"),
  loading.structure = c("simple", "full"),
  impute = c("mean", "median", "none"),
  corr = c("auto", "cor_auto", "pearson", "spearman"), = c("pairwise", "listwise"),
  model = c("BGGM", "glasso", "TMFG"),
  lower.algorithm = "louvain",
  higher.algorithm = c("leiden", "louvain", "walktrap"),
  uni.method = c("expand", "LE", "louvain"),
  plot.EGA = TRUE,
  verbose = FALSE,



Matrix or data frame. Should consist only of variables to be used in the analysis (does not accept correlation matrices)


Character (length = 1). Sets network loading calculation based on implementation described in "BRM" (Christensen & Golino, 2021) or an "experimental" implementation. Defaults to "BRM"


Character. A rotation to use to obtain a simpler structure. For a list of rotations, see rotations for options. Defaults to NULL or no rotation. By setting a rotation, scores estimation will be based on the rotated loadings rather than unrotated loadings


Character (length = 1). How should scores for the higher-order structure be estimated? Defaults to "network" for network scores computed using the net.scores function. Set to "factor" for factor scores computed using fa. Factors scores will be based on EFA (as in Jiménez et al., 2023)

Factor scores use the number of communities from EGA. Estimated factor loadings may not align with these communities. The plots using factor scores will have higher order factors that may not completely map on to the lower order communities. Look at $hierarchical$higher_order$lower_loadings to determine the composition of the lower order factors.


Character (length = 1). Whether simple structure or the saturated loading matrix should be used when computing scores (scores = "network" only). Defaults to "simple"

"simple" structure more closely mirrors traditional hierarchical factor analytic methods such as CFA; "full" structure more closely mirrors EFA methods

Simple structure is the more conservative (established) approach and is therefore the default. Treat "full" as experimental as proper vetting and validation has not been established


Character (length = 1). If there are any missing data, then imputation can be implemented. Available options:

  • "none" --- Default. No imputation is performed

  • "mean" --- The mean value of each variable is used to replace missing data for that variable

  • "median" --- The median value of each variable is used to replace missing data for that variable


Character (length = 1). Method to compute correlations. Defaults to "auto". Available options:

  • "auto" --- Automatically computes appropriate correlations for the data using Pearson's for continuous, polychoric for ordinal, tetrachoric for binary, and polyserial/biserial for ordinal/binary with continuous. To change the number of categories that are considered ordinal, use ordinal.categories (see polychoric.matrix for more details)

  • "cor_auto" --- Uses cor_auto to compute correlations. Arguments can be passed along to the function

  • "pearson" --- Pearson's correlation is computed for all variables regardless of categories

  • "spearman" --- Spearman's rank-order correlation is computed for all variables regardless of categories

For other similarity measures, compute them first and input them into data with the sample size (n)

Character (length = 1). How should missing data be handled? Defaults to "pairwise". Available options:

  • "pairwise" --- Computes correlation for all available cases between two variables

  • "listwise" --- Computes correlation for all complete cases in the dataset


Character (length = 1). Defaults to "glasso". Available options:

  • "BGGM" --- Computes the Bayesian Gaussian Graphical Model. Set argument ordinal.categories to determine levels allowed for a variable to be considered ordinal. See ?BGGM::estimate for more details

  • "glasso" --- Computes the GLASSO with EBIC model selection. See EBICglasso.qgraph for more details

  • "TMFG" --- Computes the TMFG method. See TMFG for more details


Character or igraph cluster_* function (length = 1). Defaults to the lower order "louvain" with most common consensus clustering (1000 iterations; see community.consensus for more details)

Louvain with consensus clustering is strongly recommended. Using any other algorithm is considered experimental as they have not been designed to capture lower order communities


Character or igraph cluster_* function (length = 1). Defaults to "walktrap". Three options are listed below but all are available (see community.detection for other options):

  • "leiden" --- See cluster_leiden for more details

  • "louvain" --- By default, "louvain" will implement the Louvain algorithm using the consensus clustering method (see community.consensus for more information). This function will implement consensus.method = "most_common" and consensus.iter = 1000 unless specified otherwise

  • "walktrap" --- See cluster_walktrap for more details

Using algorithm will set only higher.algorithm and lower.algorithm will default to Louvain with most common consensus clustering (1000 iterations)


Character (length = 1). What unidimensionality method should be used? Defaults to "louvain". Available options:

  • "expand" --- Expands the correlation matrix with four variables correlated 0.50. If number of dimension returns 2 or less in check, then the data are unidimensional; otherwise, regular EGA with no matrix expansion is used. This method was used in the Golino et al.'s (2020) Psychological Methods simulation

  • "LE" --- Applies the Leading Eigenvector algorithm (cluster_leading_eigen) on the empirical correlation matrix. If the number of dimensions is 1, then the Leading Eigenvector solution is used; otherwise, regular EGA is used. This method was used in the Christensen et al.'s (2023) Behavior Research Methods simulation

  • "louvain" --- Applies the Louvain algorithm (cluster_louvain) on the empirical correlation matrix. If the number of dimensions is 1, then the Louvain solution is used; otherwise, regular EGA is used. This method was validated Christensen's (2022) PsyArXiv simulation. Consensus clustering can be used by specifying either "consensus.method" or "consensus.iter"


Boolean. If TRUE, returns a plot of the network and its estimated dimensions. Defaults to TRUE


Boolean (length = 1). Whether messages and (insignificant) warnings should be output. Defaults to FALSE (silent calls). Set to TRUE to see all messages and warnings for every function call


Additional arguments to be passed on to auto.correlate, network.estimation, community.detection, community.consensus, EGA, and rotations


Returns a list of lists containing:


EGA results for the lower order structure


EGA results for the higher order structure


A list containing lower_loadings and lower_scores that were used to estimate scores and the higher order EGA results, respectively


A data frame with variable names and their lower and higher order assignments


Generalized TEFI using tefi


Plot output if plot.EGA = TRUE


Hierarchical EGA simulation
Jiménez, M., Abad, F. J., Garcia-Garzon, E., Golino, H., Christensen, A. P., & Garrido, L. E. (2023). Dimensionality assessment in bifactor structures with multiple general factors: A network psychometrics approach. Psychological Methods.

Conceptual implementation
Golino, H., Thiyagarajan, J. A., Sadana, R., Teles, M., Christensen, A. P., & Boker, S. M. (2020). Investigating the broad domains of intrinsic capacity, functional ability and environment: An exploratory graph analysis approach for improving analytical methodologies for measuring healthy aging. PsyArXiv.

See also

plot.EGAnet for plot usage in EGAnet


Marcos Jiménez <marcosjnezhquez@gmailcom>, Francisco J. Abad <>, Eduardo Garcia-Garzon <>, Hudson Golino <>, Alexander P. Christensen <>, and Luis Eduardo Garrido <>


# Example using network scores
opt.hier <- hierEGA(
  data = optimism, scores = "network",
  plot.EGA = FALSE # No plot for CRAN checks
#> Warning: This implementation of `hierEGA` is experimental. 
#> The underlying function and/or output may change until the results have been appropriately vetted and validated.

# \donttest{
# Plot multilevel plot
plot(opt.hier, plot.type = "multilevel")

# Plot multilevel plot with higher order
# border color matching the corresponding
# lower order color
plot(opt.hier, color.match = TRUE)

# Plot levels separately
plot(opt.hier, plot.type = "separate")# }