Skip to content

Commit

Permalink
Merge branch 'no-cpp'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexChristensen committed Aug 7, 2023
2 parents e48c105 + dea5a54 commit aa73cb9
Show file tree
Hide file tree
Showing 144 changed files with 22,083 additions and 12,384 deletions.
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
^\.git$
^\.github$
^\.Rproj\.user$
^Readme\.md$

38 changes: 24 additions & 14 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
Package: EGAnet
Title: Exploratory Graph Analysis – a Framework for Estimating the Number of Dimensions in Multivariate Data using Network Psychometrics
Version: 1.2.5.1
Date: 2023-03-23
Version: 2.0.0
Date: 2023-08-07
Authors@R: c(person("Hudson", "Golino", email = "hfg9s@virginia.edu", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-1601-1447")),
person("Alexander", "Christensen", email = "alexpaulchristensen@gmail.com", role = "aut", comment = c(ORCID = "0000-0002-9798-7037")),
person("Robert", "Moulder", email = "rgm4fd@virginia.edu", role = "ctb", comment = c(ORCID = "0000-0001-7504-9560")),
person("Luis", "E. Garrido", email = "garrido.luiseduardo@gmail.com", role = "ctb", comment = c(ORCID = "0000-0001-8932-6063")),
person("Laura", "Jamison", email = "lj5yn@virginia.edu", role = "ctb", comment = c(ORCID = "0000-0002-4656-8684")))
person("Laura", "Jamison", email = "lj5yn@virginia.edu", role = "ctb", comment = c(ORCID = "0000-0002-4656-8684")),
person("Dingjing", "Shi", email = "dshi@ou.edu", role = "ctb", comment = c(ORCID = "0000-0002-5652-3818")))
Maintainer: Hudson Golino <hfg9s@virginia.edu>
Description: Implements the Exploratory Graph Analysis (EGA) framework for dimensionality and psychometric assessment. EGA is part of a new area called network psychometrics that uses undirected network models for the assessment of psychometric properties. EGA estimates the number of dimensions (or factors) using graphical lasso or Triangulated Maximally Filtered Graph (TMFG) and a weighted network community detection algorithm. A bootstrap method for verifying the stability of the dimensions and items in those dimensions is available. The fit of the structure suggested by EGA can be verified using Entropy Fit Indices. A novel approach called Unique Variable Analysis (UVA) can be used to identify and reduce redundant variables in multivariate data. Network loadings, which are roughly equivalent to factor loadings when the data generating model is a factor model, are available. Network scores can also be computed using the network loadings. Dynamic EGA (dynEGA) will estimate dimensions from time series data for individual, group, and sample levels. Golino, H., & Epskamp, S. (2017) <doi:10.1371/journal.pone.0174035>. Golino, H., Shi, D., Christensen, A. P., Garrido, L. E., Nieto, M. D., Sadana, R., & Thiyagarajan, J. A. (2020) <doi:10.31234/osf.io/gzcre>. Christensen, A. P., & Golino, H. (under review) <doi:10.31234/osf.io/hz89e>. Golino, H., Moulder, R. G., Shi, D., Christensen, A. P., Garrido, L. E., Nieto, M. D., Nesselroade, J., Sadana, R., Thiyagarajan, J. A., & Boker, S. M. (2020) <doi:10.31234/osf.io/mtka2>. Christensen, A. P. & Golino, H. (2021) <doi:10.3390/psych3030032>. Christensen, A. P., Garrido, L. E., & Golino, H. (under review) <doi:10.31234/osf.io/4kra2>. Golino, H., Christensen, A. P., Moulder, R. G., Kim, S., & Boker, S. M. (under review) <doi:10.31234/osf.io/tfs7c>.
Description: Implements the Exploratory Graph Analysis (EGA) framework for dimensionality
and psychometric assessment. EGA estimates the number of dimensions in
psychological data using network estimation methods and community detection
algorithms. A bootstrap method is provided to assess the stability of dimensions
and items. Fit is evaluated using the Entropy Fit family of indices. Unique
Variable Analysis evaluates the extent to which items are locally dependent (or
redundant). Network loadings provide similar information to factor loadings and
can be used to compute network scores. A bootstrap and permutation approach are
available to assess configural and metric invariance. Hierarchical structures
can be detected using Hierarchical EGA. Time series and intensive longitudinal
data can be analyzed using Dynamic EGA, supporting individual, group, and
population level assessments.
Depends: R (>= 3.5.0)
License: GPL (>= 3.0)
Encoding: UTF-8
LazyData: true
Imports: glasso, GGally, ggdendro,
ggplot2, ggpubr, igraph (>= 1.3.0), lavaan,
Matrix, matrixcalc, methods,
network, pbapply, qgraph,
semPlot, stats
Suggests: fungible, GPArotation, gridExtra, knitr,
markdown, psych, psychTools, pwr,
RColorBrewer, rmarkdown, rstudioapi,
sna
VignetteBuilder: knitr
Imports: BGGM, future, future.apply, glasso, GGally,
ggdendro, ggplot2, ggpubr, GPArotation,
igraph (>= 1.3.0), lavaan, Matrix, methods,
network, progressr, qgraph, semPlot, sna, stats
Suggests: fungible, knitr, markdown,
pbapply, progress, psych, pwr, RColorBrewer
Byte-Compile: true
BugReports: https://github.com/hfgolino/EGAnet/issues
RoxygenNote: 7.2.3
78 changes: 58 additions & 20 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,32 +1,60 @@
# Generated by roxygen2: do not edit by hand

S3method(plot,CFA)
S3method(plot,EGA)
S3method(plot,EGA.estimate)
S3method(plot,EGA.fit)
S3method(plot,boot.ergoInfo)
S3method(plot,bootEGA)
S3method(plot,dynEGA)
S3method(plot,dynEGA.Groups)
S3method(plot,dynEGA.Individuals)
S3method(plot,dynEGA.Group)
S3method(plot,dynEGA.Individual)
S3method(plot,dynEGA.Population)
S3method(plot,hierEGA)
S3method(plot,infoCluster)
S3method(plot,invariance)
S3method(print,Descriptives)
S3method(plot,itemStability)
S3method(plot,riEGA)
S3method(print,EGA)
S3method(print,NetLoads)
S3method(print,EGA.community)
S3method(print,EGA.consensus)
S3method(print,EGA.estimate)
S3method(print,EGA.fit)
S3method(print,EGA.network)
S3method(print,EII)
S3method(print,UVA)
S3method(print,boot.ergoInfo)
S3method(print,bootEGA)
S3method(print,dimensionStability)
S3method(print,dynEGA)
S3method(print,dynEGA.Groups)
S3method(print,dynEGA.Individuals)
S3method(print,dynEGA.Group)
S3method(print,dynEGA.Individual)
S3method(print,dynEGA.Population)
S3method(print,hierEGA)
S3method(print,infoCluster)
S3method(print,invariance)
S3method(print,itemStability)
S3method(print,net.loads)
S3method(print,riEGA)
S3method(summary,Descriptives)
S3method(summary,EGA)
S3method(summary,NetLoads)
S3method(summary,EGA.community)
S3method(summary,EGA.consensus)
S3method(summary,EGA.estimate)
S3method(summary,EGA.fit)
S3method(summary,EGA.network)
S3method(summary,EII)
S3method(summary,UVA)
S3method(summary,boot.ergoInfo)
S3method(summary,bootEGA)
S3method(summary,dimensionStability)
S3method(summary,dynEGA)
S3method(summary,dynEGA.Groups)
S3method(summary,dynEGA.Individuals)
S3method(summary,dynEGA.Group)
S3method(summary,dynEGA.Individual)
S3method(summary,dynEGA.Population)
S3method(summary,hierEGA)
S3method(summary,infoCluster)
S3method(summary,invariance)
S3method(summary,itemStability)
S3method(summary,net.loads)
S3method(summary,riEGA)
export(CFA)
export(EBICglasso.qgraph)
Expand All @@ -41,49 +69,55 @@ export(auto.correlate)
export(boot.ergoInfo)
export(bootEGA)
export(color_palette_EGA)
export(compare_EGA_plots)
export(community.consensus)
export(community.detection)
export(community.homogenize)
export(community.unidimensional)
export(compare.EGA.plots)
export(convert2igraph)
export(convert2tidygraph)
export(dimensionStability)
export(dynEGA)
export(dynEGA.ind.pop)
export(entropyFit)
export(ergoInfo)
export(genTEFI)
export(glla)
export(hierEGA)
export(igraph2matrix)
export(infoCluster)
export(invariance)
export(itemStability)
export(jsd)
export(jsd.ergoInfo)
export(mctest.ergoInfo)
export(methods.section)
export(modularity)
export(net.loads)
export(net.scores)
export(network.descriptives)
export(network.estimation)
export(polychoric.matrix)
export(riEGA)
export(signed_louvain)
export(simDFM)
export(tefi)
export(totalCor)
export(totalCorMat)
export(vn.entropy)
export(wto)
importFrom(graphics,hist)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,text)
importFrom(methods,formalArgs)
importFrom(methods,is)
importFrom(stats,as.dist)
importFrom(stats,complete.cases)
importFrom(stats,cor)
importFrom(stats,cov)
importFrom(stats,cov2cor)
importFrom(stats,cutree)
importFrom(stats,dnorm)
importFrom(stats,hclust)
importFrom(stats,lm)
importFrom(stats,ks.test)
importFrom(stats,mad)
importFrom(stats,median)
importFrom(stats,na.omit)
importFrom(stats,p.adjust)
importFrom(stats,pgamma)
importFrom(stats,pnorm)
importFrom(stats,qchisq)
Expand All @@ -95,13 +129,17 @@ importFrom(stats,quantile)
importFrom(stats,rnorm)
importFrom(stats,runif)
importFrom(stats,sd)
importFrom(stats,setNames)
importFrom(stats,t.test)
importFrom(stats,uniroot)
importFrom(stats,var)
importFrom(stats,wilcox.test)
importFrom(utils,browseURL)
importFrom(utils,capture.output)
importFrom(utils,combn)
importFrom(utils,data)
importFrom(utils,globalVariables)
importFrom(utils,object.size)
importFrom(utils,packageDescription)
importFrom(utils,packageVersion)
importFrom(utils,setTxtProgressBar)
Expand Down
135 changes: 133 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,15 +1,146 @@
Changes in version 2.0.0

o MAJOR REFACTOR: the update to version 2.0.0 includes many major changes that are designed to improve the speed, reliability, and reproducibility of {EGAnet}. The goal of these changes are to eliminate common errors and streamline the code in the package to prevent future error cases. There are several function additions that are provided to facilitate modular use of the {EGAnet} package

o INTERNALS: function-specific internal functions and S3methods are now located in their respective .R files rather than elsewhere (e.g., "utils-EGAnet.R")

o SWAP: internal script usage of "utils-EGAnet.R" depracated for "helper.R" functions that are used across the package (no visible changes for the user)

o NOTE: default objective function for Leiden algorithm is set to "modularity"

o NOTE: default for Louvain unidimensional method is set to single-shot *unless* argument "consensus.method" or "consensus.iter" is specified

o ADD: stricter `*apply` functions that are roughly equivalent to `*apply` but have stricter inputs/outputs (uses `vapply` as foundation; often, slightly faster)

o ADD: `community.consensus` to apply the Consensus Clustering approach introduced by Lancichnetti & Fortunato (2012). Currently only available for the Louvain algorithm

o ADD: `community.detection` to apply community detection algorithms as a standalone function

o ADD: convenience function to convert an {igraph} object to a standard matrix (`igraph2matrix`)

o ADD: `modularity` to compute standard (absolute values) and signed modularity (implemented in C)

o ADD: `polychoric.matrix` to compute categorical correlations (implemented in C); handles missing data ("pairwise" or "listwise") as well as empty cells in the joint frequency table (see documentation: `?polychoric.matrix`)

o ADD: `auto.correlate` now computes all correlations internally and no longer depends on external functions; categorical correlations are C based and bi/polyserial correlations are a simplified and vectorized version of {polycor}'s `polyserial`; substantial computational gains (between 10-25x faster than previous use of {qgraph}'s `cor_auto`)

o ADD: `network.estimation` to handle all network estimation in {EGAnet}; *includes* Bayesian GGM from {BGGM} for more seamless incorporation of BEGA

o ADD: `community.unidimensional` to apply different unidimensional community detection approaches; makes unidimensional community detection more modular and flexible

o ADD: basic (internal) function to handle all network plots to keep changes centralized to a single function; extends flexbility to handle all {GGally}'s `ggnet2` arguments

o ADD: implemented reproducible parametric bootstrapping and random sampling (see <https://github.com/hfgolino/EGAnet/wiki/Reproducibility-and-PRNG> for more details)

o ADD: implemented reproducible resampling bootstrapping and random sampling (see <https://github.com/hfgolino/EGAnet/wiki/Reproducibility-and-PRNG> for more details)

o ADD: reproducible bootstrapping with seed setting that does *not* affect R's seed and RNG (user's seed will not be affected and will not affected bootstrapping seeds)

o ADD: `community.homogenize` as a core function rather than internal (previously `homogenize.membership`); about 2.5x faster than the original version

o ADD: `convert2tidygraph` for `ggraph` and `tidygraph` support -- thanks to Dominique Makowski!

o ADD: "multilevel" plotting support for `hierEGA` (only used when `scores = "network"` since factor scores don't directly align with EGA detected dimensions)

o ADD: internal functions `shuffle` and `shuffle_replace` to replace `sample` with and without replacement; performed in C and allows seed setting independent of R (about 2-3x faster)

o ADD: xoshiro256++ PRNG for higher quailty random number generation, permutation, and resampling (~2x faster than `runif` and `sample`); based in C

o ADD: Ziggurat method for random normal generation over top xoshiro256++ (2-5x faster than `rnorm`); based in C

o ADD: configural invariance was added to `invariance` (see Details section)

o ADD: `genTEFI` to compute the Generalized Total Entropy Fit Index solely; `tefi` serves as a general function to compute TEFI for all `*EGA` classes

o REMOVE: `signed.louvain` until reproducibility can be sorted

o UPDATE: `EBICglasso.qgraph` and `TMFG` were optimized; `TMFG` is now 2x faster

o UPDATE: `TMFG` can now directly estimate a GGM with the argument 'partial = TRUE'; implements the Local-Global Inversion method from Barfuss et al. (2016)

o UPDATE: switched on "Byte-Compile" (byte-compiles on our end and not when the user installs)

o UPDATE: `EGA.estimate` and `EGA` core functions have been updated for seamless use with more basic functions `network.estimation` and `community.*` functions

o UPDATE: S3method updates for `EGA.estimate` and `EGA` to provide estimation information

o UPDATE: `EGA.fit` updated to be compatiable with all updates to `EGA.estimate` (other optimizations were implemented such as direct communtiy detection application and unique solution finding)

o UPDATE: `tefi` updated with several checks (slightly slower for correlation matrix but much faster with raw data; includes data/matrix checks)

o UPDATE: `entropyFit` uses more effective vectorization (about 5-7x faster)

o UPDATE: `Embed` and `glla` made to be more efficient and includes an internal `glla_setup` function to avoid the same matrix calculations for every participant in a sample for `dynEGA`

o UPDATE: `riEGA` updated to be compatiable with all lower-level updates (slightly faster)

o UPDATE: `wto` updated to be fully vectorized (about 12x faster)

o UPDATE: `totalCor` and `totalCorMat` updated to be fully vectorized (about 10x faster)

o UPDATE: implemented internal `fast.data.frame` for more efficient data frame initialization when all values in data frame are the same

o UPDATE: `bootEGA` allows flexibility to add any arguments from any `EGA*` functions; much faster due to optimizations across all functions ("resampling" is nearly as fast as "parametric")

o UPDATE: support for `EGA.fit` and `riEGA` added to `bootEGA` (support for `hierEGA` will be coming soon...)

o UPDATE: `itemStability` has been updated and runs about 2.5x faster due to `community.homogenize`; S3methods were added; greater flexibility available in plotting but not much support (e.g., error checking) yet

o UPDATE: `dimensionStability` has been updated and maintains speed gains from `itemStability`

o UPDATE: `dynEGA.ind.pop` now calls `dynEGA` with `level = c("individual", "population")`; legacy `dynEGA.ind.pop` class is maintained across ergodicity functions

o UPDATE: `ergoInfo` is about 2x faster

o UPDATE: `jsd` received several internal functions to expedite procedures in `infoCluster` and `jsd.ergoInfo`

o UPDATE: `net.loads` now includes 'loading.method' argument to allow for reproducibility with "BRM" implementation (and version 1.2.3); "experimental" implementation includes rotations alternative signs and cross-loading computation (potential future default)

o UPDATE: `net.scores` is much simpler (internally) and quicker; seamlessly integrates with `net.loads`

o UPDATE: `compare.EGA.plots` is faster, more flexible, and more reliable for comparing two or more plots

o UPDATE: `hierEGA` is faster and has new S3 methods

o UPDATE: S3 plotting for `invariance`

o UPDATE: `hierEGA` + `bootEGA` integration for `itemStability` and `dimensionStability` (includes full S3 methods)

o UPDATE: `UVA` supports legacy of inital conception in Christensen, Golino, and Silvia (EJP, 2020) but will no longer fix bugs related to: manual variable selection, "adapt" or "alpha" methods (warnings will be thrown)

o UPDATE: streamlined `UVA` (about 4x faster); fixed bugs related to reverse coding issues

o UPDATE: `tefi` now handles all `EGA*` function objects including `hierEGA` which computes generalized TEFI

o UPDATE: documentation for all functions have been thoroughly revised to provide better instruction on how to use functions and their expected inputs

o DEPENDENCY: removed {network} because it is no longer used for plotting; switched {sna} to IMPORTS rather than SUGGESTS

o DEPENDENCY: removed {rstudioapi} from 'Suggests' because it was used in `colortext` and used in the package

o DEPENDENCY: removed {matrixcalc} because it was only used for trace of a matrix (own internal function is used)

o DEPENDENCY: {future} and {future.apply} are used for parallelization (better integration); includes internal function to check for available memory to not break in big data cases

o DEPENDENCY: {progress} and {progressr} are used for progress bars (in parallelization)

o DEPENDENCY: removed {psychTools} from 'Suggests' which was only used in examples

o DEPENDENCY: removed {rmarkdown} from 'Suggests' since it wasn't being used across the package


Changes in version 1.2.5.1

o FIX: cross-loading bug in `net.loads` was leading to problems when there were negative cross-loadings

o FIX: added `psych::factor.scores` scoring methods in `net.scores`

o ADDED: C implementation of the Signed Louvain algorithm
o ADD: `signed.louvain` to estimate the Signed Louvain algorithm (implemented in C)


Changes in version 1.2.5

o ADD: `most_common_tefi` method for `*EGA` analyses -- should be more reliable with larger datasets
o ADD: `most_common_tefi` method for `EGA` analyses


Changes in version 1.2.4
Expand Down
Loading

0 comments on commit aa73cb9

Please sign in to comment.