bootEGA | R Documentation |
bootEGA
Estimates the number of dimensions of iter
bootstraps
using the empirical zero-order correlation matrix ("parametric"
) or
"resampling"
from the empirical dataset (non-parametric). bootEGA
estimates a typical median network structure, which is formed by the median or
mean pairwise (partial) correlations over the iter bootstraps (see
Details for information about the typical median network structure).
bootEGA(
data,
n = NULL,
corr = c("auto", "cor_auto", "cosine", "pearson", "spearman"),
na.data = c("pairwise", "listwise"),
model = c("BGGM", "glasso", "TMFG"),
algorithm = c("leiden", "louvain", "walktrap"),
uni.method = c("expand", "LE", "louvain"),
iter = 500,
type = c("parametric", "resampling"),
ncores,
EGA.type = c("EGA", "EGA.fit", "hierEGA", "riEGA"),
plot.itemStability = TRUE,
typicalStructure = FALSE,
plot.typicalStructure = FALSE,
seed = NULL,
verbose = TRUE,
...
)
data |
Matrix or data frame. Should consist only of variables to be used in the analysis |
n |
Numeric (length = 1).
Sample size if |
corr |
Character (length = 1).
Method to compute correlations.
Defaults to
For other similarity measures, compute them first and input them
into |
na.data |
Character (length = 1).
How should missing data be handled?
Defaults to
|
model |
Character (length = 1).
Defaults to
|
algorithm |
Character or
|
uni.method |
Character (length = 1).
What unidimensionality method should be used?
Defaults to
|
iter |
Numeric (length = 1).
Number of replica samples to generate from the bootstrap analysis.
Defaults to |
type |
Character (length = 1).
What type of bootstrap should be performed?
Defaults to
|
ncores |
Numeric (length = 1).
Number of cores to use in computing results.
Defaults to If you're unsure how many cores your computer has,
then type: |
EGA.type |
Character (length = 1).
Type of EGA model to use.
Defaults to
Arguments for |
plot.itemStability |
Boolean (length = 1).
Should the plot be produced for |
typicalStructure |
Boolean (length = 1).
If |
plot.typicalStructure |
Boolean (length = 1).
If |
seed |
Numeric (length = 1).
Defaults to |
verbose |
Boolean (length = 1).
Should progress be displayed?
Defaults to |
... |
Additional arguments that can be passed on to
|
The typical network structure is derived from the median (or mean) value of each pairwise relationship. These values tend to reflect the "typical" value taken by an edge across the bootstrap networks. Afterward, the same community detection algorithm is applied to the typical network as the bootstrap networks.
Because the community detection algorithm is applied to the typical network structure,
there is a possibility that the community algorithm determines
a different number of dimensions than the median number derived from the bootstraps.
The typical network structure (and number of dimensions) may not
match the empirical EGA
number of dimensions or
the median number of dimensions from the bootstrap. This result is known
and not a bug.
Returns a list containing:
iter |
Number of replica samples in bootstrap |
bootGraphs |
A list containing the networks of each replica sample |
boot.wc |
A matrix of membership assignments for each replica network with variables down the columns and replicas across the rows |
boot.ndim |
Number of dimensions identified in each replica sample |
summary.table |
A data frame containing number of replica samples, median, standard deviation, standard error, 95% confidence intervals, and quantiles (lower = 2.5% and upper = 97.5%) |
frequency |
A data frame containing the proportion of times the number of dimensions was identified (e.g., .85 of 1,000 = 850 times that specific number of dimensions was found) |
TEFI |
|
type |
Type of bootstrap used |
EGA |
Output of the empirical EGA results
(output will vary based on |
EGA.type |
Type of |
typicalGraph |
A list containing:
|
plot.typical.ega |
Plot output if |
Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>
Original implementation of bootEGA
Christensen, A. P., & Golino, H. (2021).
Estimating the stability of the number of factors via Bootstrap Exploratory Graph Analysis: A tutorial.
Psych, 3(3), 479-500.
itemStability
to estimate the stability of
the variables in the empirical dimensions and
dimensionStability
to estimate the stability of
the dimensions (structural consistency)
# Load data
wmt <- wmt2[,7:24]
## Not run:
# Standard EGA parametric example
boot.wmt <- bootEGA(
data = wmt, iter = 500,
type = "parametric", ncores = 2
)
# Standard resampling example
boot.wmt <- bootEGA(
data = wmt, iter = 500,
type = "resampling", ncores = 2
)
# Example using {igraph} `cluster_*` function
boot.wmt.spinglass <- bootEGA(
data = wmt, iter = 500,
algorithm = igraph::cluster_spinglass,
# use any function from {igraph}
type = "parametric", ncores = 2
)
# EGA fit example
boot.wmt.fit <- bootEGA(
data = wmt, iter = 500,
EGA.type = "EGA.fit",
type = "parametric", ncores = 2
)
# Hierarchical EGA example
boot.wmt.hier <- bootEGA(
data = wmt, iter = 500,
EGA.type = "hierEGA",
type = "parametric", ncores = 2
)
# Random-intercept EGA example
boot.wmt.ri <- bootEGA(
data = wmt, iter = 500,
EGA.type = "riEGA",
type = "parametric", ncores = 2
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.