bootEGA: Dimension Stability Analysis of 'EGA'

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/bootEGA.R

Description

bootEGA Estimates the number of dimensions of n bootstraps using the empirical (partial) correlation matrix (parametric) or resampling from the empirical dataset (non-parametric). It also estimates a typical median network structure, which is formed by the median or mean pairwise (partial) correlations over the n bootstraps.

Usage

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

Arguments

data

Matrix or data frame. Includes the variables to be used in the bootEGA analysis

n

Numeric integer. Number of replica samples to generate from the bootstrap analysis. At least 500 is recommended

model

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. See EBICglasso.qgraph

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

type

Character. 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

Boolean. 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

Boolean. 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

Numeric. Number of cores to use in computing results. Defaults to 4. Set to 1 to not use parallel computing. Recommended to use maximum number of cores minus one

If you're unsure how many cores your computer has, then use the following code: parallel::detectCores()

...

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

frequency

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

Author(s)

Hudson F. Golino <hfg9s at virginia.edu> and Alexander P. Christensen <[email protected]>

References

Christensen, A. P., & Golino, H. F. (2019). Estimating the stability of the number of factors via Bootstrap Exploratory Graph Analysis: A tutorial. PsyArXiv. doi:10.31234/osf.io/9deay

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Load data
wmt <- wmt2[,7:24]

## Not run: 

# bootEGA glasso example
boot.wmt <- bootEGA(data = wmt, n = 500, typicalStructure = TRUE,
plot.typicalStructure = TRUE, model = "glasso", type = "parametric", ncores = 4)

## End(Not run)

# Load data
intwl <- intelligenceBattery[,8:66]

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


## End(Not run)

hfgolino/EGA documentation built on Sept. 17, 2019, 1:36 p.m.