EGA
Estimates the number of substantive dimensions after controlling for wording effects. EGA is applied to a residual correlation matrix after subtracting and random intercept factor with equal unstandardized loadings from all the regular and unrecoded reversed items in the database
riEGA(
data,
n = NULL,
uni.method = c("expand", "LE", "louvain"),
corr = c("cor_auto", "pearson", "spearman"),
model = c("glasso", "TMFG"),
model.args = list(),
algorithm = c("walktrap", "louvain"),
algorithm.args = list(),
consensus.iter = 100,
consensus.method = c("highest_modularity", "most_common", "iterative", "lowest_tefi"),
plot.EGA = TRUE,
plot.args = list(),
estimator = c("auto", "WLSMV", "MLR"),
lavaan.args = list()
)
Returns a list containing:
Results from EGA
A list containing information about the random-intercept model (if the model converged):
fit
The fit object for the random-intercept model using cfa
lavaan.args
The arguments used in cfa
loadings Standardized loadings from the random-intercept model
correlation Residual correlations after accounting for the random-intercept model
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.
Variables MUST be unrecoded -- reversed items should
remain reversed
Integer.
Sample size if data
provided is a correlation matrix
Character.
What unidimensionality method should be used?
Defaults to "louvain"
.
Current options are:
expand
Expands the correlation matrix with four variables correlated .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 is the method used in the Golino et al. (2020)
Psychological Methods simulation.
LE
Applies the Leading Eigenvalue algorithm (cluster_leading_eigen
)
on the empirical correlation matrix. If the number of dimensions is 1,
then the Leading Eigenvalue solution is used; otherwise, regular EGA
is used. This is the final method used in the Christensen, Garrido,
and Golino (2021) simulation.
louvain
Applies the Louvain algorithm (cluster_louvain
)
on the empirical correlation matrix using a resolution parameter = 0.95.
If the number of dimensions is 1, then the Louvain solution is used; otherwise,
regular EGA is used. This method was validated in the Christensen (2022) simulation.
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.
Character.
A string indicating the method to use.
Defaults to "glasso"
.
Current options are:
glasso
Estimates the Gaussian graphical model using graphical LASSO with
extended Bayesian information criterion to select optimal regularization parameter
TMFG
Estimates a Triangulated Maximally Filtered Graph
List.
A list of additional arguments for EBICglasso.qgraph
or TMFG
A string indicating the algorithm to use or a function from igraph
Defaults to "walktrap"
.
Current options are:
walktrap
Computes the Walktrap algorithm using cluster_walktrap
louvain
Computes the Louvain algorithm using cluster_louvain
List.
A list of additional arguments for cluster_walktrap
, cluster_louvain
,
or some other community detection algorithm function (see examples)
Numeric.
Number of iterations to perform in consensus clustering for the Louvain algorithm
(see Lancichinetti & Fortunato, 2012).
Defaults to 100
Character.
What consensus clustering method should be used?
Defaults to "highest_modularity"
.
Current options are:
highest_modularity
Uses the community solution that achieves the highest modularity
across iterations
most_common
Uses the community solution that is found the most
across iterations
iterative
Identifies the most common community solutions across iterations
and determines how often nodes appear in the same community together.
A threshold of 0.30 is used to set low proportions to zero.
This process repeats iteratively until all nodes have a proportion of
1 in the community solution.
lowest_tefi
Uses the community solution that achieves the lowest tefi
across iterations
Boolean.
If TRUE
, returns a plot of the network and its estimated dimensions.
Defaults to TRUE
List.
A list of additional arguments for the network plot.
For plot.type = "qgraph"
:
vsize
Size of the nodes. Defaults to 6.
For plot.type = "GGally"
(see ggnet2
for
full list of arguments):
vsize
Size of the nodes. Defaults to 6.
label.size
Size of the labels. Defaults to 5.
alpha
The level of transparency of the nodes, which might be a single value or a vector of values. Defaults to 0.7.
edge.alpha
The level of transparency of the edges, which might be a single value or a vector of values. Defaults to 0.4.
legend.names
A vector with names for each dimension
color.palette
The color palette for the nodes. For custom colors,
enter HEX codes for each dimension in a vector.
See color_palette_EGA
for
more details and examples
Character.
Estimator to use for random-intercept model (see Estimators
for more details).
Defaults to "auto"
, which selects "MLR"
for continuous data and
"WLSMV"
for mixed and categorical data.
Data are considered continuous data if they have 6 or
more categories (see Rhemtulla, Brosseau-Liard, & Savalei, 2012)
List.
If reduce.method = "latent"
, then lavaan
's cfa
function will be used to create latent variables to reduce variables.
Arguments should be input as a list. Some example arguments
(see lavOptions for full details
)
Alejandro Garcia-Pardina <alejandrogp97@gmail.com>, Francisco J. Abad <fjose.abad@uam.es>, Alexander P. Christensen <alexpaulchristensen@gmail.com>, Hudson Golino <hfg9s at virginia.edu>, Luis Eduardo Garrido <luisgarrido@pucmm.edu.do>, and Robert Moulder <rgm4fd@virginia.edu>
# Selection of CFA Estimator
Rhemtulla, M., Brosseau-Liard, P. E., & Savalei, V. (2012).
When can categorical variables be treated as continuous? A comparison of robust continuous and categorical SEM estimation methods under suboptimal conditions.
Psychological Methods, 17, 354-373.
# Obtain example data
data <- optimism
if (FALSE) # riEGA example
opt.res <- riEGA(data = optimism)
Run the code above in your browser using DataLab