Learn R Programming

EGAnet (version 0.5)

bootEGA: Stability Analysis of EGA

Description

bootEGA Estimates the number of dimensions of n bootstraps from the empirical correlation matrix and returns a typical network (i.e. the network formed by the median or mean pairwise correlations over the n bootstraps) and its dimensionality.

Usage

bootEGA(data, n, model = c("glasso", "TMFG"), type = c("parametric",
  "resampling"), typicalStructure = TRUE, plot.typicalStructure = TRUE,
  ncores = 4, ...)

Arguments

data

A dataframe with the variables to be used in the analysis

n

An integer value representing the number of bootstraps

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

type

A string indicating the type of bootstrap to use. Current options are:

  • parametric Generates n new datasets (multivariate normal random distributions) based on the original dataset, via the Mvnorm function of the mvtnorm package

  • resampling Generates n random subsamples of the original data

typicalStructure

Logical. If true, returns the typical network of partial correlations (estimated via graphical lasso or via TMFG) and estimates its dimensions. The "typical network" is the median of all pairwise correlations over the n bootstraps. Defaults to TRUE

plot.typicalStructure

Logical. If true, returns a plot of the typical network (partial correlations), which is the median of all pairwise correlations over the n bootstraps, and its estimated dimensions. Defaults to TRUE

ncores

Number of cores to use in computing results. Set to 1 to not use parallel computing

...

Additional arguments to be passed to EBICglasso.qgraph or TMFG

Value

Returns a list containing:

n

Number of replica samples in bootstrap

boot.ndim

Number of dimensions identified in each replica sample

boot.wc

Item allocation for each replica sample

bootGraphs

Networks of each replica sample

summary.table

Summary table containing number of replica samples, median, standard deviation, standard error, and 95% confidence intervals

likelihood

Proportion of times the number of dimensions was identified (e.g., .85 of 1,000 = 850 times that specific number of dimensions was found)

EGA

Output of the original EGA results

typicalGraph

A list containing:

  • graph Network matrix of the median network structure

  • typical.dim.variables An ordered matrix of item allocation

  • wc Item allocation of the median network

See Also

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 {
#bootEGA glasso example
boot.wmt <- bootEGA(data = wmt2[,7:24], n = 500, typicalStructure = TRUE,
plot.typicalStructure = TRUE, model = "glasso", type = "parametric", ncores = 4)

#bootEGA TMFG example
boot.intwl <- bootEGA(data = intelligenceBattery[,8:66], n = 500, typicalStructure = TRUE,
plot.typicalStructure = TRUE, model = "TMFG", type = "parametric", ncores = 4)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab