├── .Rbuildignore ├── .Rproj.user ├── 454F7DD3 │ ├── console06 │ │ └── INDEX001 │ ├── cpp-definition-cache │ ├── pcs │ │ ├── files-pane.pper │ │ ├── source-pane.pper │ │ ├── windowlayoutstate.pper │ │ └── workbench-pane.pper │ ├── rmd-outputs │ ├── saved_source_markers │ └── sources │ │ └── per │ │ └── u │ │ ├── 5ED2A3DE │ │ └── 5ED2A3DE-contents ├── 4ED33FE3 │ ├── cpp-definition-cache │ ├── pcs │ │ ├── debug-breakpoints.pper │ │ ├── files-pane.pper │ │ ├── source-pane.pper │ │ ├── windowlayoutstate.pper │ │ └── workbench-pane.pper │ ├── persistent-state │ ├── rmd-outputs │ ├── saved_source_markers │ ├── sdb │ │ ├── per │ │ │ └── t │ │ │ │ ├── 40D10918 │ │ │ │ ├── 43AC8F96 │ │ │ │ ├── 487B3551 │ │ │ │ ├── 68D3076D │ │ │ │ ├── 9D77B1C8 │ │ │ │ └── CDBD42E1 │ │ └── prop │ │ │ ├── 10266048 │ │ │ ├── 25798004 │ │ │ ├── 116A82F2 │ │ │ ├── 145B276E │ │ │ ├── 1B4F654D │ │ │ ├── 1DD3699C │ │ │ ├── 22DBDB19 │ │ │ ├── 25103B24 │ │ │ ├── 27D09C73 │ │ │ ├── 2F6CC180 │ │ │ ├── 2FC6DD66 │ │ │ ├── 33447C55 │ │ │ ├── 3680F4E │ │ │ ├── 3BC6C21C │ │ │ ├── 3FD25796 │ │ │ ├── 4098E757 │ │ │ ├── 516D64A1 │ │ │ ├── 58F36198 │ │ │ ├── 5A92DC74 │ │ │ ├── 678F7769 │ │ │ ├── 73F2F4BC │ │ │ ├── 752CEFD3 │ │ │ ├── 7F317F10 │ │ │ ├── 81191E46 │ │ │ ├── 853DFE20 │ │ │ ├── 90A82CF0 │ │ │ ├── 9C2D9F7 │ │ │ ├── A13EC6DD │ │ │ ├── A463ED1D │ │ │ ├── AAE26DA1 │ │ │ ├── AD66D302 │ │ │ ├── ADFA56F5 │ │ │ ├── B2462736 │ │ │ ├── B8752AC │ │ │ ├── C7B6B6DC │ │ │ ├── CCF077C3 │ │ │ ├── CE3FAEDC │ │ │ ├── CFD0E4D6 │ │ │ ├── D25A016E │ │ │ ├── D431E36D │ │ │ ├── D46C89D9 │ │ │ ├── D5C8C0F7 │ │ │ ├── D7914C68 │ │ │ ├── D881C192 │ │ │ ├── D90D5CEA │ │ │ ├── DB88AECD │ │ │ ├── DE46C9B2 │ │ │ ├── DED0F5D0 │ │ │ ├── E540C340 │ │ │ ├── E798F8EA │ │ │ ├── EAC49045 │ │ │ ├── F04D7BD5 │ │ │ ├── F1C4C39 │ │ │ ├── F729B2B8 │ │ │ └── INDEX │ └── session-persistent-state ├── C20BFF5F │ ├── build_options │ ├── cpp-definition-cache │ ├── ctx │ │ └── ctx-43595 │ │ │ ├── search_path │ │ │ ├── package_paths │ │ │ └── search_path_elements │ │ │ └── settings │ ├── pcs │ │ ├── files-pane.pper │ │ ├── source-pane.pper │ │ ├── windowlayoutstate.pper │ │ └── workbench-pane.pper │ ├── persistent-state │ ├── rmd-outputs │ ├── saved_source_markers │ ├── sdb │ │ ├── per │ │ │ └── t │ │ │ │ └── A7F23B65 │ │ └── prop │ │ │ ├── 1D5460E0 │ │ │ ├── 2D607684 │ │ │ ├── 34DDC55A │ │ │ ├── 37F7EA5D │ │ │ ├── 39978E3F │ │ │ ├── 3B7D730B │ │ │ ├── 5095085B │ │ │ ├── 539B7E56 │ │ │ ├── 54F228CF │ │ │ ├── 5BE09C26 │ │ │ ├── 5E6F8A1E │ │ │ ├── 623455CB │ │ │ ├── 691B36DF │ │ │ ├── 697934A3 │ │ │ ├── 9AEC8362 │ │ │ ├── 9E40E44 │ │ │ ├── B2E723D3 │ │ │ ├── F84BA1CD │ │ │ └── INDEX │ ├── session-persistent-state │ └── vcs_options ├── CCA4DF3B │ ├── console06 │ │ └── INDEX001 │ ├── cpp-definition-cache │ ├── pcs │ │ ├── files-pane.pper │ │ ├── source-pane.pper │ │ ├── windowlayoutstate.pper │ │ └── workbench-pane.pper │ ├── rmd-outputs │ ├── saved_source_markers │ └── sources │ │ ├── per │ │ └── t │ │ │ ├── 4CC92F37 │ │ │ ├── 4CC92F37-contents │ │ │ ├── 994B7A8C │ │ │ ├── 994B7A8C-contents │ │ │ ├── D338EEEE │ │ │ ├── D338EEEE-contents │ │ │ ├── D849A660 │ │ │ └── D849A660-contents │ │ └── prop │ │ ├── 1DC398E6 │ │ ├── 2E925340 │ │ ├── 3A7D9A79 │ │ ├── 5A302EE6 │ │ ├── 84297AF6 │ │ ├── 92CBE76E │ │ ├── 93B48BA3 │ │ ├── B48453AB │ │ ├── C1474A20 │ │ ├── C1BE46F8 │ │ ├── D13871B5 │ │ ├── DA471997 │ │ ├── DB16578C │ │ ├── DC8CCB7D │ │ ├── EE16000D │ │ ├── F56E9AA2 │ │ ├── F5AF19E6 │ │ ├── FE30BEC3 │ │ └── INDEX ├── D46573F8 │ ├── build_options │ ├── console06 │ │ ├── E42385ED │ │ ├── E42385ED.env │ │ └── INDEX001 │ ├── cpp-definition-cache │ ├── pcs │ │ ├── debug-breakpoints.pper │ │ ├── files-pane.pper │ │ ├── source-pane.pper │ │ ├── windowlayoutstate.pper │ │ └── workbench-pane.pper │ ├── persistent-state │ ├── rmd-outputs │ ├── saved_source_markers │ └── sources │ │ ├── prop │ │ ├── 28184444 │ │ ├── 90561334 │ │ ├── 1692B0 │ │ ├── 16BF40B5 │ │ ├── 1B06F89 │ │ ├── 1F8BEB03 │ │ ├── 20734E87 │ │ ├── 2821F45F │ │ ├── 2B750134 │ │ ├── 2EE66BFB │ │ ├── 30A985F8 │ │ ├── 30E0D90 │ │ ├── 329C5648 │ │ ├── 48AC2EFF │ │ ├── 48F19CB1 │ │ ├── 4B8203A5 │ │ ├── 502CC685 │ │ ├── 54A7EF80 │ │ ├── 5E852DCD │ │ ├── 6308215C │ │ ├── 684D9AFB │ │ ├── 6869E2EF │ │ ├── 6F4412DB │ │ ├── 748D0BA5 │ │ ├── 77A6344D │ │ ├── 8DD275FF │ │ ├── 995E087D │ │ ├── A51E928A │ │ ├── A6289A6D │ │ ├── A6CE2E48 │ │ ├── A8F200FF │ │ ├── AB048C7B │ │ ├── B0ACC44 │ │ ├── B21A34FE │ │ ├── B2AE81D9 │ │ ├── B66917F7 │ │ ├── B7E97374 │ │ ├── BA95574B │ │ ├── C14FA771 │ │ ├── C799AD89 │ │ ├── C7BFCEBD │ │ ├── C8324DF9 │ │ ├── C979067C │ │ ├── D358FCC6 │ │ ├── D4BCA408 │ │ ├── D8C79CBB │ │ ├── D967D3E3 │ │ ├── DE081089 │ │ ├── DF68C362 │ │ ├── DFB9D79C │ │ ├── EA0EC806 │ │ ├── EC5E7BE6 │ │ ├── F5A58818 │ │ └── INDEX │ │ └── s-571B5F3B │ │ ├── 13C65E5C-contents │ │ ├── 2EBDBF02-contents │ │ ├── 326B032F-contents │ │ ├── 3DF2939D-contents │ │ ├── 59956B1F-contents │ │ ├── 63529059-contents │ │ ├── 678E8B10-contents │ │ ├── 6A950F0F-contents │ │ ├── 818E9FA7-contents │ │ ├── 92F2DC19-contents │ │ ├── AA49A17D-contents │ │ ├── B9D32A84-contents │ │ ├── C2881DE0-contents │ │ ├── CDAECCA2 │ │ ├── CDAECCA2-contents │ │ ├── D267204B-contents │ │ ├── EEB997E6-contents │ │ ├── F2CAF5C8-contents │ │ └── lock_file └── shared │ └── notebooks │ ├── patch-chunk-names │ └── paths ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── feature-request.md │ └── to-do.md └── workflows │ └── r.yml ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── NEWS ├── R ├── CFA.R ├── EBICglasso.qgraph.R ├── EGA.R ├── EGA.estimate.R ├── EGA.fit.R ├── EGAnet.R ├── EGM.R ├── EGM.compare.R ├── EGM.optimizations.R ├── Embed.R ├── LCT.R ├── S3plots.R ├── TMFG.R ├── UVA.R ├── auto.correlate.R ├── boot.ergoInfo.R ├── boot.wmt.R ├── bootEGA.R ├── color_palette_EGA.R ├── community.compare.R ├── community.consensus.R ├── community.detection.R ├── community.homogenize.R ├── community.unidimensional.R ├── compare.EGA.plots.R ├── convert2igraph.R ├── convert2tidygraph.R ├── cosine.R ├── depression.R ├── development.R ├── dimensionStability.R ├── dnn.weights.R ├── dynEGA.R ├── dynEGA.ind.pop.R ├── ega.wmt.R ├── entropyFit.R ├── ergoInfo.R ├── frobenius.R ├── genTEFI.R ├── glla.R ├── helpers.R ├── hierEGA.R ├── igraph2matrix.R ├── infoCluster.R ├── information.R ├── intelligenceBattery.R ├── invariance.R ├── itemDiagnostics.R ├── itemStability.R ├── jsd.R ├── jsd.ergodicity.R ├── mctest.ergoInfo.R ├── modularity.R ├── net.loads.R ├── net.scores.R ├── network.compare.R ├── network.estimation.R ├── network.generalizability.R ├── network.nonconvex.R ├── network.predictability.R ├── oldUVA.R ├── oldsimEGM.R ├── optimism.R ├── polychoric.matrix.R ├── prime.num.R ├── riEGA.R ├── rng_test.R ├── sim.dynEGA.R ├── simDFM.R ├── simEGM.R ├── tefi.R ├── tefi.compare.R ├── totalCor.R ├── totalCorMat.R ├── utils-EGAnet.R ├── vn.entropy.R ├── wmt2.R ├── wto.R └── zzz.R ├── Readme.md ├── data ├── .DS_Store ├── boot.wmt.RData ├── depression.RData ├── dnn.weights.RData ├── ega.wmt.RData ├── intelligenceBattery.RData ├── optimism.RData ├── prime.num.RData ├── sim.dynEGA.RData └── wmt2.RData ├── inst ├── CITATION ├── EGAnet_hex.png └── EGAnet_hex_2.png ├── man ├── CFA.Rd ├── EBICglasso.qgraph.Rd ├── EGA.Rd ├── EGA.estimate.Rd ├── EGA.fit.Rd ├── EGAnet-package.Rd ├── EGAnet-plot.Rd ├── EGM.Rd ├── EGM.compare.Rd ├── Embed.Rd ├── LCT.Rd ├── TMFG.Rd ├── UVA.Rd ├── auto.correlate.Rd ├── boot.ergoInfo.Rd ├── boot.wmt.Rd ├── bootEGA.Rd ├── color_palette_EGA.Rd ├── community.compare.Rd ├── community.consensus.Rd ├── community.detection.Rd ├── community.homogenize.Rd ├── community.unidimensional.Rd ├── compare.EGA.plots.Rd ├── convert2igraph.Rd ├── convert2tidygraph.Rd ├── cosine.Rd ├── depression.Rd ├── dimensionStability.Rd ├── dnn.weights.Rd ├── dynEGA.Rd ├── dynEGA.ind.pop.Rd ├── ega.wmt.Rd ├── entropyFit.Rd ├── ergoInfo.Rd ├── frobenius.Rd ├── genTEFI.Rd ├── glla.Rd ├── hierEGA.Rd ├── igraph2matrix.Rd ├── infoCluster.Rd ├── information.Rd ├── intelligenceBattery.Rd ├── invariance.Rd ├── itemDiagnostics.Rd ├── itemStability.Rd ├── jsd.Rd ├── modularity.Rd ├── net.loads.Rd ├── net.scores.Rd ├── network.compare.Rd ├── network.estimation.Rd ├── network.nonconvex.Rd ├── network.predictability.Rd ├── optimism.Rd ├── polychoric.matrix.Rd ├── prime.num.Rd ├── riEGA.Rd ├── sim.dynEGA.Rd ├── simDFM.Rd ├── simEGM.Rd ├── tefi.Rd ├── tefi.compare.Rd ├── totalCor.Rd ├── totalCorMat.Rd ├── vn.entropy.Rd ├── wmt2.Rd └── wto.Rd └── src ├── init.c ├── modularity.c ├── modularity.h ├── nanotime.c ├── nanotime.h ├── polychoric_matrix.c ├── polychoric_matrix.h ├── signed_modularity.c ├── xoshiro.c ├── xoshiro.h ├── ziggurat.c └── ziggurat.h /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^\.git$ 2 | ^\.github$ 3 | ^\.Rproj\.user$ 4 | ^Readme\.md$ 5 | .gitignore 6 | LICENSE 7 | -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/console06/INDEX001: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/cpp-definition-cache: -------------------------------------------------------------------------------- 1 | [ 2 | ] -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/pcs/files-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "path" : "C:/Users/Hudson/Dropbox/Pacotes do R/Pacote EGA/EGA", 3 | "sortOrder" : [ 4 | { 5 | "ascending" : true, 6 | "columnIndex" : 2 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/pcs/source-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "activeTab" : 0 3 | } -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/pcs/windowlayoutstate.pper: -------------------------------------------------------------------------------- 1 | { 2 | "left" : { 3 | "panelheight" : 709, 4 | "splitterpos" : 298, 5 | "topwindowstate" : "NORMAL", 6 | "windowheight" : 747 7 | }, 8 | "right" : { 9 | "panelheight" : 709, 10 | "splitterpos" : 448, 11 | "topwindowstate" : "NORMAL", 12 | "windowheight" : 747 13 | } 14 | } -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/pcs/workbench-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "TabSet1" : 0, 3 | "TabSet2" : 1, 4 | "TabZoom" : { 5 | } 6 | } -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/rmd-outputs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/saved_source_markers: -------------------------------------------------------------------------------- 1 | {"active_set":"","sets":[]} -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/sources/per/u/5ED2A3DE: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "", 4 | "created" : 1557424041658.000, 5 | "dirty" : true, 6 | "encoding" : "", 7 | "folds" : "", 8 | "hash" : "2822997334", 9 | "id" : "5ED2A3DE", 10 | "lastKnownWriteTime" : 3419473789575321445, 11 | "last_content_update" : 1557424202894, 12 | "path" : null, 13 | "project_path" : null, 14 | "properties" : { 15 | "cursorPosition" : "7,0", 16 | "scrollLine" : "0", 17 | "tempName" : "Untitled1" 18 | }, 19 | "relative_order" : 1, 20 | "source_on_save" : false, 21 | "source_window" : "", 22 | "type" : "r_source" 23 | } -------------------------------------------------------------------------------- /.Rproj.user/454F7DD3/sources/per/u/5ED2A3DE-contents: -------------------------------------------------------------------------------- 1 | library("ggplot2") 2 | library("dlstats") 3 | library(ope) 4 | x <- cran_stats(c("EGAnet", "qgraph", "NetworkToolbox", "OpenMx")) 5 | head(x) 6 | ggplot(x, aes(end, downloads, group=package, color=package)) + 7 | geom_line() + geom_point(aes(shape=package)) 8 | -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/cpp-definition-cache: -------------------------------------------------------------------------------- 1 | [ 2 | ] -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/pcs/debug-breakpoints.pper: -------------------------------------------------------------------------------- 1 | { 2 | "debugBreakpointsState" : { 3 | "breakpoints" : [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/pcs/files-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/EGA", 3 | "sortOrder" : [ 4 | { 5 | "ascending" : true, 6 | "columnIndex" : 2 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/pcs/source-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "activeTab" : 1 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/pcs/windowlayoutstate.pper: -------------------------------------------------------------------------------- 1 | { 2 | "left" : { 3 | "panelheight" : 616, 4 | "splitterpos" : 255, 5 | "topwindowstate" : "NORMAL", 6 | "windowheight" : 655 7 | }, 8 | "right" : { 9 | "panelheight" : 616, 10 | "splitterpos" : 381, 11 | "topwindowstate" : "NORMAL", 12 | "windowheight" : 655 13 | } 14 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/pcs/workbench-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "TabSet1" : 3, 3 | "TabSet2" : 1, 4 | "TabZoom" : { 5 | } 6 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/persistent-state: -------------------------------------------------------------------------------- 1 | build-last-errors="[]" 2 | build-last-errors-base-dir="~/Dropbox/Pacotes do R/Pacote EGA/EGA/" 3 | build-last-outputs="[{\"output\":\"==> R CMD INSTALL --no-multiarch --with-keep.source EGA\\n\\n\",\"type\":0},{\"output\":\"* installing to library ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library’\\n\",\"type\":1},{\"output\":\"* installing *source* package ‘EGA’ ...\\n\",\"type\":1},{\"output\":\"Warning in as.POSIXlt.POSIXct(x, tz) :\\n\",\"type\":1},{\"output\":\" unknown timezone 'zone/tz/2018g.1.0/zoneinfo/America/New_York'\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** R\\n\",\"type\":1},{\"output\":\"** data\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"*** moving datasets to lazyload DB\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** preparing package for lazy loading\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** help\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"*** installing help indices\\n\",\"type\":1},{\"output\":\"** building package indices\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** testing if installed package can be loaded\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"* DONE (EGA)\\n\",\"type\":1},{\"output\":\"\",\"type\":1}]" 4 | compile_pdf_state="{\"errors\":[],\"output\":\"\",\"running\":false,\"tab_visible\":false,\"target_file\":\"\"}" 5 | console_procs="[]" 6 | files.monitored-path="" 7 | find-in-files-state="{\"handle\":\"\",\"input\":\"\",\"path\":\"\",\"regex\":false,\"results\":{\"file\":[],\"line\":[],\"lineValue\":[],\"matchOff\":[],\"matchOn\":[]},\"running\":false}" 8 | imageDirtyState="1" 9 | saveActionState="-1" 10 | -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/rmd-outputs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/saved_source_markers: -------------------------------------------------------------------------------- 1 | {"active_set":"","sets":[]} -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/per/t/487B3551: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "### Von Neumann Entropy:\n\nvn.entropy <- function(data, structure){\n library(qgraph)\n if(!is.matrix(data)){\n cor1 <- cor_auto(data)/sqrt(ncol(data))\n eigen.cor1 <- eigen(cor1)$values\n l.eigen <- eigen.cor1*log(eigen.cor1)\n h.vn <- -(sum(l.eigen))\n\n n <- max(structure)\n cor.fact <- vector(\"list\")\n eigen.fact <- vector(\"list\")\n l.eigen.fact <- vector(\"list\")\n h.vn.fact <- vector(\"list\")\n for(i in 1:n){\n cor.fact[[i]] <- cor_auto(data[,which(structure==unique(structure)[i])])/sqrt(ncol(data))\n eigen.fact[[i]] <- eigen(cor.fact[[i]])$values\n l.eigen.fact[[i]] <- eigen.fact[[i]]*log(eigen.fact[[i]])\n h.vn.fact[[i]] <- -(sum(l.eigen.fact[[i]]))\n }\n } else{\n cor1 <- data/sqrt(ncol(data))\n eigen.cor1 <- eigen(cor1)$values\n l.eigen <- eigen.cor1*log(eigen.cor1)\n h.vn <- -(sum(l.eigen))\n\n n <- max(structure)\n cor.fact <- vector(\"list\")\n eigen.fact <- vector(\"list\")\n l.eigen.fact <- vector(\"list\")\n h.vn.fact <- vector(\"list\")\n for(i in 1:n){\n cor.fact[[i]] <- data[which(structure==unique(structure)[i]),which(structure==unique(structure)[i])]/sqrt(ncol(data))\n eigen.fact[[i]] <- eigen(cor.fact[[i]])$values\n l.eigen.fact[[i]] <- eigen.fact[[i]]*log(eigen.fact[[i]])\n h.vn.fact[[i]] <- -(sum(l.eigen.fact[[i]]))\n }\n }\n\n\n h.vn.fact2 <- unlist(h.vn.fact)\n\n # Average Entropy:\n items.com <- vector(\"numeric\")\n for(i in 1:n){\n items.com[[i]] <- sum(structure==unique(structure)[i])\n }\n factor.average.h <- (sum(items.com*h.vn.fact2)/length(structure))\n h.watanabe <- factor.average.h-(ncol(data)*h.vn)\n average.h <- factor.average.h-(h.vn)\n\n results <- vector(\"list\")\n results$Tot.Entropy.VN <- h.vn\n results$Fact.Entropy <- h.vn.fact2\n results$Sum.Fact.Entropy <- sum(h.vn.fact2)\n results$Entropy.Fit <- mean(h.vn.fact2)-h.vn\n results$Tot.Cor <- sum(h.vn.fact2)-h.vn\n results$Average.Entropy <- average.h\n results$H.Watanabe <- h.watanabe\n return(results)\n}\n\n\n## VN entropy of a scaled correlation matrix!!!!!!\n\nmat1 <- matrix(c(1,2,3,4), ncol = 2, byrow = TRUE)\nnorm(mat1)\nmat1^2\n", 4 | "created" : 1543330898194.000, 5 | "dirty" : false, 6 | "encoding" : "UTF-8", 7 | "folds" : "", 8 | "hash" : "475479517", 9 | "id" : "487B3551", 10 | "lastKnownWriteTime" : 1543506904, 11 | "last_content_update" : 1543506904364, 12 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/New Functions to be Added/VonNeumannEntropy.R", 13 | "project_path" : null, 14 | "properties" : { 15 | "tempName" : "Untitled1" 16 | }, 17 | "relative_order" : 7, 18 | "source_on_save" : false, 19 | "source_window" : "", 20 | "type" : "r_source" 21 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/per/t/68D3076D: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "totalCor <- function(data){\n #number of dimensions\n n <- ncol(data)\n\n #initialize entropy vector\n H <- vector(\"numeric\",length=n)\n bins <- floor(sqrt(nrow(data)/5))\n seque <- matrix(NA,nrow=bins+1,ncol=n)\n sums <- matrix(NA,nrow=nrow(data),ncol=n)\n bin.sums <- vector(\"list\", n)\n bin.sums2 <- matrix(NA, nrow=bins, ncol = n)\n Freq <- matrix(NA,nrow=bins,ncol=n)\n\n #compute empirical entropy for each community or item\n for(i in 1:n)\n {\n seque[,i] <- seq(from = range(data[,i])[1], to = range(data[,i])[2], length.out = bins+1)\n bin.sums[[i]] <- table(cut(data[,i], breaks = seque[,i], include.lowest = TRUE))\n bin.sums2[,i] <- as.vector(unlist(bin.sums[[i]]))\n Freq[,i] <- bin.sums2[,i]/sum(bin.sums2[,i])\n H[i] <- -sum(ifelse(Freq[,i]>0,Freq[,i] * log(Freq[,i]),0))\n }\n\n # Joint Entropy:\n\n bin.sums3 <- data.frame(matrix(NA, nrow = nrow(data), ncol = n))\n joint.table <- vector(\"numeric\")\n for(i in 1:n){\n bin.sums3[,i] <- cut(data[,i], breaks = seque[,i], include.lowest = TRUE)\n joint.table = plyr::count(bin.sums3)$freq\n }\n\n freq.joint <- joint.table/sum(joint.table)\n joint.entropy <- -sum(ifelse(freq.joint >0,freq.joint * log(freq.joint),0))\n\n results <- vector(\"list\")\n results$Ind.Entropies <- H\n results$Joint.Entropy <- joint.entropy\n results$Total.Cor <- sum(H)-joint.entropy\n return(results)\n}\n", 4 | "created" : 1543285947232.000, 5 | "dirty" : false, 6 | "encoding" : "UTF-8", 7 | "folds" : "", 8 | "hash" : "208407556", 9 | "id" : "68D3076D", 10 | "lastKnownWriteTime" : 1543267603, 11 | "last_content_update" : 1543267603, 12 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/New Functions to be Added/totalCor.R", 13 | "project_path" : null, 14 | "properties" : { 15 | "tempName" : "Untitled2" 16 | }, 17 | "relative_order" : 8, 18 | "source_on_save" : false, 19 | "source_window" : "", 20 | "type" : "r_source" 21 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/per/t/9D77B1C8: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "totalCorMat <- function(data){\n TotCorMat <- matrix(NA,nrow=ncol(data),ncol=ncol(data))\n TotCorMat <- matrix(apply(expand.grid( x = 1:ncol(data), y = 1:ncol(data)), 1,\n function(x){ return(totalCor( data[ , c(x[1], x[2])])$Total.Cor)}),\n nc = ncol(data))\n colnames(TotCorMat) <- colnames(data)\n rownames(TotCorMat) <- colnames(data)\n return(TotCorMat)\n}\n\n\n\n", 4 | "created" : 1543285950724.000, 5 | "dirty" : false, 6 | "encoding" : "UTF-8", 7 | "folds" : "", 8 | "hash" : "543402309", 9 | "id" : "9D77B1C8", 10 | "lastKnownWriteTime" : 1543286133, 11 | "last_content_update" : 1543286133211, 12 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/New Functions to be Added/totalCorMat.R", 13 | "project_path" : null, 14 | "properties" : { 15 | "tempName" : "Untitled2" 16 | }, 17 | "relative_order" : 9, 18 | "source_on_save" : false, 19 | "source_window" : "", 20 | "type" : "r_source" 21 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/10266048: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/116A82F2: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/145B276E: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/1B4F654D: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/1DD3699C: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/22DBDB19: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/25103B24: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/25798004: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/27D09C73: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/2F6CC180: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/2FC6DD66: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/33447C55: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/3680F4E: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/3BC6C21C: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/3FD25796: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/4098E757: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/516D64A1: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/58F36198: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/5A92DC74: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/678F7769: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/73F2F4BC: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/752CEFD3: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/7F317F10: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/81191E46: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/853DFE20: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/90A82CF0: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/9C2D9F7: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/A13EC6DD: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/A463ED1D: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/AAE26DA1: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/AD66D302: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/ADFA56F5: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/B2462736: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/B8752AC: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/C7B6B6DC: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/CCF077C3: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/CE3FAEDC: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/CFD0E4D6: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/D25A016E: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/D431E36D: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/D46C89D9: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/D5C8C0F7: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/D7914C68: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/D881C192: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/D90D5CEA: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/DB88AECD: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/DE46C9B2: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/DED0F5D0: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/E540C340: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/E798F8EA: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled2" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/EAC49045: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/F04D7BD5: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/F1C4C39: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled3" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/sdb/prop/F729B2B8: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/4ED33FE3/session-persistent-state: -------------------------------------------------------------------------------- 1 | virtual-session-id="6F258DD2" 2 | -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/build_options: -------------------------------------------------------------------------------- 1 | auto_roxygenize_for_build_and_reload="1" 2 | auto_roxygenize_for_build_package="1" 3 | auto_roxygenize_for_check="1" 4 | live_preview_website="1" 5 | makefile_args="" 6 | preview_website="1" 7 | website_output_format="all" 8 | -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/cpp-definition-cache: -------------------------------------------------------------------------------- 1 | [ 2 | ] -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/ctx/ctx-43595/search_path/package_paths: -------------------------------------------------------------------------------- 1 | EGA="C:/Program Files/R/R-3.3.2/library/EGA" 2 | bindrcpp="C:/Program Files/R/R-3.3.2/library/bindrcpp" 3 | bootnet="C:/Program Files/R/R-3.3.2/library/bootnet" 4 | datasets="C:/Program Files/R/R-3.3.2/library/datasets" 5 | ggplot2="C:/Program Files/R/R-3.3.2/library/ggplot2" 6 | grDevices="C:/Program Files/R/R-3.3.2/library/grDevices" 7 | graphics="C:/Program Files/R/R-3.3.2/library/graphics" 8 | igraph="C:/Program Files/R/R-3.3.2/library/igraph" 9 | methods="C:/Program Files/R/R-3.3.2/library/methods" 10 | plotly="C:/Program Files/R/R-3.3.2/library/plotly" 11 | qgraph="C:/Program Files/R/R-3.3.2/library/qgraph" 12 | stats="C:/Program Files/R/R-3.3.2/library/stats" 13 | utils="C:/Program Files/R/R-3.3.2/library/utils" 14 | -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/ctx/ctx-43595/search_path/search_path_elements: -------------------------------------------------------------------------------- 1 | .GlobalEnv 2 | package:bootnet 3 | package:bindrcpp 4 | package:plotly 5 | package:ggplot2 6 | package:igraph 7 | package:qgraph 8 | package:EGA 9 | tools:rstudio 10 | package:stats 11 | package:graphics 12 | package:grDevices 13 | package:utils 14 | package:datasets 15 | package:methods 16 | Autoloads 17 | package:base 18 | -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/ctx/ctx-43595/settings: -------------------------------------------------------------------------------- 1 | packrat_mode_on="0" 2 | r.session.client_metrics.console-width="100" 3 | r.session.client_metrics.device-pixel-ratio="1.000000" 4 | r.session.client_metrics.graphics-height="426" 5 | r.session.client_metrics.graphics-width="723" 6 | r_profile_on_restore="1" 7 | working_directory="D:/Dropbox/Dropbox/Pacotes do R/Pacote EGA/EGA" 8 | -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/pcs/files-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "path" : "D:/Dropbox/Dropbox/Pacotes do R/Pacote EGA/EGA", 3 | "sortOrder" : [ 4 | { 5 | "ascending" : true, 6 | "columnIndex" : 2 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/pcs/source-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "activeTab" : 0 3 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/pcs/windowlayoutstate.pper: -------------------------------------------------------------------------------- 1 | { 2 | "left" : { 3 | "panelheight" : 761, 4 | "splitterpos" : 319, 5 | "topwindowstate" : "NORMAL", 6 | "windowheight" : 799 7 | }, 8 | "right" : { 9 | "panelheight" : 761, 10 | "splitterpos" : 479, 11 | "topwindowstate" : "NORMAL", 12 | "windowheight" : 799 13 | } 14 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/pcs/workbench-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "TabSet1" : 3, 3 | "TabSet2" : 4, 4 | "TabZoom" : { 5 | } 6 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/persistent-state: -------------------------------------------------------------------------------- 1 | build-last-errors="[]" 2 | build-last-errors-base-dir="D:/Dropbox/Dropbox/Pacotes do R/Pacote EGA/EGA/" 3 | build-last-outputs="[{\"output\":\"==> devtools::document(roclets=c('rd', 'collate', 'namespace'))\\n\\n\",\"type\":0},{\"output\":\"Updating EGA documentation\\r\\n\",\"type\":2},{\"output\":\"Loading EGA\\r\\n\",\"type\":2},{\"output\":\"Writing CFA.Rd\\r\\nWriting EGA.Rd\\r\\nWriting bootEGA.Rd\\r\\nWriting plot.CFA.Rd\\r\\nWriting plot.EGA.Rd\\r\\nWriting print.EGA.Rd\\r\\nWriting summary.CFA.Rd\\r\\nWriting summary.EGA.Rd\\r\\nWriting NAMESPACE\\r\\n\",\"type\":1},{\"output\":\"Documentation completed\\n\\n\",\"type\":1},{\"output\":\"==> Rcmd.exe INSTALL --no-multiarch --with-keep.source EGA\\n\\n\",\"type\":0},{\"output\":\"* installing to library 'C:/Program Files/R/R-3.3.2/library'\\r\\n\",\"type\":1},{\"output\":\"* installing *source* package 'EGA' ...\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** R\\r\\n\",\"type\":1},{\"output\":\"** data\\r\\n\",\"type\":1},{\"output\":\"*** moving datasets to lazyload DB\\r\\n\",\"type\":1},{\"output\":\"** preparing package for lazy loading\\r\\n\",\"type\":1},{\"output\":\"** help\\r\\n\",\"type\":1},{\"output\":\"*** installing help indices\\r\\n\",\"type\":1},{\"output\":\"** building package indices\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** testing if installed package can be loaded\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"* DONE (EGA)\\r\\n\",\"type\":1},{\"output\":\"\",\"type\":1}]" 4 | compile_pdf_state="{\"errors\":[],\"output\":\"\",\"running\":false,\"tab_visible\":false,\"target_file\":\"\"}" 5 | console_procs="[]" 6 | files.monitored-path="" 7 | find-in-files-state="{\"handle\":\"\",\"input\":\"\",\"path\":\"\",\"regex\":true,\"results\":{\"file\":[],\"line\":[],\"lineValue\":[],\"matchOff\":[],\"matchOn\":[]},\"running\":false}" 8 | imageDirtyState="1" 9 | saveActionState="-1" 10 | -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/rmd-outputs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/saved_source_markers: -------------------------------------------------------------------------------- 1 | {"active_set":"","sets":[]} -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/per/t/A7F23B65: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "Package: EGA\nType: Package\nTitle: Exploratory Graph Analysis: Estimating the number of dimensions\n in psychological data\nVersion: 0.3\nDate: 2017-01-18\nAuthor: Hudson F. Golino\nMaintainer: Hudson F. Golino \nDescription: An implementation of the Exploratory Graph Analysis (EGA). EGA is part of a new area called network psychometrics,\n that focuses on the estimation of undirected network models to psychological datasets. EGA estimates the number of\n dimensions or factors using graphical lasso and a weighted network community analysis. A bootstrap method for\n verifying the stability of the estimation is also available. The fit of the structure suggested by EGA can be\n verified using confirmatory factor analysis and a direct way to convert the EGA structure to CFA is also\n implemented. Documentation and examples are available.\nLicense: GPL-3\nRoxygenNote: 5.0.1\nImports: qgraph (>= 1.4.1), semPlot (>= 1.0.1), bootnet (>= 0.3),\n igraph (>= 1.0.1), lavaan (>= 0.5-22), doParallel (>= 1.0.10),\n foreach (>= 1.4.3)\nSuggests: knitr, rmarkdown\nVignetteBuilder: knitr\nEncoding: UTF-8\nLazyData: true\n", 4 | "created" : 1511355743250.000, 5 | "dirty" : false, 6 | "encoding" : "UTF-8", 7 | "folds" : "", 8 | "hash" : "1053982134", 9 | "id" : "A7F23B65", 10 | "lastKnownWriteTime" : 1511321910, 11 | "last_content_update" : 1511321910, 12 | "path" : "D:/Dropbox/Dropbox/Pacotes do R/Pacote EGA/EGA/DESCRIPTION", 13 | "project_path" : "DESCRIPTION", 14 | "properties" : { 15 | }, 16 | "relative_order" : 1, 17 | "source_on_save" : false, 18 | "source_window" : "", 19 | "type" : "dcf" 20 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/1D5460E0: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/2D607684: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/34DDC55A: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/37F7EA5D: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/39978E3F: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/3B7D730B: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/5095085B: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/539B7E56: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/54F228CF: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/5BE09C26: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/5E6F8A1E: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/623455CB: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/691B36DF: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/697934A3: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/9AEC8362: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/9E40E44: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/B2E723D3: -------------------------------------------------------------------------------- 1 | { 2 | "tempName" : "Untitled1" 3 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/F84BA1CD: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/sdb/prop/INDEX: -------------------------------------------------------------------------------- 1 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FDESCRIPTION="9AEC8362" 2 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FNAMESPACE="5095085B" 3 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FCFA.R="2D607684" 4 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FEGA.R="5E6F8A1E" 5 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FbootEGA.R="37F7EA5D" 6 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fhello.R="F84BA1CD" 7 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fmethods.R="39978E3F" 8 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fplot.CFA.R="B2E723D3" 9 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fplot.EGA.R="1D5460E0" 10 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fplot.R="34DDC55A" 11 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fprint.EGA.R="691B36DF" 12 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fsummary.CFA.R="3B7D730B" 13 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fsummary.EGA.R="54F228CF" 14 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FReadme.Rmd="539B7E56" 15 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FReadme.md="5BE09C26" 16 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2Fman%2FEGA.Rd="697934A3" 17 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA2%2FDESCRIPTION="9E40E44" 18 | D%3A%2FDropbox%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2Fega.Plotly.R="623455CB" 19 | -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/session-persistent-state: -------------------------------------------------------------------------------- 1 | virtual-session-id="7BD2440B" 2 | -------------------------------------------------------------------------------- /.Rproj.user/C20BFF5F/vcs_options: -------------------------------------------------------------------------------- 1 | activeVcsOverride="" 2 | -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/console06/INDEX001: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/cpp-definition-cache: -------------------------------------------------------------------------------- 1 | [ 2 | ] -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/pcs/files-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/EGA", 3 | "sortOrder" : [ 4 | { 5 | "ascending" : true, 6 | "columnIndex" : 2 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/pcs/source-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "activeTab" : 1 3 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/pcs/windowlayoutstate.pper: -------------------------------------------------------------------------------- 1 | { 2 | "left" : { 3 | "panelheight" : 729, 4 | "splitterpos" : 308, 5 | "topwindowstate" : "NORMAL", 6 | "windowheight" : 767 7 | }, 8 | "right" : { 9 | "panelheight" : 729, 10 | "splitterpos" : 462, 11 | "topwindowstate" : "NORMAL", 12 | "windowheight" : 767 13 | } 14 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/pcs/workbench-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "TabSet1" : 0, 3 | "TabSet2" : 1, 4 | "TabZoom" : { 5 | } 6 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/rmd-outputs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/saved_source_markers: -------------------------------------------------------------------------------- 1 | {"active_set":"","sets":[]} -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/per/t/4CC92F37: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "", 4 | "created" : 1543951628657.000, 5 | "dirty" : false, 6 | "encoding" : "UTF-8", 7 | "folds" : "", 8 | "hash" : "1179103477", 9 | "id" : "4CC92F37", 10 | "lastKnownWriteTime" : 1543952711, 11 | "last_content_update" : 1543952711452, 12 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/EGA/R/entropyFit.R", 13 | "project_path" : "R/entropyFit.R", 14 | "properties" : { 15 | "cursorPosition" : "148,0", 16 | "scrollLine" : "131" 17 | }, 18 | "relative_order" : 4, 19 | "source_on_save" : false, 20 | "source_window" : "", 21 | "type" : "r_source" 22 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/per/t/994B7A8C: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "", 4 | "created" : 1543951447270.000, 5 | "dirty" : false, 6 | "encoding" : "UTF-8", 7 | "folds" : "", 8 | "hash" : "3692198977", 9 | "id" : "994B7A8C", 10 | "lastKnownWriteTime" : 1543953681, 11 | "last_content_update" : 1543953681437, 12 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/New Functions to be Added/VonNeumannEntropy.R", 13 | "project_path" : null, 14 | "properties" : { 15 | "cursorPosition" : "2,0", 16 | "scrollLine" : "0" 17 | }, 18 | "relative_order" : 7, 19 | "source_on_save" : false, 20 | "source_window" : "", 21 | "type" : "r_source" 22 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/per/t/994B7A8C-contents: -------------------------------------------------------------------------------- 1 | ### Von Neumann Entropy: 2 | 3 | vn.entropy <- function(data, structure){ 4 | library(qgraph) 5 | if(!is.matrix(data)){ 6 | cor1 <- cor_auto(data)/sqrt(ncol(data)) 7 | eigen.cor1 <- eigen(cor1)$values 8 | l.eigen <- eigen.cor1*log(eigen.cor1) 9 | h.vn <- -(sum(l.eigen)) 10 | 11 | n <- max(structure) 12 | cor.fact <- vector("list") 13 | eigen.fact <- vector("list") 14 | l.eigen.fact <- vector("list") 15 | h.vn.fact <- vector("list") 16 | for(i in 1:n){ 17 | cor.fact[[i]] <- cor_auto(data[,which(structure==unique(structure)[i])])/sqrt(ncol(data)) 18 | eigen.fact[[i]] <- eigen(cor.fact[[i]])$values 19 | l.eigen.fact[[i]] <- eigen.fact[[i]]*log(eigen.fact[[i]]) 20 | h.vn.fact[[i]] <- -(sum(l.eigen.fact[[i]])) 21 | } 22 | 23 | } else{ 24 | cor1 <- data/sqrt(ncol(data)) 25 | eigen.cor1 <- eigen(cor1)$values 26 | l.eigen <- eigen.cor1*log(eigen.cor1) 27 | h.vn <- -(sum(l.eigen)) 28 | 29 | n <- max(structure) 30 | cor.fact <- vector("list") 31 | eigen.fact <- vector("list") 32 | l.eigen.fact <- vector("list") 33 | h.vn.fact <- vector("list") 34 | for(i in 1:n){ 35 | cor.fact[[i]] <- data[which(structure==unique(structure)[i]),which(structure==unique(structure)[i])]/sqrt(ncol(data)) 36 | eigen.fact[[i]] <- eigen(cor.fact[[i]])$values 37 | l.eigen.fact[[i]] <- eigen.fact[[i]]*log(eigen.fact[[i]]) 38 | h.vn.fact[[i]] <- -(sum(l.eigen.fact[[i]])) 39 | } 40 | } 41 | 42 | h.vn.fact2 <- unlist(h.vn.fact) 43 | 44 | #minimum entropy 45 | Hmin <- h.vn/ncol(data) 46 | 47 | # Difference between Max and Min: 48 | Hdiff <- h.vn-Hmin 49 | 50 | results <- vector("list") 51 | results$Tot.Entropy.VN <- h.vn 52 | results$Fact.Entropy <- h.vn.fact2 53 | results$Sum.Fact.Entropy <- sum(h.vn.fact2) 54 | results$Entropy.Fit <-(mean(h.vn.fact2)-h.vn)-(Hdiff*(sqrt(n))) 55 | results$Tot.Cor <- sum(h.vn.fact2)-h.vn 56 | results$Average.Entropy <- mean(h.vn.fact2)-h.vn 57 | return(results) 58 | } 59 | 60 | 61 | ## VN entropy of a scaled correlation matrix!!!!!! 62 | 63 | -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/per/t/D338EEEE: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "", 4 | "created" : 1543951470674.000, 5 | "dirty" : false, 6 | "encoding" : "UTF-8", 7 | "folds" : "", 8 | "hash" : "1464949732", 9 | "id" : "D338EEEE", 10 | "lastKnownWriteTime" : 1543958907, 11 | "last_content_update" : 1543958907054, 12 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/New Functions to be Added/script_entropy_clusters_November.R", 13 | "project_path" : null, 14 | "properties" : { 15 | "cursorPosition" : "17,38", 16 | "scrollLine" : "8" 17 | }, 18 | "relative_order" : 2, 19 | "source_on_save" : false, 20 | "source_window" : "", 21 | "type" : "r_source" 22 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/per/t/D849A660: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "", 4 | "created" : 1543951590443.000, 5 | "dirty" : false, 6 | "encoding" : "UTF-8", 7 | "folds" : "", 8 | "hash" : "1270190809", 9 | "id" : "D849A660", 10 | "lastKnownWriteTime" : 1543959912, 11 | "last_content_update" : 1543959912180, 12 | "path" : "~/Dropbox/Code_Entropy_Paper.R", 13 | "project_path" : null, 14 | "properties" : { 15 | "cursorPosition" : "373,0", 16 | "scrollLine" : "360", 17 | "tempName" : "Untitled1" 18 | }, 19 | "relative_order" : 3, 20 | "source_on_save" : false, 21 | "source_window" : "", 22 | "type" : "r_source" 23 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/1DC398E6: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "6,14", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled2" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/2E925340: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "20,37", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/3A7D9A79: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "97,20", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/5A302EE6: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/84297AF6: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "165,14", 3 | "scrollLine" : "152", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/92CBE76E: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "312,69", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/93B48BA3: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "373,0", 3 | "scrollLine" : "360", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/B48453AB: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "23,60", 3 | "scrollLine" : "9" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/C1474A20: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "19,28", 3 | "scrollLine" : "1" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/C1BE46F8: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "93,85", 3 | "scrollLine" : "84" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/D13871B5: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "148,0", 3 | "scrollLine" : "131" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/DA471997: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "55,110", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/DB16578C: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "373,0", 3 | "scrollLine" : "360", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/DC8CCB7D: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "2,0", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/EE16000D: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "7,0", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled2" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/F56E9AA2: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "5,15", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled2" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/F5AF19E6: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "11,0", 3 | "scrollLine" : "11" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/FE30BEC3: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "17,38", 3 | "scrollLine" : "8" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/CCA4DF3B/sources/prop/INDEX: -------------------------------------------------------------------------------- 1 | ~%2FDropbox%2FCode_Entropy_Paper.R="DB16578C" 2 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FDESCRIPTION="2E925340" 3 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FNAMESPACE="F5AF19E6" 4 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FCode_Entropy_Paper.R="93B48BA3" 5 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FEBICglasso.qgraph.R="84297AF6" 6 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FEGA.R="DA471997" 7 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FEGA.fit.R="C1BE46F8" 8 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FbootEGA.R="3A7D9A79" 9 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fdepression.R="F56E9AA2" 10 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FentropyFit.R="D13871B5" 11 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2FintelligenceBattery.R="EE16000D" 12 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fplot.EGA.R="B48453AB" 13 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fprint.EGA.R="C1474A20" 14 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FEGA%2FR%2Fwmt2.R="1DC398E6" 15 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FNew%20Functions%20to%20be%20Added%2FEntropyFit.R="5A302EE6" 16 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FNew%20Functions%20to%20be%20Added%2FVonNeumannEntropy.R="DC8CCB7D" 17 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FNew%20Functions%20to%20be%20Added%2Fentropy_fit_compare.R="92CBE76E" 18 | ~%2FDropbox%2FPacotes%20do%20R%2FPacote%20EGA%2FNew%20Functions%20to%20be%20Added%2Fscript_entropy_clusters_November.R="FE30BEC3" 19 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/build_options: -------------------------------------------------------------------------------- 1 | auto_roxygenize_for_build_and_reload="0" 2 | auto_roxygenize_for_build_package="1" 3 | auto_roxygenize_for_check="1" 4 | live_preview_website="1" 5 | makefile_args="" 6 | preview_website="1" 7 | website_output_format="all" 8 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/console06/E42385ED: -------------------------------------------------------------------------------- 1 | ]0;~/Dropbox/Pacotes do R/Pacote EGA/EGA[?1034hPSYC-1232:EGA hudson$ ?EGA 2 | bash: ?EGA: command not found 3 | ]0;~/Dropbox/Pacotes do R/Pacote EGA/EGAPSYC-1232:EGA hudson$ PSYC-1232:EGA hudson$ -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/console06/E42385ED.env: -------------------------------------------------------------------------------- 1 | { 2 | "Apple_PubSub_Socket_Render" : "/private/tmp/com.apple.launchd.OZP0aCczjk/Render", 3 | "CLICOLOR_FORCE" : "1", 4 | "DISPLAY" : "/private/tmp/com.apple.launchd.i0UUWNpGVM/org.macosforge.xquartz:0", 5 | "EDITOR" : "vi", 6 | "GIT_ASKPASS" : "rpostback-askpass", 7 | "HISTCONTROL" : "ignoreboth", 8 | "HOME" : "/Users/hudson", 9 | "LANG" : "en_US.UTF-8", 10 | "LC_CTYPE" : "en_US.UTF-8", 11 | "LN_S" : "ln -s", 12 | "LOGNAME" : "hudson", 13 | "MAKE" : "make", 14 | "PAGER" : "/usr/bin/less", 15 | "PATH" : "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/Users/hudson/bin:bin/msys-ssh-1000-18", 16 | "PROMPT_COMMAND" : "echo -ne \"\\033]0;${PWD/#${HOME}/~}\\007\"", 17 | "PWD" : "/Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA", 18 | "RMARKDOWN_MATHJAX_PATH" : "/Applications/RStudio.app/Contents/Resources/resources/mathjax-26", 19 | "RSTUDIO" : "1", 20 | "RSTUDIO_CONSOLE_COLOR" : "256", 21 | "RSTUDIO_CONSOLE_WIDTH" : "81", 22 | "RSTUDIO_PANDOC" : "/Applications/RStudio.app/Contents/MacOS/pandoc", 23 | "RSTUDIO_PROJ_NAME" : "EGA", 24 | "RSTUDIO_SESSION_ID" : "1BEA16C1", 25 | "RSTUDIO_SESSION_PORT" : "14435", 26 | "RSTUDIO_TERM" : "E42385ED", 27 | "RSTUDIO_USER_IDENTITY" : "hudson", 28 | "RSTUDIO_WINUTILS" : "bin/winutils", 29 | "RS_RPOSTBACK_PATH" : "/Applications/RStudio.app/Contents/MacOS/rpostback", 30 | "RS_SHARED_SECRET" : "1af9aaa9-000d-43d2-8171-363455add8b5", 31 | "R_BROWSER" : "/usr/bin/open", 32 | "R_BZIPCMD" : "/usr/bin/bzip2", 33 | "R_DOC_DIR" : "/Library/Frameworks/R.framework/Resources/doc", 34 | "R_GZIPCMD" : "/usr/bin/gzip", 35 | "R_HOME" : "/Library/Frameworks/R.framework/Resources", 36 | "R_INCLUDE_DIR" : "/Library/Frameworks/R.framework/Resources/include", 37 | "R_LIBS_SITE" : "", 38 | "R_LIBS_USER" : "~/Library/R/3.5/library", 39 | "R_PAPERSIZE" : "a4", 40 | "R_PDFVIEWER" : "/usr/bin/open", 41 | "R_PLATFORM" : "x86_64-apple-darwin15.6.0", 42 | "R_PRINTCMD" : "lpr", 43 | "R_QPDF" : "/Library/Frameworks/R.framework/Resources/bin/qpdf", 44 | "R_RD4PDF" : "times,inconsolata,hyper", 45 | "R_SESSION_TMPDIR" : "/var/folders/vr/d39xjwsj5d59srq7zd8wqgn00000gp/T//RtmpGTBZuU", 46 | "R_SHARE_DIR" : "/Library/Frameworks/R.framework/Resources/share", 47 | "R_SYSTEM_ABI" : "osx,gcc,gxx,gfortran,?", 48 | "R_TEXI2DVICMD" : "/usr/local/bin/texi2dvi", 49 | "R_UNZIPCMD" : "/usr/bin/unzip", 50 | "R_ZIPCMD" : "/usr/bin/zip", 51 | "SED" : "/usr/bin/sed", 52 | "SHELL" : "/bin/bash", 53 | "SHLVL" : "1", 54 | "SSH_ASKPASS" : "rpostback-askpass", 55 | "SSH_AUTH_SOCK" : "/private/tmp/com.apple.launchd.4QSxedzJks/Listeners", 56 | "TAR" : "/usr/bin/tar", 57 | "TERM" : "xterm-256color", 58 | "TMPDIR" : "/var/folders/vr/d39xjwsj5d59srq7zd8wqgn00000gp/T/", 59 | "USER" : "hudson", 60 | "XPC_FLAGS" : "0x0", 61 | "XPC_SERVICE_NAME" : "0", 62 | "__CF_USER_TEXT_ENCODING" : "0x1F6:0x0:0x0" 63 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/console06/INDEX001: -------------------------------------------------------------------------------- 1 | [{"allow_restart":true,"alt_buffer":false,"autoclose":1,"buffered_output":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n","caption":"Terminal 1","channel_id":"4477","channel_mode":1,"child_procs":false,"cols":83,"cwd":"~/Dropbox/Pacotes do R/Pacote EGA/EGA","exit_code":1,"handle":"E42385ED","interaction_mode":2,"max_output_lines":1000,"restarted":false,"rows":12,"shell_type":7,"show_on_output":false,"terminal_sequence":1,"title":"~/Dropbox/Pacotes do R/Pacote EGA/EGA","track_env":true,"zombie":false}] -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/cpp-definition-cache: -------------------------------------------------------------------------------- 1 | [ 2 | ] -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/pcs/debug-breakpoints.pper: -------------------------------------------------------------------------------- 1 | { 2 | "debugBreakpointsState" : { 3 | "breakpoints" : [ 4 | ] 5 | } 6 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/pcs/files-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/EGA", 3 | "sortOrder" : [ 4 | { 5 | "ascending" : true, 6 | "columnIndex" : 2 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/pcs/source-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "activeTab" : 3 3 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/pcs/windowlayoutstate.pper: -------------------------------------------------------------------------------- 1 | { 2 | "left" : { 3 | "panelheight" : 611, 4 | "splitterpos" : 251, 5 | "topwindowstate" : "NORMAL", 6 | "windowheight" : 650 7 | }, 8 | "right" : { 9 | "panelheight" : 611, 10 | "splitterpos" : 380, 11 | "topwindowstate" : "NORMAL", 12 | "windowheight" : 650 13 | } 14 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/pcs/workbench-pane.pper: -------------------------------------------------------------------------------- 1 | { 2 | "TabSet1" : 4, 3 | "TabSet2" : 3, 4 | "TabZoom" : { 5 | } 6 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/persistent-state: -------------------------------------------------------------------------------- 1 | build-last-errors="[]" 2 | build-last-errors-base-dir="~/Dropbox/Pacotes do R/Pacote EGA/EGA/" 3 | build-last-outputs="[{\"output\":\"==> R CMD INSTALL --no-multiarch --with-keep.source EGA\\n\\n\",\"type\":0},{\"output\":\"* installing to library ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library’\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"* installing *source* package ‘EGAnet’ ...\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** R\\n\",\"type\":1},{\"output\":\"** data\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"*** moving datasets to lazyload DB\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** byte-compile and prepare package for lazy loading\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** help\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"*** installing help indices\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** building package indices\\n\",\"type\":1},{\"output\":\"** testing if installed package can be loaded\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"* DONE (EGAnet)\\n\",\"type\":1},{\"output\":\"\",\"type\":1}]" 4 | compile_pdf_state="{\"errors\":[],\"output\":\"\",\"running\":false,\"tab_visible\":false,\"target_file\":\"\"}" 5 | files.monitored-path="" 6 | find-in-files-state="{\"handle\":\"\",\"input\":\"\",\"path\":\"\",\"regex\":true,\"results\":{\"file\":[],\"line\":[],\"lineValue\":[],\"matchOff\":[],\"matchOn\":[]},\"running\":false}" 7 | imageDirtyState="1" 8 | saveActionState="-1" 9 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/rmd-outputs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/saved_source_markers: -------------------------------------------------------------------------------- 1 | {"active_set":"","sets":[]} -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/1692B0: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "0,0", 3 | "scrollLine" : "268" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/16BF40B5: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "28,2", 3 | "scrollLine" : "23" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/1B06F89: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "2,7", 3 | "scrollLine" : "2" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/1F8BEB03: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "254,9", 3 | "scrollLine" : "251" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/20734E87: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "2,2", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/28184444: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "8,0", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/2821F45F: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/2B750134: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "2472,366", 3 | "scrollLine" : "2471" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/2EE66BFB: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "13,1", 3 | "scrollLine" : "4" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/30A985F8: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "65,22", 3 | "scrollLine" : "121" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/30E0D90: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "107,0", 3 | "scrollLine" : "0", 4 | "tempName" : "Untitled2" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/329C5648: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "8,12", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/48AC2EFF: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "6,34", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/48F19CB1: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "12,93", 3 | "scrollLine" : "7" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/4B8203A5: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "18,12", 3 | "scrollLine" : "9" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/502CC685: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "383,20", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/54A7EF80: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "11,12", 3 | "scrollLine" : "2" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/5E852DCD: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "17,11", 3 | "scrollLine" : "11" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/6308215C: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "49,37", 3 | "scrollLine" : "44", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/684D9AFB: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "246,0", 3 | "scrollLine" : "235" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/6869E2EF: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "11,11", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/6F4412DB: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "26,12", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/748D0BA5: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "82,0", 3 | "scrollLine" : "67" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/77A6344D: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/8DD275FF: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "200,0", 3 | "scrollLine" : "185" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/90561334: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "0,11", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/995E087D: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "154,18", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/A51E928A: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "38,1", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/A6289A6D: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "15,12", 3 | "scrollLine" : "5" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/A6CE2E48: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/A8F200FF: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "17,12", 3 | "scrollLine" : "8", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/AB048C7B: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "221,0", 3 | "scrollLine" : "209" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/B0ACC44: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "540,27", 3 | "scrollLine" : "537" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/B21A34FE: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "466,0", 3 | "scrollLine" : "451" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/B2AE81D9: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "347,0", 3 | "scrollLine" : "347" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/B66917F7: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/B7E97374: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "43,26", 3 | "scrollLine" : "37", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/BA95574B: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "144,0", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/C14FA771: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "10,27", 3 | "scrollLine" : "3", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/C799AD89: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/C7BFCEBD: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "41,0", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/C8324DF9: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "36,12", 3 | "scrollLine" : "33" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/C979067C: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "17,13", 3 | "scrollLine" : "11" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/D358FCC6: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "5,32", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/D4BCA408: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "0,9", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/D8C79CBB: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "12,15", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/D967D3E3: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "53,3", 3 | "scrollLine" : "41" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/DE081089: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "5,43", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/DF68C362: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "11,11", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/DFB9D79C: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/EA0EC806: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/EC5E7BE6: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "14,42", 3 | "scrollLine" : "9", 4 | "tempName" : "Untitled1" 5 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/prop/F5A58818: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "15,12", 3 | "scrollLine" : "11" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/13C65E5C-contents: -------------------------------------------------------------------------------- 1 | #' \code{\link[EGAnet]{bootEGA}} Results of \code{\link[EGAnet]{wmt2}}Data 2 | #' 3 | #' \code{\link[EGAnet]{bootEGA}} results using the \code{"glasso"} model and 500 iterations 4 | #' of the Wiener Matrizen-Test 2 (WMT-2) 5 | #' 6 | #' @name boot.wmt 7 | #' 8 | #' @docType data 9 | #' 10 | #' @usage data(boot.wmt) 11 | #' 12 | #' @format A list with 8 objects (see \code{\link[EGAnet]{bootEGA}}) 13 | #' 14 | #' @keywords datasets 15 | #' 16 | #' @examples 17 | #' data("boot.wmt") 18 | #' 19 | NULL 20 | #---- -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/326B032F-contents: -------------------------------------------------------------------------------- 1 | #' Total Entropy Fit Index using Von Neumman's entropy (Quantum Information Theory) for correlation matrices 2 | #' 3 | #' @description Computes the fit (TEFI) of a dimensionality structure using Von Neumman's entropy when the input is a correlation matrix. 4 | #' Lower values suggest better fit of a structure to the data. 5 | #' 6 | #' @param data A dataset or a correlation matrix 7 | #' 8 | #' @param structure A vector representing the structure (numbers or labels for each item). 9 | #' Can be theoretical factors or the structure detected by \code{\link{EGA}} 10 | #' 11 | #' @return Returns a list containing: 12 | #' 13 | #' \item{Entropy.Fit}{The Entropy Fit Index using Von Neumman's entropy} 14 | #' 15 | #' \item{Total.Correlation}{The total correlation of the dataset} 16 | #' 17 | #' \item{Average.Entropy}{The average entropy of the dataset} 18 | #' 19 | #' @examples 20 | #' # Load data 21 | #' wmt <- wmt2[,7:24] 22 | #' 23 | #' \dontrun{ 24 | #' # Estimate EGA model 25 | #' ega.wmt <- EGA(data = wmt, model = "glasso") 26 | #' 27 | #' } 28 | #' 29 | #' # Compute entropy indices 30 | #' tefi(data = wmt, structure = ega.wmt$wc) 31 | #' 32 | #' @seealso \code{\link[EGAnet]{EGA}} to estimate the number of dimensions of an instrument using EGA and 33 | #' \code{\link[EGAnet]{CFA}} to verify the fit of the structure suggested by EGA using confirmatory factor analysis. 34 | #' 35 | #' @author Hudson F. Golino and Alexander P. Christensen 36 | #' 37 | #' @export 38 | # Total Entropy Fit Index Function (for correlation matrices) 39 | tefi <- function(data, structure){ 40 | if(!is.matrix(data)){ 41 | cor1 <- qgraph::cor_auto(data)/ncol(data) 42 | h.vn <- -matrixcalc::matrix.trace(cor1%*%log(cor1)) 43 | 44 | n <- max(structure) 45 | cor.fact <- vector("list") 46 | eigen.fact <- vector("list") 47 | l.eigen.fact <- vector("list") 48 | h.vn.fact <- vector("list") 49 | for(i in 1:n){ 50 | cor.fact[[i]] <- qgraph::cor_auto(data[,which(structure==unique(structure)[i])]) 51 | cor.fact[[i]] <- cor.fact[[i]]/ncol(cor.fact[[i]]) 52 | h.vn.fact[[i]] <- -matrixcalc::matrix.trace(cor.fact[[i]]%*%log(cor.fact[[i]])) 53 | } 54 | 55 | } else{ 56 | cor1 <- data/ncol(data) 57 | h.vn <- -matrixcalc::matrix.trace(cor1%*%(log(cor1))) 58 | 59 | n <- max(structure) 60 | cor.fact <- vector("list") 61 | eigen.fact <- vector("list") 62 | l.eigen.fact <- vector("list") 63 | h.vn.fact <- vector("list") 64 | for(i in 1:n){ 65 | cor.fact[[i]] <- data[which(structure==unique(structure)[i]),which(structure==unique(structure)[i])] 66 | cor.fact[[i]] <- cor.fact[[i]]/ncol(cor.fact[[i]]) 67 | h.vn.fact[[i]] <- -matrixcalc::matrix.trace(cor.fact[[i]]%*%log(cor.fact[[i]])) 68 | } 69 | } 70 | 71 | h.vn.fact2 <- unlist(h.vn.fact) 72 | 73 | # Difference between Max the sum of the factor entropies: 74 | Hdiff <- h.vn-sum(h.vn.fact2) 75 | results <- data.frame(matrix(NA, nrow = 1, ncol = 3)) 76 | colnames(results) <- c("VN.Entropy.Fit", "Total.Correlation","Average.Entropy") 77 | results$VN.Entropy.Fit <- (mean(h.vn.fact2)-h.vn)+(Hdiff*(sqrt(n))) 78 | results$Total.Correlation <- sum(h.vn.fact2)-h.vn 79 | results$Average.Entropy <- mean(h.vn.fact2)-h.vn 80 | return(results) 81 | } 82 | #---- 83 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/59956B1F-contents: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/intelligenceBattery.R 3 | \docType{data} 4 | \name{intelligenceBattery} 5 | \alias{intelligenceBattery} 6 | \title{Intelligence Data} 7 | \format{A 1185x125 response matrix} 8 | \usage{ 9 | data(intelligenceBattery) 10 | } 11 | \description{ 12 | A response matrix (n = 1152) of the International Cognitive Ability Resource (ICAR) 13 | intelligence battery developed by Condon and Revelle (2016). 14 | } 15 | \examples{ 16 | data("intelligenceBattery") 17 | 18 | } 19 | \keyword{datasets} 20 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/63529059-contents: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/boot.wmt.R 3 | \docType{data} 4 | \name{boot.wmt} 5 | \alias{boot.wmt} 6 | \title{\code{\link[EGAnet]{bootEGA}} Results of \code{\link[EGAnet]{wmt2}}Data} 7 | \format{A list with 8 objects (see \code{\link[EGAnet]{bootEGA}})} 8 | \usage{ 9 | data(boot.wmt) 10 | } 11 | \description{ 12 | \code{\link[EGAnet]{bootEGA}} results using the \code{"glasso"} model and 500 iterations 13 | of the Wiener Matrizen-Test 2 (WMT-2) 14 | } 15 | \examples{ 16 | data("boot.wmt") 17 | 18 | } 19 | \keyword{datasets} 20 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/678E8B10-contents: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(plot,CFA) 4 | S3method(plot,EGA) 5 | S3method(plot,bootEGA) 6 | S3method(print,EGA) 7 | S3method(summary,CFA) 8 | S3method(summary,EGA) 9 | export(CFA) 10 | export(EBICglasso.qgraph) 11 | export(EGA) 12 | export(EGA.fit) 13 | export(bootEGA) 14 | export(dynamic.plot) 15 | export(entropyFit) 16 | export(itemStability) 17 | export(net.loads) 18 | export(net.scores) 19 | export(tefi) 20 | export(vn.entropy) 21 | importFrom(dplyr,"%>%") 22 | importFrom(foreach,"%dopar%") 23 | importFrom(iterators,iter) 24 | importFrom(iterators,nextElem) 25 | importFrom(stats,cor) 26 | importFrom(stats,cov) 27 | importFrom(stats,cov2cor) 28 | importFrom(stats,median) 29 | importFrom(stats,na.omit) 30 | importFrom(stats,qt) 31 | importFrom(stats,rnorm) 32 | importFrom(stats,runif) 33 | importFrom(stats,sd) 34 | importFrom(utils,packageDescription) 35 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/6A950F0F-contents: -------------------------------------------------------------------------------- 1 | .onload <- function(libname, pkgname) 2 | {library.dynam("EGAnet",package=pkgname,lib.loc=libname)} 3 | 4 | .onAttach <- function(libname, pkgname) 5 | { 6 | temp <- packageDescription("EGAnet") 7 | msg <- paste("Package: ",temp$Package,": ",temp$Title,"\n", 8 | "Version: ",temp$Version,"\n", 9 | "Created on: ", 10 | temp$Date,"\n", sep="") 11 | msg <- paste(msg,"Maintainer: Hudson Golino, University of Virginia\n",sep="") 12 | msg <- paste(msg,"Contributors: Alexander Christensen, University of North Carolina at Greensboro\n",sep="") 13 | msg <- paste(msg,'For citation information, type citation("EGAnet")\n') 14 | msg <- paste(msg,'For vignettes, type browseVignettes("EGAnet")\n') 15 | msg <- paste(msg,"For bugs and errors, submit an issue to ") 16 | packageStartupMessage(msg) 17 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/818E9FA7-contents: -------------------------------------------------------------------------------- 1 | library("devtools") 2 | document() 3 | colnames(wmt2) 4 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/92F2DC19-contents: -------------------------------------------------------------------------------- 1 | library(EGAnet) 2 | str(intelligenceBattery) 3 | colnames(intelligenceBattery[,1:66]) 4 | 5 | summary(intelligenceBattery[,1:7]) 6 | sd(intelligenceBattery[,5], na.rm = TRUE) 7 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/AA49A17D-contents: -------------------------------------------------------------------------------- 1 | library(psych) 2 | citation("psych") 3 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/C2881DE0-contents: -------------------------------------------------------------------------------- 1 | library(EGAnet) 2 | EGA 3 | cor1 <- wmt2[,8:21] 4 | 5 | ega1 <- EGA(wmt2[,8:21], n = 1000, model = "glasso") 6 | ega1$correlation 7 | library(NetworkToolbox) 8 | a1 <- TMFG(wmt2[,8:21]) 9 | a1$A 10 | ?TMFG 11 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/CDAECCA2: -------------------------------------------------------------------------------- 1 | { 2 | "collab_server" : "", 3 | "contents" : "", 4 | "created" : 1553088858892.000, 5 | "dirty" : false, 6 | "encoding" : "UTF-8", 7 | "folds" : "", 8 | "hash" : "0", 9 | "id" : "CDAECCA2", 10 | "lastKnownWriteTime" : 1562117381, 11 | "last_content_update" : 1562117381381, 12 | "path" : "~/Dropbox/Pacotes do R/Pacote EGA/EGA/DESCRIPTION", 13 | "project_path" : "DESCRIPTION", 14 | "properties" : { 15 | "cursorPosition" : "5,32", 16 | "scrollLine" : "0" 17 | }, 18 | "relative_order" : 1, 19 | "source_on_save" : false, 20 | "source_window" : "", 21 | "type" : "dcf" 22 | } -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/CDAECCA2-contents: -------------------------------------------------------------------------------- 1 | Package: EGAnet 2 | Title: Exploratory Graph Analysis - A Framework for Estimating the Number of Dimensions in Multivariate Data Using Network Psychometrics 3 | Version: 0.6 4 | Date: 2019-07-02 5 | Authors@R: c(person("Hudson", "Golino", email = "hfg9s@virginia.edu", 6 | role = c("aut", "cre")), person("Alexander", "Christensen", 7 | email = "alexpaulchristensen@gmail.com", role = "aut")) 8 | Maintainer: Hudson Golino 9 | Description: An implementation of the Exploratory Graph Analysis (EGA) framework for dimensionality assessment. EGA is part of a new area called network psychometrics that focuses on the estimation of undirected network models in psychological datasets. EGA estimates the number of dimensions or factors using graphical lasso or Triangulated Maximally Filtered Graph (TMFG) and a weighted network community analysis. A bootstrap method for verifying the stability of the estimation is also available. The fit of the structure suggested by EGA can be verified using confirmatory factor analysis and a direct way to convert the EGA structure to a confirmatory factor model is also implemented. Documentation and examples are available. Golino, H. F., & Epskamp, S. (2017) . Golino, H. F., & Demetriou, A. (2017) Golino, H., Shi, D., Garrido, L. E., Christensen, A. P., Nieto, M. D., Sadana, R., & Thiyagarajan, J. A. (2018) . Christensen, A. P. & Golino, H.F. (2019) . 10 | Depends: R (>= 3.5.0) 11 | License: GPL (>= 3.0) 12 | Encoding: UTF-8 13 | LazyData: true 14 | Imports: qgraph (>= 1.4.1), semPlot (>= 1.0.1), 15 | igraph (>= 1.0.1), lavaan (>= 0.5-22), doParallel (>= 1.0.10), 16 | foreach (>= 1.4.3), 17 | NetworkToolbox (>= 1.1.2), glasso (>= 1.10), dplyr (>= 0.7.8), 18 | Matrix (>= 1.2), plotly (>= 4.7.1), mvtnorm (>= 1.0.8), 19 | corpcor (>= 1.6.9), ggpubr (>= 0.2), iterators (>= 1.0.10), 20 | stats, plyr (>= 1.8.4), matrixcalc (>= 1.0-3) 21 | Suggests: knitr, rmarkdown 22 | VignetteBuilder: knitr 23 | RoxygenNote: 6.1.1 24 | 25 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/EEB997E6-contents: -------------------------------------------------------------------------------- 1 | #' EGAnet--package 2 | #' @description An implementation of the Exploratory Graph Analysis (EGA) framework for dimensionality assessment. 3 | #' EGA is part of a new area called network psychometrics that focuses on the estimation of undirected network models 4 | #' in psychological datasets. EGA estimates the number of dimensions or factors using graphical lasso or 5 | #' Triangulated Maximally Filtered Graph (TMFG) and a weighted network community analysis. A bootstrap method for 6 | #' verifying the stability of the estimation is also available. The fit of the structure suggested by EGA can be verified 7 | #' using confirmatory factor analysis and a direct way to convert the EGA structure to a confirmatory factor model is also 8 | #' implemented. Documentation and examples are available. 9 | #' 10 | #' @references 11 | #' Golino, H. F., & Epskamp, S. (2017). 12 | #' Exploratory graph analysis: A new approach for estimating the number of dimensions in psychological research. 13 | #' \emph{PloS one}, \emph{12(6)}, e0174035.. 14 | #' doi: \href{https://doi.org/10.1371/journal.pone.0174035}{journal.pone.0174035} 15 | #' 16 | #' Golino, H. F., & Demetriou, A. (2017). 17 | #' Estimating the dimensionality of intelligence like data using Exploratory Graph Analysis. 18 | #' \emph{Intelligence}, \emph{62}, 54-70. 19 | #' doi: \href{https://doi.org/10.1016/j.intell.2017.02.007}{j.intell.2017.02.007} 20 | #' 21 | #' Golino, H., Shi, D., Garrido, L. E., Christensen, A. P., Nieto, M. D., Sadana, R., & Thiyagarajan, J. A. (2018). 22 | #' Investigating the performance of Exploratory Graph Analysis and traditional techniques to identify the number of latent factors: A simulation and tutorial. 23 | #' \emph{PsyArXiv}. 24 | #' doi: \href{https://psyarxiv.com/gzcre/}{10.31234/osf.io/gzcre} 25 | #' 26 | #' @author Hudson Golino 27 | #' 28 | "_PACKAGE" 29 | #> [1] "_PACKAGE" 30 | #EGAnet---- 31 | -------------------------------------------------------------------------------- /.Rproj.user/D46573F8/sources/s-571B5F3B/lock_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/.Rproj.user/D46573F8/sources/s-571B5F3B/lock_file -------------------------------------------------------------------------------- /.Rproj.user/shared/notebooks/patch-chunk-names: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/.Rproj.user/shared/notebooks/patch-chunk-names -------------------------------------------------------------------------------- /.Rproj.user/shared/notebooks/paths: -------------------------------------------------------------------------------- 1 | /Users/hudson/Downloads/AC39m.R="819B24D9" 2 | /Users/hudson/Downloads/entropyFit2.R="16F161FA" 3 | /Users/hudson/Dropbox/Artigos2018/EGA - Entropy Fit Measure/Paper/Code_Entropy_Paper.R="886CA237" 4 | /Users/hudson/Dropbox/Artigos2018/EGA - Entropy Fit Measure/Paper/Entropy_Paper_ExtConditions.Rmd="4B6872DB" 5 | /Users/hudson/Dropbox/Artigos2018/EGA - Entropy Fit Measure/Paper/Simulation2/Code_Sim2.R="CF14F201" 6 | /Users/hudson/Dropbox/Artigos2018/EGA - Entropy Fit Measure/Paper/script_part1.R="4AADABB7" 7 | /Users/hudson/Dropbox/Artigos2018/EGA - Entropy Fit Measure/Paper/vn_entropy_eigenvalues.R="DD31D587" 8 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/DESCRIPTION="10C5682" 9 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/NAMESPACE="6C230335" 10 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/CFA.R="1C8146DD" 11 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/EBICglasso.qgraph.R="36C155F6" 12 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/EGA.R="F383B809" 13 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/EGA.fit.R="C8E079E2" 14 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/EGAnet.R="AF08FB02" 15 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/boot.wmt.R="D88FAB82" 16 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/bootEGA.R="FF562516" 17 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/depression.R="AF5E0C1F" 18 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/dynamic.plot.R="E2A2FE1" 19 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/entropyFit.R="70C26989" 20 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/intelligenceBattery.R="55411DC2" 21 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/methods.R="9F6E170D" 22 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/plot.CFA.R="2EDF8E4F" 23 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/plot.EGA.R="8E2FFDF6" 24 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/plot.bootEGA.R="68A4E45" 25 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/print.EGA.R="6BCEDE12" 26 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/summary.CFA.R="E5B0D0DD" 27 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/summary.EGA.R="4A7E6E19" 28 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/tefi.R="186245C2" 29 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/toy.example.R="1C1C5C0E" 30 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/vn.entropy.R="65888B37" 31 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/wmt2.R="62F2F12D" 32 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/R/zzz.R="34CDFFB7" 33 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/man/EGA.fit.Rd="E03C79B1" 34 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/man/boot.wmt.Rd="91A80AB5" 35 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/man/depression.Rd="CE53AC4B" 36 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/EGA/man/intelligenceBattery.Rd="4FB5A051" 37 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/New Functions 2019/node.overlap_HFG.R="F0D68A07" 38 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/New Functions to be Added/VonNeumannEntropy.R="E43EC27A" 39 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/New Functions to be Added/entropy_fit_compare.R="A2D52A4C" 40 | /Users/hudson/Dropbox/Pacotes do R/Pacote EGA/ega.Plotly.R="9809D1BC" 41 | /Users/hudson/Dropbox/University of Virginia/Projects/EGA Unidimensional/script_unidimensional_EGA_FINAL.R="78CCDBF4" 42 | /Users/hudson/Dropbox/University of Virginia/Projects/bootEGA Paper/Simulation_Code.R="AB9F1E24" 43 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: What's gone wrong? 4 | title: Bugs and Errors 5 | labels: bug 6 | assignees: AlexChristensen 7 | 8 | --- 9 | 10 | 11 | 12 | **Summary**
13 | [A clear and concise description of what the bug is.] 14 | 15 |
16 | 17 | **Reproducible Example** 18 | (see [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) for more details)
19 | [Provide code, data, and examples to reproduce bug.] 20 | 21 | _If the error is specific to your data, then please send along the minimal data necessary in a .RData file to with a reference to this issue_ 22 | 23 |
24 | 25 | **Additional Context**
26 | [Add any other context about the problem here.] 27 | 28 |
29 | 30 | **System Settings**
31 | EGAnet version: [version number] 32 | Operating system: [Windows, Mac, Linux] 33 | OS version: [version number] -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Is there you'd like implemented? 4 | title: Feature Request 5 | labels: enhancement 6 | assignees: AlexChristensen 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/to-do.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: To-do 3 | about: Internal marker for to-do list 4 | title: [To-do] 5 | labels: enhancement 6 | 7 | --- 8 | 9 | **What do we need to do?** 10 | 11 | **Is there a timeline to do it?** 12 | 13 | **What other functions would this to-do impact?** 14 | 15 | -------------------------------------------------------------------------------- /.github/workflows/r.yml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: R-CMD-check 10 | 11 | jobs: 12 | R-CMD-check: 13 | runs-on: ${{ matrix.config.os }} 14 | 15 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 16 | 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | config: 21 | - {os: macOS-latest, r: 'release'} 22 | - {os: windows-latest, r: 'release'} 23 | - {os: ubuntu-latest, r: 'release'} 24 | 25 | env: 26 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 27 | R_KEEP_PKG_SOURCE: yes 28 | 29 | steps: 30 | 31 | - uses: actions/checkout@v2 32 | - uses: r-lib/actions/setup-tinytex@v2 33 | - run: tlmgr --version 34 | 35 | - uses: r-lib/actions/setup-pandoc@v2 36 | 37 | - uses: r-lib/actions/setup-r@v2 38 | with: 39 | r-version: ${{ matrix.config.r }} 40 | http-user-agent: ${{ matrix.config.http-user-agent }} 41 | use-public-rspm: true 42 | 43 | - uses: r-lib/actions/setup-r-dependencies@v2 44 | with: 45 | extra-packages: any::rcmdcheck 46 | needs: check 47 | 48 | - uses: r-lib/actions/check-r-package@v2 49 | with: 50 | args: 'c("--no-manual", "--as-cran")' 51 | upload-snapshots: true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | *.dll 4 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: EGAnet 2 | Title: Exploratory Graph Analysis – a Framework for Estimating the Number of Dimensions in Multivariate Data using Network Psychometrics 3 | Version: 2.3.1 4 | Date: 2025-05-08 5 | Authors@R: c(person("Hudson", "Golino", email = "hfg9s@virginia.edu", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-1601-1447")), 6 | person("Alexander", "Christensen", email = "alexpaulchristensen@gmail.com", role = "aut", comment = c(ORCID = "0000-0002-9798-7037")), 7 | person("Robert", "Moulder", email = "rgm4fd@virginia.edu", role = "ctb", comment = c(ORCID = "0000-0001-7504-9560")), 8 | person("Luis", "E. Garrido", email = "garrido.luiseduardo@gmail.com", role = "ctb", comment = c(ORCID = "0000-0001-8932-6063")), 9 | person("Laura", "Jamison", email = "lj5yn@virginia.edu", role = "ctb", comment = c(ORCID = "0000-0002-4656-8684")), 10 | person("Dingjing", "Shi", email = "dshi@ou.edu", role = "ctb", comment = c(ORCID = "0000-0002-5652-3818"))) 11 | Maintainer: Hudson Golino 12 | Description: Implements the Exploratory Graph Analysis (EGA) framework for dimensionality 13 | and psychometric assessment. EGA estimates the number of dimensions in 14 | psychological data using network estimation methods and community detection 15 | algorithms. A bootstrap method is provided to assess the stability of dimensions 16 | and items. Fit is evaluated using the Entropy Fit family of indices. Unique 17 | Variable Analysis evaluates the extent to which items are locally dependent (or 18 | redundant). Network loadings provide similar information to factor loadings and 19 | can be used to compute network scores. A bootstrap and permutation approach are 20 | available to assess configural and metric invariance. Hierarchical structures 21 | can be detected using Hierarchical EGA. Time series and intensive longitudinal 22 | data can be analyzed using Dynamic EGA, supporting individual, group, and 23 | population level assessments. 24 | Depends: R (>= 3.5.0) 25 | License: AGPL (>= 3.0) 26 | Encoding: UTF-8 27 | LazyData: true 28 | Imports: dendextend, fungible, future, future.apply, 29 | GGally, ggplot2, ggpubr, glasso, glassoFast, 30 | GPArotation, igraph (>= 1.3.0), lavaan, Matrix, 31 | methods, network, progressr, qgraph, semPlot, sna, stats 32 | Suggests: DEoptim, fitdistrplus, gridExtra, knitr, markdown, 33 | pbapply, progress, psych, pwr, RColorBrewer 34 | URL: https://r-ega.net 35 | BugReports: https://github.com/hfgolino/EGAnet/issues 36 | RoxygenNote: 7.3.2 37 | -------------------------------------------------------------------------------- /R/Embed.R: -------------------------------------------------------------------------------- 1 | #' @title Time-delay Embedding 2 | #' 3 | #' @description Reorganizes a single observed time series into an embedded matrix. The embedded 4 | #' matrix is constructed with replicates of an individual time series that are offset from 5 | #' each other in time. The function requires two parameters, one that specifies the number 6 | #' of observations to be used (i.e., the number of embedded dimensions) and the other that 7 | #' specifies the number of observations to offset successive embeddings 8 | #' 9 | #' @param x Numeric vector. 10 | #' An observed time series to be reorganized into a time-delayed embedded matrix. 11 | #' 12 | #' @param E Numeric (length = 1). 13 | #' Number of embedded dimensions or the number of observations to 14 | #' be used. \code{E = 5}, for example, will generate a matrix with 15 | #' five columns corresponding to five consecutive observations across 16 | #' each row of the embedded matrix 17 | #' 18 | #' @param tau Numeric (length = 1). 19 | #' Number of observations to offset successive embeddings. 20 | #' A tau of one uses adjacent observations. 21 | #' Default is \code{tau = 1} 22 | #' 23 | #' @return Returns a numeric matrix 24 | #' 25 | #' @examples 26 | #' # A time series with 8 time points 27 | #' time_series <- 49:56 28 | #' 29 | #' # Time series embedding 30 | #' Embed(time_series, E = 5, tau = 1) 31 | #' 32 | #' @references 33 | #' Deboeck, P. R., Montpetit, M. A., Bergeman, C. S., & Boker, S. M. (2009) 34 | #' Using derivative estimates to describe intraindividual variability at multiple time scales. 35 | #' \emph{Psychological Methods}, \emph{14}, 367-386. 36 | #' 37 | #' @author Pascal Deboeck and Alexander P. Christensen 38 | #' 39 | #' @export 40 | # Embedding matrix ---- 41 | # Updated 31.07.2023 42 | Embed <- function(x, E, tau) { 43 | 44 | # Pre-compute series length - E * tau 45 | # Uses argument errors to extract length 46 | # Either length of `x` is returned or 47 | # there is an argument error 48 | sl_E_tau <- Embed_errors(x, E, tau) - E * tau 49 | 50 | # Sequence along time series 51 | return( 52 | nvapply( 53 | seq_len(E), function(i){ 54 | x[(1 + (i - 1) * tau):(sl_E_tau + i * tau)] 55 | }, LENGTH = sl_E_tau + tau 56 | ) 57 | ) 58 | 59 | } 60 | 61 | #' @noRd 62 | # Argument errors ---- 63 | # Updated 13.08.2023 64 | Embed_errors <- function(x, E, tau) 65 | { 66 | 67 | # 'x' errors 68 | object_error(x, "vector", "Embed") 69 | typeof_error(x, "numeric", "Embed") 70 | 71 | # Get length of `x` 72 | x_length <- length(x) 73 | 74 | # 'E' errors 75 | length_error(E, 1, "Embed") 76 | typeof_error(E, "numeric", "Embed") 77 | range_error(E, c(1, x_length), "Embed") 78 | 79 | # 'tau' errors 80 | length_error(tau, 1, "Embed") 81 | typeof_error(tau, "numeric", "Embed") 82 | range_error(tau, c(1, x_length), "Embed") 83 | 84 | # Return 'x' length 85 | return(x_length) 86 | 87 | } 88 | 89 | # Bug checking ---- 90 | ## Basic input 91 | # x <- 49:56; E = 4; tau = 1 92 | 93 | # # Original function for comparison 94 | # Embed <- function(x,E,tau) { 95 | # len <- length(x) 96 | # out <- x[1:(len-(E*tau)+tau)] 97 | # for(i in 2:E) { out <- cbind(out,x[(1+((i-1)*tau)):(len-(E*tau)+(i*tau))]) } 98 | # return(out) 99 | # } 100 | -------------------------------------------------------------------------------- /R/boot.wmt.R: -------------------------------------------------------------------------------- 1 | #' @title \code{\link[EGAnet]{bootEGA}} Results of \code{\link[EGAnet]{wmt2}}Data 2 | #' 3 | #' @description \code{\link[EGAnet]{bootEGA}} results from \code{boot.wmt <- bootEGA(wmt2[,7:24], seed = 1234)} 4 | #' 5 | #' @name boot.wmt 6 | #' 7 | #' @docType data 8 | #' 9 | #' @usage data(boot.wmt) 10 | #' 11 | #' @format A list with 12 objects (see \strong{Value} in \code{\link[EGAnet]{bootEGA}}) 12 | #' 13 | #' @keywords datasets 14 | #' 15 | #' @examples 16 | #' data("boot.wmt") 17 | NULL -------------------------------------------------------------------------------- /R/convert2igraph.R: -------------------------------------------------------------------------------- 1 | #' @title Convert networks to \code{igraph} 2 | #' 3 | #' @description Converts networks to \code{igraph} format 4 | #' 5 | #' @param A Matrix or data frame. 6 | #' \emph{N} x \emph{N} matrix where \emph{N} is the number of nodes 7 | #' 8 | #' @param diagonal Numeric. 9 | #' Value to be placed on the diagonal of \code{A}. 10 | #' Defaults to \code{0} 11 | #' 12 | #' @examples 13 | #' convert2igraph(ega.wmt$network) 14 | #' 15 | #' @return Returns a network in the \code{igraph} format 16 | #' 17 | #' @author Hudson Golino & Alexander P. Christensen 18 | #' 19 | #' @export 20 | # Convert matrix to {igraph} network 21 | # Updated 09.08.2023 22 | convert2igraph <- function (A, diagonal = 0) 23 | { 24 | 25 | # Argument errors (return A in case of tibble) 26 | A <- convert2igraph_errors(A, diagonal) 27 | 28 | # Convert to matrix 29 | A <- as.matrix(A) 30 | 31 | # Change diagonal (to zero) 32 | diag(A) <- diagonal 33 | 34 | # Return {igraph} network 35 | return( 36 | silent_call( 37 | igraph::graph_from_adjacency_matrix( 38 | A, weighted = TRUE, mode = "undirected", 39 | add.colnames = FALSE 40 | ) 41 | ) 42 | ) 43 | 44 | } 45 | 46 | #' @noRd 47 | # Argument errors 48 | # Updated 13.08.2023 49 | convert2igraph_errors <- function(A, diagonal) 50 | { 51 | 52 | # 'A' errors 53 | object_error(A, c("matrix", "data.frame", "tibble"), "convert2igraph") 54 | 55 | # Check for tibble 56 | if(get_object_type(A) == "tibble"){ 57 | A <- as.data.frame(A) 58 | } 59 | 60 | # 'diagonal' errors 61 | length_error(diagonal, 1, "convert2igraph") 62 | typeof_error(diagonal, "numeric", "convert2igraph") 63 | range_error(diagonal, c(-1, 1), "convert2igraph") 64 | 65 | # Return A in case of tibble 66 | return(A) 67 | 68 | } 69 | 70 | 71 | -------------------------------------------------------------------------------- /R/convert2tidygraph.R: -------------------------------------------------------------------------------- 1 | #' Convert networks to \code{tidygraph} 2 | #' 3 | #' @description Converts networks to \code{tidygraph} format 4 | #' 5 | #' @param EGA.object 6 | #' A single \code{\link{EGAnet}} object containing the outputs 7 | #' \code{$network} and \code{$wc} 8 | #' 9 | #' @examples 10 | #' convert2tidygraph(ega.wmt) 11 | #' 12 | #' @return Returns a network in the \code{tidygraph} format 13 | #' 14 | #' @author Dominique Makowski, Hudson Golino , & Alexander P. Christensen 15 | #' 16 | #' @export 17 | # Convert network to {tidygraph} 18 | # Updated 14.07.2023 19 | convert2tidygraph <- function(EGA.object) 20 | { 21 | 22 | # Set up nodes 23 | nodes <- data.frame( 24 | name = names(EGA.object$wc), 25 | dimension = as.character(EGA.object$wc) 26 | ) 27 | 28 | # Get number of nodes 29 | node_count <- length(EGA.object$wc) 30 | 31 | # Get node sequence 32 | node_sequence <- seq_len(node_count) 33 | 34 | # Set up edges 35 | edges <- data.frame( 36 | from = rep(node_sequence, each = node_count), 37 | to = rep(node_sequence, times = node_count), 38 | link = abs(force_vector(EGA.object$network)) 39 | ) 40 | 41 | # Return result 42 | return( 43 | list( 44 | nodes = nodes, 45 | edges = edges[edges$link != 0,] 46 | ) 47 | ) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /R/cosine.R: -------------------------------------------------------------------------------- 1 | #' @title Cosine similarity 2 | #' 3 | #' @description Computes cosine similarity 4 | #' 5 | #' @param x Numeric vector, matrix, or data frame. 6 | #' If \code{nrow(x) > 1}, then \code{x} will be treated as a matrix 7 | #' to compute an \emph{n} by \emph{n} similarity matrix (\code{y} will not be used!) 8 | #' 9 | #' @param y Numeric vector, matrix, or data frame. 10 | #' Only used if \code{x} is a single variable. 11 | #' Used to compute similarity between one variable and \emph{n} other variables. 12 | #' Defaults to \code{NULL} 13 | #' 14 | #' @param ... 15 | #' Not actually used but makes it easier for general functionality 16 | #' in the package 17 | #' 18 | #' @details On missing values: \code{0} will be used to replace missing values. 19 | #' When using (matrix) multiplication, the \code{0} value cancels out the 20 | #' product rendering the missing value as "not counting" in the sums 21 | #' 22 | #' @author Alexander P. Christensen 23 | #' 24 | #' @examples 25 | #' # Load data 26 | #' wmt <- wmt2[,7:24] 27 | #' 28 | #' # Obtain cosines 29 | #' wmt_cosine <- cosine(wmt) 30 | #' 31 | #' @export 32 | #' 33 | # Compute cosine similarity ---- 34 | # Updated 16.03.2024 35 | cosine <- function(x, y = NULL, ...) 36 | { 37 | 38 | # Get formatted output from error checks 39 | output <- cosine_errors(x, y) 40 | 41 | # Determine dimensions 42 | x_dimensions <- dim(output$x) 43 | 44 | # Set all missing values to 0 45 | output$x[is.na(output$x)] <- 0 46 | 47 | # Assume if `x` has more than one column, 48 | # then perform matrix calculations 49 | if(x_dimensions[2] > 1){ 50 | 51 | # Obtain dimension names 52 | dimnames(x) 53 | 54 | # Obtain cross-product 55 | L <- crossprod(output$x) 56 | 57 | # Obtain result 58 | result <- L / sqrt(tcrossprod(diag(L))) 59 | 60 | # Get dimension names 61 | dimension_names <- dimnames(x)[[2]] 62 | 63 | # Set up dimension names 64 | dimnames(result) <- list(dimension_names, dimension_names) 65 | 66 | }else{ 67 | 68 | # Otherwise, proceed with `x` and `y` 69 | y_dimensions <- dim(output$y) 70 | 71 | # Set all missing values to 0 72 | output$y[is.na(output$y)] <- 0 73 | 74 | # Obtain result 75 | result <- matrix( 76 | nvapply( 77 | seq_len(y_dimensions[2]), function(i){ 78 | single_cosine(x, output$y[,i]) 79 | } 80 | ), nrow = 1 81 | ) 82 | 83 | } 84 | 85 | # Return values 86 | return(result) 87 | 88 | } 89 | 90 | 91 | #' @noRd 92 | # Argument errors ---- 93 | # Updated 21.09.2024 94 | cosine_errors <- function(x, y) 95 | { 96 | 97 | # 'x' errors 98 | object_error(x, c("vector", "matrix", "data.frame", "tibble"), "cosine") 99 | 100 | # Ensure matrix 101 | if(!is(x, "matrix")){ 102 | x <- as.matrix(x) 103 | } 104 | 105 | # Check for NULL 106 | if(!is.null(y)){ 107 | 108 | # 'y' errors 109 | object_error(y, c("vector", "matrix", "data.frame", "tibble"), "cosine") 110 | 111 | # Ensure matrix 112 | if(!is(y, "matrix")){ 113 | y <- as.matrix(y) 114 | } 115 | 116 | } 117 | 118 | # Return data 119 | return(list(x = x, y = y)) 120 | 121 | } 122 | 123 | #' @noRd 124 | # Single cosine ---- 125 | # Updated 21.09.2024 126 | single_cosine <- function(x, y) 127 | { 128 | return(sum(x * y) / sqrt(sum(x^2) * sum(y^2))) 129 | } 130 | -------------------------------------------------------------------------------- /R/depression.R: -------------------------------------------------------------------------------- 1 | #' @title Depression Data 2 | #' 3 | #' @description A response matrix (\emph{n} = 574) of the Beck Depression Inventory, 4 | #' Beck Anxiety Inventory, and the Athens Insomnia Scale. 5 | #' 6 | #' @name depression 7 | #' 8 | #' @docType data 9 | #' 10 | #' @usage data(depression) 11 | #' 12 | #' @format A 574x78 response matrix 13 | #' 14 | #' @keywords datasets 15 | #' 16 | #' @examples 17 | #' data("depression") 18 | #' 19 | NULL 20 | -------------------------------------------------------------------------------- /R/development.R: -------------------------------------------------------------------------------- 1 | #' @noRd 2 | # Polytomous IRT parameters ---- 3 | # Updated 26.07.2023 4 | poly.irt <- function(loadings, data) 5 | { 6 | 7 | # Check for {EGAnet} network loadings 8 | if(is(loadings, "net.loads")){ 9 | 10 | # Check for rotated loadings 11 | if(is.null(loadings$rotated)){ 12 | loadings <- loadings$std 13 | }else{ 14 | loadings <- loadings$rotated 15 | } 16 | 17 | } 18 | 19 | # Ensure matrix (and in same order as data) 20 | loadings <- as.matrix(loadings)[dimnames(data)[[2]],] 21 | 22 | # Unique variance 23 | s <- sqrt(1 - rowSums(loadings^2)) 24 | 25 | # Estimate discrimination parameters 26 | est_a <- sweep(loadings, 1, s, "/") 27 | 28 | # Estimate threshold parameters 29 | thresholds <- lapply(as.data.frame(data), obtain_thresholds) 30 | 31 | # Estimate location parameters 32 | est_d <- lapply(seq_along(thresholds), function(variable){ 33 | -thresholds[[variable]] / s[variable] 34 | }) 35 | names(est_d) <- names(thresholds) 36 | 37 | # Return results 38 | return( 39 | list( 40 | discrimination = est_a * 1.702, 41 | location = est_d 42 | ) 43 | ) 44 | 45 | } 46 | -------------------------------------------------------------------------------- /R/dnn.weights.R: -------------------------------------------------------------------------------- 1 | #' Loadings Comparison Test Deep Learning Neural Network Weights 2 | #' 3 | #' A list of weights from four different neural network models: 4 | #' random vs. non-random model (\code{r_nr_weights}), 5 | #' low correlation factor vs. network model (\code{lf_n_weights}), 6 | #' high correlation with variables less than or equal to factors vs. network model (\code{hlf_n_weights}), and 7 | #' high correlation with variables greater than factors vs. network model (\code{hgf_n_weights}) 8 | #' 9 | #' @name dnn.weights 10 | #' 11 | #' @docType data 12 | #' 13 | #' @usage data(dnn.weights) 14 | #' 15 | #' @format A list of with a length of 4 16 | #' 17 | #' @keywords datasets 18 | #' 19 | #' @examples 20 | #' data("dnn.weights") 21 | #' 22 | # Updated 17.07.2020 23 | NULL 24 | #---- 25 | -------------------------------------------------------------------------------- /R/ega.wmt.R: -------------------------------------------------------------------------------- 1 | #' @title \code{\link[EGAnet]{EGA}} Network of \code{\link[EGAnet]{wmt2}}Data 2 | #' 3 | #' @description \code{\link[EGAnet]{EGA}} results from \code{ega.wmt <- EGA(wmt2[,7:24])} 4 | #' for the Wiener Matrizen-Test (WMT-2) 5 | #' 6 | #' @name ega.wmt 7 | #' 8 | #' @docType data 9 | #' 10 | #' @usage data(ega.wmt) 11 | #' 12 | #' @format A list with 8 objects (see \strong{Value} in \code{\link[EGAnet]{EGA}}) 13 | #' 14 | #' @keywords datasets 15 | #' 16 | #' @examples 17 | #' data("ega.wmt") 18 | NULL -------------------------------------------------------------------------------- /R/frobenius.R: -------------------------------------------------------------------------------- 1 | #' @title Frobenius Norm (Similarity) 2 | #' 3 | #' @description Computes the Frobenius Norm (Ulitzsch et al., 2023) 4 | #' 5 | #' @param network1 Matrix or data frame. 6 | #' Network to be compared 7 | #' 8 | #' @param network2 Matrix or data frame. 9 | #' Second network to be compared 10 | #' 11 | #' @examples 12 | #' # Obtain wmt2 data 13 | #' wmt <- wmt2[,7:24] 14 | #' 15 | #' # Set seed (for reproducibility) 16 | #' set.seed(1234) 17 | #' 18 | #' # Split data 19 | #' split1 <- sample( 20 | #' 1:nrow(wmt), floor(nrow(wmt) / 2) 21 | #' ) 22 | #' split2 <- setdiff(1:nrow(wmt), split1) 23 | #' 24 | #' # Obtain split data 25 | #' data1 <- wmt[split1,] 26 | #' data2 <- wmt[split2,] 27 | #' 28 | #' # Perform EBICglasso 29 | #' glas1 <- EBICglasso.qgraph(data1) 30 | #' glas2 <- EBICglasso.qgraph(data2) 31 | #' 32 | #' # Frobenius norm 33 | #' frobenius(glas1, glas2) 34 | #' # 0.7070395 35 | #' 36 | #' @return Returns Frobenius Norm 37 | #' 38 | #' @references 39 | #' \strong{Simulation Study} \cr 40 | #' Ulitzsch, E., Khanna, S., Rhemtulla, M., & Domingue, B. W. (2023). 41 | #' A graph theory based similarity metric enables comparison of subpopulation psychometric networks 42 | #' \emph{Psychological Methods}. 43 | #' 44 | #' @author Hudson Golino & Alexander P. Christensen 45 | #' 46 | #' @export 47 | #' 48 | # Frobenius Norm 49 | # Updated 10.07.2024 50 | frobenius <- function(network1, network2) 51 | { 52 | 53 | # Argument errors (send back networks in case of tibble) 54 | error_return <- frobenius_errors(network1, network2) 55 | 56 | # Return similarity 57 | return( 58 | 1 / ( 59 | 1 + 60 | sqrt(sum((error_return$network1 - error_return$network2)^2, na.rm = TRUE)) / 61 | sqrt(dim(error_return$network1)[2] / 2) 62 | ) 63 | ) 64 | 65 | } 66 | 67 | #' @noRd 68 | # Argument errors ---- 69 | # Updated 13.08.2023 70 | frobenius_errors <- function(network1, network2) 71 | { 72 | 73 | # 'network1' errors 74 | object_error(network1, c("matrix", "data.frame", "tibble"), "jsd") 75 | 76 | # Check for tibble 77 | if(!is(network1, "matrix")){ 78 | network1 <- as.matrix(network1) 79 | } 80 | 81 | # 'network2' errors 82 | object_error(network2, c("matrix", "data.frame"), "jsd") 83 | 84 | # Check for tibble 85 | if(!is(network2, "matrix")){ 86 | network2 <- as.matrix(network2) 87 | } 88 | 89 | # Return networks 90 | return(list(network1 = network1, network2 = network2)) 91 | 92 | } -------------------------------------------------------------------------------- /R/genTEFI.R: -------------------------------------------------------------------------------- 1 | #' @title Generalized Total Entropy Fit Index using Von Neumman's entropy (Quantum Information Theory) for correlation matrices 2 | #' 3 | #' @description Computes the fit (Generalized TEFI) of a hierarchical or correlated bifactor 4 | #' dimensionality structure (or \code{\link{hierEGA}} objects) using Von Neumman's entropy 5 | #' when the input is a correlation matrix. Lower values suggest better fit of a structure to the data 6 | #' 7 | #' @param data Matrix, data frame, or \code{\link[EGAnet]{hierEGA}} object. 8 | #' Can be raw data or correlation matrix 9 | #' 10 | #' @param structure List (length = levels). 11 | #' A list containing the hierarchical structure. 12 | #' Each list element corresponds to increasing levels (1 = first level, 2 = second level, etc.). 13 | #' The length of the first element (first level) should be the same as the number of variables 14 | #' in \code{data}. Each level after should either be the number of variables (\code{ncol(data)}) or 15 | #' the maximum number of dimensions from the preceding level (\code{max(previous_dimensions)}) 16 | #' 17 | #' @param verbose Boolean (length = 1). 18 | #' Whether messages and (insignificant) warnings should be output. 19 | #' Defaults to \code{TRUE} to see all messages and warnings for every 20 | #' function call. 21 | #' Set to \code{FALSE} to ignore messages and warnings 22 | #' 23 | #' @return Returns a \code{levels + 1} columns data frame of the Generalized Total Entropy 24 | #' Fit Index using Von Neumman's entropy (\code{VN.Entropy.Fit}) (first column) as well as 25 | #' each individual's levels entropy 26 | #' 27 | #' @examples 28 | #' # Example using network scores 29 | #' opt.hier <- hierEGA( 30 | #' data = optimism, scores = "network", 31 | #' plot.EGA = FALSE # No plot for CRAN checks 32 | #' ) 33 | #' 34 | #' # Compute the Generalized Total Entropy Fit Index 35 | #' genTEFI(opt.hier) 36 | #' 37 | #' @author Hudson Golino and Alexander P. Christensen 38 | #' 39 | #' @export 40 | # Total Entropy Fit Index Function (for correlation matrices) 41 | # Updated 08.05.2025 42 | genTEFI <- function(data, structure = NULL, verbose = TRUE) 43 | { 44 | 45 | # Argument errors (return data in case of tibble) 46 | data <- genTEFI_errors(data, structure, verbose) 47 | 48 | # Perform TEFI 49 | return(tefi(data, structure, verbose)) 50 | 51 | } 52 | 53 | #' @noRd 54 | # Argument errors 55 | # Updated 08.05.2025 56 | genTEFI_errors <- function(data, structure, verbose) 57 | { 58 | 59 | # 'data' errors 60 | if(any(!grepl("EGA", class(data)))){ 61 | 62 | # Check for appropriate data 63 | object_error(data, c("matrix", "data.frame", "tibble"), "genTEFI") 64 | 65 | # Check for tibble 66 | if(get_object_type(data) == "tibble"){ 67 | data <- as.data.frame(data) 68 | } 69 | 70 | }else{ 71 | class_error(data, "hierEGA", "genTEFI") 72 | } 73 | 74 | # 'structure' errors 75 | if(!is.null(structure)){ 76 | object_error(structure, "list", "genTEFI") 77 | } 78 | 79 | # 'verbose' errors 80 | length_error(verbose, 1, "genTEFI") 81 | typeof_error(verbose, "logical", "genTEFI") 82 | 83 | # Return data in case of tibble 84 | return(data) 85 | 86 | } 87 | 88 | 89 | -------------------------------------------------------------------------------- /R/igraph2matrix.R: -------------------------------------------------------------------------------- 1 | #' @title Convert \code{} network to matrix 2 | #' 3 | #' @description Converts \code{} network to matrix 4 | #' 5 | #' @param igraph_network \code{} network object 6 | #' 7 | #' @param diagonal Numeric (length = 1). 8 | #' Value to be placed on the diagonal of \code{network}. 9 | #' Defaults to \code{0} 10 | #' 11 | #' @examples 12 | #' # Convert network to {igraph} 13 | #' igraph_network <- convert2igraph(ega.wmt$network) 14 | #' 15 | #' # Convert network back to matrix 16 | #' igraph2matrix(igraph_network) 17 | #' 18 | #' @return Returns a network in the \code{} format 19 | #' 20 | #' @author Hudson Golino & Alexander P. Christensen 21 | #' 22 | #' @export 23 | #' 24 | # Convert {igraph} network to matrix 25 | # Updated 03.08.2023 26 | igraph2matrix <- function (igraph_network, diagonal = 0) 27 | { 28 | 29 | # Argument errors 30 | igraph2matrix_errors(igraph_network, diagonal) 31 | 32 | # Convert {igraph} network to matrix 33 | network <- as.matrix( 34 | igraph::as_adjacency_matrix( 35 | graph = igraph_network, 36 | type = "both", attr = "weight" 37 | ) 38 | ) 39 | 40 | # Get node names 41 | node_names <- igraph::vertex.attributes(igraph_network)$`FALSE` 42 | 43 | # Add back names 44 | dimnames(network) <- list(node_names, node_names) 45 | 46 | # Make diagonal zero 47 | diag(network) <- diagonal 48 | 49 | # Return network 50 | return(network) 51 | 52 | } 53 | 54 | #' @noRd 55 | # Argument errors 56 | # Updated 13.08.2023 57 | igraph2matrix_errors <- function(igraph_network, diagonal) 58 | { 59 | 60 | # 'igraph_network' errors 61 | class_error(igraph_network, "igraph", "igraph2matrix") 62 | 63 | # 'diagonal' errors 64 | length_error(diagonal, 1, "igraph2matrix") 65 | typeof_error(diagonal, "numeric", "igraph2matrix") 66 | range_error(diagonal, c(-1, 1), "igraph2matrix") 67 | 68 | } 69 | -------------------------------------------------------------------------------- /R/intelligenceBattery.R: -------------------------------------------------------------------------------- 1 | #' Intelligence Data 2 | #' 3 | #' A response matrix (n = 1152) of the International Cognitive Ability Resource (ICAR) 4 | #' intelligence battery developed by Condon and Revelle (2016). 5 | #' 6 | #' @name intelligenceBattery 7 | #' 8 | #' @docType data 9 | #' 10 | #' @usage data(intelligenceBattery) 11 | #' 12 | #' @format A 1185x125 response matrix 13 | #' 14 | #' @keywords datasets 15 | #' 16 | #' @examples 17 | #' data("intelligenceBattery") 18 | #' 19 | NULL 20 | #---- 21 | -------------------------------------------------------------------------------- /R/optimism.R: -------------------------------------------------------------------------------- 1 | #' Optimism Data 2 | #' 3 | #' A response matrix (n = 282) containing responses to 10 items of the Revised Life 4 | #' Orientation Test (LOT-R), developed by Scheier, Carver, & Bridges (1994). 5 | #' 6 | #' @name optimism 7 | #' 8 | #' @docType data 9 | #' 10 | #' @usage data(optimism) 11 | #' 12 | #' @format A 282x10 response matrix 13 | #' 14 | #' @keywords datasets 15 | #' 16 | #' @references 17 | #' Scheier, M. F., Carver, C. S., & Bridges, M. W. (1994). 18 | #' Distinguishing optimism from neuroticism (and trait anxiety, self-mastery, and self-esteem): a reevaluation of the Life Orientation Test. 19 | #' \emph{Journal of Personality and Social Psychology}, \emph{67}, 1063-1078. 20 | #' 21 | #' @examples 22 | #' data("optimism") 23 | #' 24 | NULL 25 | #---- 26 | -------------------------------------------------------------------------------- /R/prime.num.R: -------------------------------------------------------------------------------- 1 | #' Prime Numbers through 100,000 2 | #' 3 | #' Numeric vector of primes generated from the primes package. Used in 4 | #' the function \code{[EGAnet]{ergoInfo}}. Not for general use 5 | #' 6 | #' @name prime.num 7 | #' 8 | #' @docType data 9 | #' 10 | #' @usage data(prime.num) 11 | #' 12 | #' @format A 1185x24 response matrix 13 | #' 14 | #' @keywords datasets 15 | #' 16 | #' @examples 17 | #' data("prime.num") 18 | #' 19 | NULL 20 | #---- 21 | -------------------------------------------------------------------------------- /R/rng_test.R: -------------------------------------------------------------------------------- 1 | #' @noRd 2 | # PRNG tests based on {RcppZiggurat} 3 | # Results should be non-significant 4 | # (with likely [false] positives around 0.05) 5 | # See https://cran.r-project.org/web/packages/RcppZiggurat/vignettes/RcppZiggurat.pdf 6 | # Updated 31.07.2023 7 | rng_test <- function( 8 | FUN, 9 | cases = 10000, samples = 100, 10 | seed = NULL, type = c("uniform", "normal") 11 | ) 12 | { 13 | 14 | # Get total draws 15 | total_draws <- cases * samples 16 | 17 | # Initialize starting and ending indices 18 | start <- seq.int(1, total_draws, samples) 19 | end <- seq.int(samples, total_draws, samples) 20 | 21 | # Get arguments needed for function 22 | FUN_ARGS <- obtain_arguments( 23 | FUN, list(n = total_draws, seed = seed) 24 | ) 25 | 26 | # Branch based on type 27 | if(type == "uniform"){ 28 | 29 | # Get all values 30 | all_values <- do.call( 31 | what = FUN, 32 | args = FUN_ARGS 33 | ) 34 | 35 | # Get sum of sample draws 36 | sample_sums <- nvapply( 37 | seq_along(start), function(i){ 38 | sum(all_values[start[i]:end[i]]) 39 | } 40 | ) 41 | 42 | # Get probabilities 43 | probabilities <- pnorm( 44 | sample_sums, 45 | mean = samples / 2, 46 | sd = sqrt(samples / 12) 47 | ) 48 | 49 | }else if(type == "normal"){ 50 | 51 | # Get all values 52 | all_values <- do.call( 53 | what = FUN, 54 | args = FUN_ARGS 55 | ) 56 | 57 | # Get sum of sample draws 58 | sample_sums <- nvapply( 59 | seq_along(start), function(i){ 60 | sum(all_values[start[i]:end[i]]) 61 | } 62 | ) 63 | 64 | # Get probabilities 65 | probabilities <- pnorm( 66 | sample_sums, 67 | mean = 0, 68 | sd = sqrt(samples) 69 | ) 70 | 71 | } 72 | 73 | # Return tests 74 | return( 75 | list( 76 | ks = ks.test( 77 | probabilities, 78 | "punif", 0, 1, 79 | exact = TRUE 80 | ), 81 | wilcox = wilcox.test( 82 | probabilities, mu = 0.5 83 | ) 84 | ) 85 | ) 86 | 87 | } 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /R/sim.dynEGA.R: -------------------------------------------------------------------------------- 1 | #' sim.dynEGA Data 2 | #' 3 | #' A simulated (multivariate time series) data with 24 variables, 4 | #' 100 individual observations, 50 time points per individual and 5 | #' 2 groups of individuals 6 | #' 7 | #' Data were generated using the \code{\link[EGAnet]{simDFM}} function 8 | #' with the following arguments: 9 | #' 10 | #' \strong{Group 1} 11 | #' 12 | #' \code{simDFM( 13 | #' variab = 12, timep = 50, 14 | #' nfact = 2, error = 0.125, 15 | #' dfm = "DAFS", 16 | #' loadings = EGAnet:::runif_xoshiro( 17 | #' 1, min = 0.50, max = 0.70 18 | #' ), autoreg = 0.80, crossreg = 0.00, 19 | #' var.shock = 0.36, cov.shock = 0.18 20 | #' )} 21 | #' 22 | #' \strong{Group 2} 23 | #' 24 | #' \code{simDFM( 25 | #' variab = 8, timep = 50, 26 | #' nfact = 3, error = 0.125, 27 | #' dfm = "DAFS", 28 | #' loadings = EGAnet:::runif_xoshiro( 29 | #' 1, min = 0.50, max = 0.70 30 | #' ), autoreg = 0.80, crossreg = 0.00, 31 | #' var.shock = 0.36, cov.shock = 0.18 32 | #' )} 33 | #' 34 | #' @name sim.dynEGA 35 | #' 36 | #' @docType data 37 | #' 38 | #' @usage data(sim.dynEGA) 39 | #' 40 | #' @format A 5000 x 26 multivariate time series 41 | #' 42 | #' @keywords datasets 43 | #' 44 | #' @examples 45 | #' data("sim.dynEGA") 46 | #' 47 | NULL 48 | # Updated 31.10.2023 49 | -------------------------------------------------------------------------------- /R/totalCor.R: -------------------------------------------------------------------------------- 1 | #' @title Total Correlation 2 | #' 3 | #' @description Computes the total correlation of a dataset 4 | #' 5 | #' @param data Matrix or data frame. 6 | #' Should consist only of variables to be used in the analysis 7 | #' 8 | #' @param base Numeric (length = 1). 9 | #' Base to use for entropy. 10 | #' Defaults to \code{exp(1)} or \code{2.718282} 11 | #' 12 | #' @return Returns a list containing: 13 | #' 14 | #' \item{Ind.Entropies}{Individual entropies for each variable} 15 | #' 16 | #' \item{Joint.Entropy}{The joint entropy of the dataset} 17 | #' 18 | #' \item{Total.Cor}{The total correlation of the dataset} 19 | #' 20 | #' \item{Normalized}{Total correlation divided by the sum of the individual entropies minus the maximum of the individual entropies} 21 | #' 22 | #' @author Hudson F. Golino 23 | #' 24 | #' @examples 25 | #' # Compute total correlation 26 | #' totalCor(wmt2[,7:24]) 27 | #' 28 | #' @references 29 | #' \strong{Formalization of total correlation} \cr 30 | #' Watanabe, S. (1960). 31 | #' Information theoretical analysis of multivariate correlation. 32 | #' \emph{IBM Journal of Research and Development} \emph{4}, 66-82. 33 | #' 34 | #' \strong{Applied implementation} \cr 35 | #' Felix, L. M., Mansur-Alves, M., Teles, M., Jamison, L., & Golino, H. (2021). 36 | #' Longitudinal impact and effects of booster sessions in a cognitive training program for healthy older adults. 37 | #' \emph{Archives of Gerontology and Geriatrics}, \emph{94}, 104337. 38 | #' 39 | #' @export 40 | #' 41 | # Total Correlation ---- 42 | # Updated 03.08.2024 43 | totalCor <- function(data, base = 2.718282) 44 | { 45 | 46 | # 'data' errors 47 | object_error(data, c("matrix", "data.frame", "tibble"), "totalCor") 48 | 49 | # 'base' errors 50 | typeof_error(base, "numeric", "totalCor") 51 | length_error(base, 1, "totalCor") 52 | 53 | # Ensure data is a matrix 54 | data <- as.matrix(usable_data(data, verbose = TRUE)) 55 | 56 | # Get data dimensions 57 | dimensions <- dim(data) 58 | 59 | # Get number of bins 60 | bins <- floor(sqrt(dimensions[1L] / 5)) 61 | 62 | # Set bin length 63 | bin_length <- bins + 1L 64 | 65 | # Get bin cuts 66 | bin_cuts <- lapply(seq_len(dimensions[2L]), function(variable){ 67 | 68 | # Get range 69 | data_range <- range(data[,variable], na.rm = TRUE) 70 | 71 | # Return cuts 72 | return( 73 | cut( 74 | data[,variable], 75 | breaks = seq.int(data_range[1L], data_range[2L], length.out = bin_length), 76 | include.lowest = TRUE 77 | ) 78 | ) 79 | 80 | }) 81 | 82 | # Get bin frequencies 83 | bin_frequencies <- nvapply(bin_cuts, fast_table, LENGTH = bins) / dimensions[1] 84 | 85 | # Get entropies 86 | H <- nvapply(seq_len(dimensions[2L]), function(variable){ 87 | 88 | # Get non-zero frequencies 89 | bin_non_zero <- bin_frequencies[bin_frequencies[,variable] > 0, variable] 90 | 91 | # Return entropy 92 | return(entropy(bin_non_zero, base = base)) 93 | 94 | }) 95 | 96 | # Get joint entropy of positive non-zero values 97 | H_joint <- joint_entropy(bin_cuts, base = base) # function in `dualTotatCor.R` 98 | H_sum <- sum(H, na.rm = TRUE) 99 | Total.Cor <- H_sum - H_joint 100 | 101 | # Return list 102 | return( 103 | list( 104 | Ind.Entropies = H, 105 | Joint.Entropy = H_joint, 106 | Total.Cor = Total.Cor, 107 | Normalized = Total.Cor / (H_sum - max(H, na.rm = TRUE)) 108 | ) 109 | ) 110 | 111 | } 112 | 113 | # Bug Checking ---- 114 | # ## Basic input 115 | # data <- wmt2[,7:24] -------------------------------------------------------------------------------- /R/totalCorMat.R: -------------------------------------------------------------------------------- 1 | #' @title Total Correlation Matrix 2 | #' 3 | #' @description Computes the pairwise total correlation 4 | #' (\code{\link[EGAnet]{totalCor}}) for a dataset 5 | #' 6 | #' @param data Matrix or data frame. 7 | #' Should consist only of variables to be used in the analysis 8 | #' 9 | #' @param base Numeric (length = 1). 10 | #' Base to use for entropy. 11 | #' Defaults to \code{exp(1)} or \code{2.718282} 12 | #' 13 | #' @param normalized Boolean (length = 1). 14 | #' Should the normalized total correlation be computed? 15 | #' Defaults to \code{FALSE} 16 | #' 17 | #' @return Returns a symmetric matrix with pairwise total correlations 18 | #' 19 | #' @author Hudson F. Golino 20 | #' 21 | #' @examples 22 | #' # Compute total correlation matrix 23 | #' totalCorMat(wmt2[,7:24]) 24 | #' 25 | #' @references 26 | #' \strong{Formalization of total correlation} \cr 27 | #' Watanabe, S. (1960). 28 | #' Information theoretical analysis of multivariate correlation. 29 | #' \emph{IBM Journal of Research and Development} \emph{4}, 66-82. 30 | #' 31 | #' \strong{Applied implementation} \cr 32 | #' Felix, L. M., Mansur-Alves, M., Teles, M., Jamison, L., & Golino, H. (2021). 33 | #' Longitudinal impact and effects of booster sessions in a cognitive training program for healthy older adults. 34 | #' \emph{Archives of Gerontology and Geriatrics}, \emph{94}, 104337. 35 | #' 36 | #' @export 37 | #' 38 | # Total Correlation Matrix ---- 39 | # Updated 03.08.2024 40 | totalCorMat <- function(data, base = 2.718282, normalized = FALSE) 41 | { 42 | 43 | # 'data' errors 44 | object_error(data, c("matrix", "data.frame", "tibble"), "totalCorMat") 45 | 46 | # 'base' errors 47 | typeof_error(base, "numeric", "totalCorMat") 48 | length_error(base, 1, "totalCorMat") 49 | 50 | # 'normalized' errors 51 | typeof_error(normalized, "logical", "totalCorMat") 52 | length_error(normalized, 1, "totalCorMat") 53 | 54 | # Ensure data is matrix 55 | data <- as.matrix(usable_data(data, verbose = TRUE)) 56 | 57 | # Get dimensions of data 58 | dimensions <- dim(data) 59 | 60 | # Ensure variable names 61 | data <- ensure_dimension_names(data) 62 | 63 | # Get variable names 64 | variable_names <- dimnames(data)[[2]] 65 | 66 | # Initialize total correlation matrix 67 | total_correlation <- matrix( 68 | nrow = dimensions[2], ncol = dimensions[2], 69 | dimnames = list(variable_names, variable_names) 70 | ) 71 | 72 | # Set output 73 | output <- swiftelse(normalized, "Normalized", "Total.Cor") 74 | 75 | # Fill matrix 76 | for(i in seq_len(dimensions[2])){ 77 | 78 | # Loop over other variables 79 | for(j in i:dimensions[2]){ 80 | 81 | # Fill both sides of the matrix 82 | total_correlation[i,j] <- 83 | total_correlation[j,i] <- 84 | totalCor(data[,c(i, j)])[[output]] 85 | 86 | } 87 | 88 | } 89 | 90 | # Return total correlation matrix 91 | return(total_correlation) 92 | } 93 | 94 | # Bug Checking ---- 95 | # ## Basic input 96 | # data <- wmt2[,7:24] 97 | 98 | -------------------------------------------------------------------------------- /R/wmt2.R: -------------------------------------------------------------------------------- 1 | #' WMT-2 Data 2 | #' 3 | #' A response matrix (n = 1185) of the Wiener Matrizen-Test 2 (WMT-2). 4 | #' 5 | #' @name wmt2 6 | #' 7 | #' @docType data 8 | #' 9 | #' @usage data(wmt2) 10 | #' 11 | #' @format A 1185x24 response matrix 12 | #' 13 | #' @keywords datasets 14 | #' 15 | #' @examples 16 | #' data("wmt2") 17 | #' 18 | NULL 19 | #---- 20 | -------------------------------------------------------------------------------- /R/wto.R: -------------------------------------------------------------------------------- 1 | #' @title Weighted Topological Overlap 2 | #' 3 | #' @description Computes weighted topological overlap following 4 | #' the Novick et al. (2009) definition 5 | #' 6 | #' @param network Symmetric matrix or data frame. 7 | #' A symmetric network 8 | #' 9 | #' @param signed Boolean (length = 1). 10 | #' Whether the signed version should be used. 11 | #' Defaults to \code{TRUE}. 12 | #' Use \code{FALSE} for absolute values 13 | #' 14 | #' @param diagonal.zero Boolean (length = 1). 15 | #' Whether diagonal of overlap matrix should be set to zero. 16 | #' Defaults to \code{TRUE}. 17 | #' Use \code{FALSE} to allow overlap of a node with itself 18 | #' 19 | #' @examples 20 | #' # Obtain network 21 | #' network <- network.estimation(wmt2[,7:24], model = "glasso") 22 | #' 23 | #' # Compute wTO 24 | #' wto(network) 25 | #' 26 | #' @references 27 | #' \strong{Original formalization} \cr 28 | #' Nowick, K., Gernat, T., Almaas, E., & Stubbs, L. (2009). 29 | #' Differences in human and chimpanzee gene expression patterns define an evolving network of transcription factors in brain. 30 | #' \emph{Proceedings of the National Academy of Sciences}, \emph{106}, 22358-22363. 31 | #' 32 | #' @return A symmetric matrix of weighted topological overlap 33 | #' values between each pair of variables 34 | #' 35 | #' @export 36 | #' 37 | # Weighted Topological Overlap ---- 38 | # About 10x faster than `wTO::wTO` 39 | # Updated 07.08.2023 40 | wto <- function (network, signed = TRUE, diagonal.zero = TRUE) 41 | { 42 | 43 | # Check for errors, remove attributes, and ensure network is matrix 44 | network <- wto_errors(network, signed, diagonal.zero) 45 | 46 | # Get dimensions of the network 47 | dimensions <- dim(network) 48 | 49 | # Obtain absolute network values 50 | absolute_network <- abs(network) 51 | 52 | # Determine whether absolute values should constitute the network 53 | if(!signed){ 54 | network <- absolute_network 55 | } 56 | 57 | # Obtain node strengths 58 | node_strengths <- colSums(absolute_network, na.rm = TRUE) 59 | 60 | # Obtain variable pair minimums 61 | strength_each <- rep(node_strengths, each = dimensions[2]) 62 | strength_times <- rep(node_strengths, times = dimensions[2]) 63 | 64 | # Create minimum matrix 65 | minimum_matrix <- matrix( 66 | swiftelse( 67 | strength_each < strength_times, 68 | strength_each, strength_times 69 | ), 70 | nrow = dimensions[2], ncol = dimensions[2] 71 | ) 72 | 73 | # Divide numerator by denominator 74 | omega <- (crossprod(network) + network) / 75 | (minimum_matrix + 1 - absolute_network) 76 | 77 | # Set diagonal to zero 78 | if(diagonal.zero){ 79 | diag(omega) <- 0 80 | } 81 | 82 | # Return weighted topological overlap 83 | return(omega) 84 | 85 | } 86 | 87 | #' @noRd 88 | # Argument errors ---- 89 | # Updated 13.08.2023 90 | wto_errors <- function(network, signed, diagonal.zero) 91 | { 92 | 93 | # 'network' errors 94 | object_error(network, c("matrix", "data.frame", "tibble"), "wto") 95 | 96 | # 'signed' errors 97 | length_error(signed, 1, "wto") 98 | typeof_error(signed, "logical", "wto") 99 | 100 | # 'diagonal.zero' errors 101 | length_error(diagonal.zero, 1, "wto") 102 | typeof_error(diagonal.zero, "logical", "wto") 103 | 104 | # Return network without attributes and as matrix 105 | return(as.matrix(remove_attributes(network))) 106 | 107 | } 108 | 109 | # Bug Checking ---- 110 | ## Basic input 111 | # network = network.estimation(wmt2[,7:24], model = "glasso") 112 | # signed = TRUE; diagonal.zero = TRUE 113 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | .onload <- function(libname, pkgname) 2 | { 3 | library.dynam("EGAnet",package=pkgname,lib.loc=libname) 4 | } 5 | 6 | .onAttach <- function(libname, pkgname) 7 | { 8 | msg <- styletext(styletext(paste("\nEGAnet (version ", packageVersion("EGAnet"), ")", sep = ""), defaults = "underline"), defaults = "bold") 9 | msg <- paste(msg,'\n\nFor help getting started, see ') 10 | msg <- paste(msg,"\n\nFor bugs and errors, submit an issue to ") 11 | 12 | packageStartupMessage(msg) 13 | } 14 | -------------------------------------------------------------------------------- /data/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/.DS_Store -------------------------------------------------------------------------------- /data/boot.wmt.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/boot.wmt.RData -------------------------------------------------------------------------------- /data/depression.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/depression.RData -------------------------------------------------------------------------------- /data/dnn.weights.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/dnn.weights.RData -------------------------------------------------------------------------------- /data/ega.wmt.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/ega.wmt.RData -------------------------------------------------------------------------------- /data/intelligenceBattery.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/intelligenceBattery.RData -------------------------------------------------------------------------------- /data/optimism.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/optimism.RData -------------------------------------------------------------------------------- /data/prime.num.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/prime.num.RData -------------------------------------------------------------------------------- /data/sim.dynEGA.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/sim.dynEGA.RData -------------------------------------------------------------------------------- /data/wmt2.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/data/wmt2.RData -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | citHeader("To cite {EGAnet} in publications use:") 2 | 3 | bibentry( 4 | bibtype = "manual", 5 | key = "EGAnet", 6 | title = "EGAnet: Exploratory Graph Analysis – A framework for estimating the number of dimensions in multivariate data using network psychometrics", 7 | author = c( 8 | person("Golino,", "Hudson"), 9 | person("Christensen,", "Alexander") 10 | ), 11 | year = "2025", 12 | url = "https://r-ega.net", 13 | doi = "10.32614/CRAN.package.EGAnet", 14 | note = "R package version 2.1.1", 15 | 16 | textVersion = 17 | paste0("Golino, H., & Christensen, A. P. (2025). ", 18 | "EGAnet: Exploratory Graph Analysis – A framework for estimating the number of dimensions in multivariate data using network psychometrics. ", 19 | "https://doi.org/10.32614/CRAN.package.EGAnet") 20 | ) 21 | -------------------------------------------------------------------------------- /inst/EGAnet_hex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/inst/EGAnet_hex.png -------------------------------------------------------------------------------- /inst/EGAnet_hex_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hfgolino/EGAnet/603884ddbe60ba1e0544961358279526cb851dd7/inst/EGAnet_hex_2.png -------------------------------------------------------------------------------- /man/CFA.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CFA.R 3 | \name{CFA} 4 | \alias{CFA} 5 | \title{CFA Fit of \code{\link[EGAnet]{EGA}} or \code{\link[EGAnet]{hierEGA}} Structure} 6 | \usage{ 7 | CFA(ega.obj, data, estimator, plot.CFA = TRUE, layout = "spring", ...) 8 | } 9 | \arguments{ 10 | \item{ega.obj}{An \code{\link[EGAnet]{EGA}} object or 11 | an \code{\link[EGAnet]{hierEGA}}} 12 | 13 | \item{data}{Matrix or data frame. 14 | Should consist only of variables to be used in the analysis} 15 | 16 | \item{estimator}{The estimator used in the confirmatory factor analysis. 17 | 'WLSMV' is the estimator of choice for ordinal variables. 18 | 'ML' or 'WLS' for interval variables. 19 | See \code{\link[lavaan]{lavOptions}} for more details} 20 | 21 | \item{plot.CFA}{Logical. 22 | Should the CFA structure with its standardized loadings be plot? 23 | Defaults to TRUE} 24 | 25 | \item{layout}{Layout of plot (see \code{\link[semPlot]{semPaths}}). 26 | Defaults to "spring"} 27 | 28 | \item{...}{Arguments passed to \code{\link[lavaan]{cfa}}} 29 | } 30 | \value{ 31 | Returns a list containing: 32 | 33 | \item{fit}{Output from \code{\link[lavaan]{cfa}}} 34 | 35 | \item{summary}{Summary output from \code{\link[lavaan]{lavaan-class}}} 36 | 37 | \item{fit.measures}{Fit measures: chi-squared, 38 | degrees of freedom, p-value, CFI, RMSEA, GFI, and NFI. 39 | Additional fit measures can be applied using the 40 | \code{\link[lavaan]{fitMeasures}} function (see examples)} 41 | } 42 | \description{ 43 | Verifies the fit of the structure suggested by 44 | \code{\link[EGAnet]{EGA}} or by \code{\link[EGAnet]{hierEGA}} using 45 | confirmatory factor analysis 46 | } 47 | \examples{ 48 | # Load data 49 | wmt <- wmt2[,7:24] 50 | 51 | \dontrun{ 52 | # Estimate EGA 53 | ega.wmt <- EGA( 54 | data = wmt, 55 | plot.EGA = FALSE # No plot for CRAN checks 56 | ) 57 | 58 | # Fit CFA model to EGA results 59 | cfa.wmt <- CFA( 60 | ega.obj = ega.wmt, estimator = "WLSMV", 61 | plot.CFA = FALSE, # No plot for CRAN checks 62 | data = wmt 63 | ) 64 | 65 | # Additional fit measures 66 | lavaan::fitMeasures(cfa.wmt$fit, fit.measures = "all")} 67 | 68 | } 69 | \references{ 70 | \strong{Demonstrative use} \cr 71 | Christensen, A. P., Gross, G. M., Golino, H., Silvia, P. J., & Kwapil, T. R. (2019). 72 | Exploratory graph analysis of the Multidimensional Schizotypy Scale. 73 | \emph{Schizophrenia Research}, \emph{206}, 43-51. 74 | 75 | \strong{Initial implementation} \cr 76 | Golino, H., & Epskamp, S. (2017). 77 | Exploratory graph analysis: A new approach for estimating the number of dimensions in psychological research. 78 | \emph{PLoS ONE}, \emph{12}, e0174035. 79 | } 80 | \author{ 81 | Hudson F. Golino 82 | } 83 | -------------------------------------------------------------------------------- /man/EGM.compare.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/EGM.compare.R 3 | \name{EGM.compare} 4 | \alias{EGM.compare} 5 | \title{Compare \code{\link[EGAnet]{EGM}} with EFA} 6 | \usage{ 7 | EGM.compare( 8 | data, 9 | constrain.structure = FALSE, 10 | constrain.zeros = FALSE, 11 | fm = "ml", 12 | rotation = "geominQ", 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{data}{Matrix or data frame. 18 | Should consist only of variables to be used in the analysis. 19 | Can be raw data or a correlation matrix} 20 | 21 | \item{constrain.structure}{Boolean (length = 1). 22 | Whether memberships of the communities should 23 | be added as a constraint when optimizing the network loadings. 24 | Defaults to \code{TRUE} which ensures assigned loadings are 25 | guaranteed to never be smaller than any cross-loadings. 26 | Set to \code{FALSE} to freely estimate each loading similar to exploratory factor analysis 27 | 28 | \emph{Note: This default differs from} \code{\link[EGAnet]{EGM}}\emph{. 29 | Constraining loadings puts EGM at a deficit relative to EFA and therefore 30 | biases the comparability between the methods. It's best to leave the 31 | default of unconstrained when using this function.}} 32 | 33 | \item{constrain.zeros}{Boolean (length = 1). 34 | Whether zeros in the estimated network loading matrix should 35 | be retained when optimizing the network loadings. 36 | Defaults to \code{TRUE} which ensures that zero networks loadings are retained. 37 | Set to \code{FALSE} to freely estimate each loading similar to exploratory factor analysis 38 | 39 | \emph{Note: This default differs from} \code{\link[EGAnet]{EGM}}\emph{. 40 | Constraining zeros puts EGM at a deficit relative to EFA and therefore 41 | biases the comparability between the methods. It's best to leave the 42 | default of unconstrained when using this function.}} 43 | 44 | \item{fm}{Character (length = 1). 45 | Estimation method for the EFA. 46 | See argument in \code{\link[psych]{fa}} for more details. 47 | Defaults to \code{"ml"} or maximum likelihood} 48 | 49 | \item{rotation}{Character (length = 1). 50 | A rotation to use to obtain a simpler structure for EFA. 51 | For a list of rotations, see \code{\link[GPArotation]{rotations}} for options. 52 | Defaults to \code{"geominQ"}} 53 | 54 | \item{...}{Additional arguments to be passed on to 55 | \code{\link[EGAnet]{auto.correlate}}, 56 | \code{\link[EGAnet]{network.estimation}}, 57 | \code{\link[EGAnet]{community.detection}}, 58 | \code{\link[EGAnet]{community.consensus}}, 59 | \code{\link[EGAnet]{community.unidimensional}}, 60 | \code{\link[EGAnet]{EGA}}, 61 | \code{\link[EGAnet]{EGM}}, 62 | \code{\link[EGAnet]{net.loads}}, and 63 | \code{\link[psych]{fa}}} 64 | } 65 | \description{ 66 | Estimates an \code{\link[EGAnet]{EGM}} based on \code{\link[EGAnet]{EGA}} and 67 | uses the number of communities as the number of dimensions in exploratory factor analysis 68 | (EFA) using \code{\link[psych]{fa}} 69 | } 70 | \examples{ 71 | # Get depression data 72 | data <- depression[,24:44] 73 | 74 | # Compare EGM (using EGA) with EFA 75 | \dontrun{ 76 | results <- EGM.compare(data) 77 | 78 | # Print summary 79 | summary(results)} 80 | 81 | } 82 | \author{ 83 | Hudson F. Golino and Alexander P. Christensen 84 | } 85 | -------------------------------------------------------------------------------- /man/Embed.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Embed.R 3 | \name{Embed} 4 | \alias{Embed} 5 | \title{Time-delay Embedding} 6 | \usage{ 7 | Embed(x, E, tau) 8 | } 9 | \arguments{ 10 | \item{x}{Numeric vector. 11 | An observed time series to be reorganized into a time-delayed embedded matrix.} 12 | 13 | \item{E}{Numeric (length = 1). 14 | Number of embedded dimensions or the number of observations to 15 | be used. \code{E = 5}, for example, will generate a matrix with 16 | five columns corresponding to five consecutive observations across 17 | each row of the embedded matrix} 18 | 19 | \item{tau}{Numeric (length = 1). 20 | Number of observations to offset successive embeddings. 21 | A tau of one uses adjacent observations. 22 | Default is \code{tau = 1}} 23 | } 24 | \value{ 25 | Returns a numeric matrix 26 | } 27 | \description{ 28 | Reorganizes a single observed time series into an embedded matrix. The embedded 29 | matrix is constructed with replicates of an individual time series that are offset from 30 | each other in time. The function requires two parameters, one that specifies the number 31 | of observations to be used (i.e., the number of embedded dimensions) and the other that 32 | specifies the number of observations to offset successive embeddings 33 | } 34 | \examples{ 35 | # A time series with 8 time points 36 | time_series <- 49:56 37 | 38 | # Time series embedding 39 | Embed(time_series, E = 5, tau = 1) 40 | 41 | } 42 | \references{ 43 | Deboeck, P. R., Montpetit, M. A., Bergeman, C. S., & Boker, S. M. (2009) 44 | Using derivative estimates to describe intraindividual variability at multiple time scales. 45 | \emph{Psychological Methods}, \emph{14}, 367-386. 46 | } 47 | \author{ 48 | Pascal Deboeck and Alexander P. Christensen 49 | } 50 | -------------------------------------------------------------------------------- /man/auto.correlate.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/auto.correlate.R 3 | \name{auto.correlate} 4 | \alias{auto.correlate} 5 | \title{Automatic correlations} 6 | \usage{ 7 | auto.correlate( 8 | data, 9 | corr = c("cosine", "kendall", "pearson", "spearman"), 10 | ordinal.categories = 7, 11 | forcePD = TRUE, 12 | na.data = c("pairwise", "listwise"), 13 | empty.method = c("none", "zero", "all"), 14 | empty.value = c("none", "point_five", "one_over"), 15 | verbose = FALSE, 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{data}{Matrix or data frame. 21 | Should consist only of variables to be used in the analysis} 22 | 23 | \item{corr}{Character (length = 1). 24 | The standard correlation method to be used. 25 | Defaults to \code{"pearson"}. 26 | Using \code{"pearson"} will compute polychoric, tetrachoric, polyserial, 27 | and biserial correlations for categorical and categorical/continuous correlations 28 | by default. To obtain \code{"pearson"} correlations regardless, use \code{\link{cor}}. 29 | Other options of \code{"kendall"} and \code{"spearman"} are provided for 30 | completeness and use \code{\link{cor}}. \code{\link[EGAnet]{cosine}} is also available} 31 | 32 | \item{ordinal.categories}{Numeric (length = 1). 33 | \emph{Up to} the number of categories \emph{before} a variable is considered continuous. 34 | Defaults to \code{7} categories before \code{8} is considered continuous} 35 | 36 | \item{forcePD}{Boolean (length = 1). 37 | Whether positive definite matrix should be enforced. 38 | Defaults to \code{TRUE}} 39 | 40 | \item{na.data}{Character (length = 1). 41 | How should missing data be handled? 42 | Defaults to \code{"pairwise"}. 43 | Available options: 44 | 45 | \itemize{ 46 | 47 | \item \code{"pairwise"} --- Computes correlation for all available 48 | cases between two variables 49 | 50 | \item \code{"listwise"} --- Computes correlation for all complete 51 | cases in the dataset 52 | 53 | }} 54 | 55 | \item{empty.method}{Character (length = 1). 56 | Method for empty cell correction in \code{\link[EGAnet]{polychoric.matrix}}. 57 | Defaults to \code{"none"} 58 | Available options: 59 | 60 | \itemize{ 61 | 62 | \item \code{"none"} --- Adds no value (\code{empty.value = "none"}) 63 | to the empirical joint frequency table between two variables 64 | 65 | \item \code{"zero"} --- Adds \code{empty.value} to the cells with 66 | zero in the joint frequency table between two variables 67 | 68 | \item \code{"all"} --- Adds \code{empty.value} to all 69 | in the joint frequency table between two variables 70 | 71 | }} 72 | 73 | \item{empty.value}{Character (length = 1). 74 | Value to add to the joint frequency table cells in \code{\link[EGAnet]{polychoric.matrix}}. 75 | Defaults to \code{"none"}. 76 | Accepts numeric values between 0 and 1 or specific methods: 77 | 78 | \itemize{ 79 | 80 | \item \code{"none"} --- Adds no value (\code{0}) to the empirical 81 | joint frequency table between two variables 82 | 83 | \item \code{"point_five"} --- Adds \code{0.5} to the cells 84 | defined by \code{empty.method} 85 | 86 | \item \code{"one_over"} --- Adds \code{1 / n} where \code{n} equals the 87 | number of cells based on \code{empty.method}. For 88 | \code{empty.method = "zero"}, \code{n} equals the number of zero cells 89 | 90 | }} 91 | 92 | \item{verbose}{Boolean (length = 1). 93 | Whether messages should be printed. 94 | Defaults to \code{FALSE}} 95 | 96 | \item{...}{Not actually used but makes it easier for general functionality 97 | in the package} 98 | } 99 | \description{ 100 | This wrapper is similar to \code{\link[qgraph]{cor_auto}}. There 101 | are some minor adjustments that make this function simpler and to 102 | function within \code{\link{EGAnet}}. \code{NA} values are not treated 103 | as categories (this behavior differs from \code{\link[qgraph]{cor_auto}}) 104 | } 105 | \examples{ 106 | # Load data 107 | wmt <- wmt2[,7:24] 108 | 109 | # Obtain correlations 110 | wmt_corr <- auto.correlate(wmt) 111 | 112 | } 113 | \author{ 114 | Alexander P. Christensen 115 | } 116 | -------------------------------------------------------------------------------- /man/boot.wmt.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/boot.wmt.R 3 | \docType{data} 4 | \name{boot.wmt} 5 | \alias{boot.wmt} 6 | \title{\code{\link[EGAnet]{bootEGA}} Results of \code{\link[EGAnet]{wmt2}}Data} 7 | \format{ 8 | A list with 12 objects (see \strong{Value} in \code{\link[EGAnet]{bootEGA}}) 9 | } 10 | \usage{ 11 | data(boot.wmt) 12 | } 13 | \description{ 14 | \code{\link[EGAnet]{bootEGA}} results from \code{boot.wmt <- bootEGA(wmt2[,7:24], seed = 1234)} 15 | } 16 | \examples{ 17 | data("boot.wmt") 18 | } 19 | \keyword{datasets} 20 | -------------------------------------------------------------------------------- /man/color_palette_EGA.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/color_palette_EGA.R 3 | \name{color_palette_EGA} 4 | \alias{color_palette_EGA} 5 | \title{\code{\link[EGAnet]{EGA}} Color Palettes} 6 | \usage{ 7 | color_palette_EGA( 8 | name = c("polychrome", "blue.ridge1", "blue.ridge2", "rainbow", "rio", "itacare", 9 | "grayscale"), 10 | wc, 11 | sorted = FALSE 12 | ) 13 | } 14 | \arguments{ 15 | \item{name}{Character. 16 | Name of color scheme (see \code{\link[RColorBrewer]{RColorBrewer}}). 17 | Defaults to \code{"polychrome"}. 18 | \code{\link[EGAnet]{EGA}} palettes: 19 | 20 | \itemize{ 21 | 22 | \item \code{"polychrome"} --- Default 40 color palette 23 | 24 | \item \code{"grayscale"} --- "grayscale", "greyscale", or "colorblind" will produce 25 | plots suitable for publication purposes 26 | 27 | \item \code{"blue.ridge1"} --- Palette inspired by the Blue Ridge Mountains 28 | 29 | \item \code{"blue.ridge2"} --- Second palette inspired by the Blue Ridge Mountains 30 | 31 | \item \code{"rainbow"} --- Rainbow colors. Default for \code{\link[qgraph]{qgraph}} 32 | 33 | \item \code{"rio"} --- Palette inspired by Rio de Janiero, Brazil 34 | 35 | \item \code{"itacare"} --- Palette inspired by Itacare, Brazil 36 | 37 | } 38 | 39 | For custom colors, enter HEX codes for each dimension in a vector} 40 | 41 | \item{wc}{Numeric vector. 42 | A vector representing the community (dimension) membership 43 | of each node in the network. \code{NA} values mean that the node 44 | was disconnected from the network} 45 | 46 | \item{sorted}{Boolean. 47 | Should colors be sorted by \code{wc}? 48 | Defaults to \code{FALSE}} 49 | } 50 | \value{ 51 | Vector of colors for community memberships 52 | } 53 | \description{ 54 | Color palettes for plotting \code{\link[GGally]{ggnet2}} 55 | \code{\link[EGAnet]{EGA}} network plots 56 | } 57 | \examples{ 58 | # Default 59 | color_palette_EGA(name = "polychrome", wc = ega.wmt$wc) 60 | 61 | # Blue Ridge Moutains 1 62 | color_palette_EGA(name = "blue.ridge1", wc = ega.wmt$wc) 63 | 64 | # Custom 65 | color_palette_EGA(name = c("#7FD1B9", "#24547e"), wc = ega.wmt$wc) 66 | 67 | } 68 | \seealso{ 69 | \code{\link[EGAnet]{plot.EGAnet}} for plot usage in \code{\link{EGAnet}} 70 | } 71 | \author{ 72 | Hudson Golino , Alexander P. Christensen 73 | } 74 | -------------------------------------------------------------------------------- /man/community.homogenize.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/community.homogenize.R 3 | \name{community.homogenize} 4 | \alias{community.homogenize} 5 | \title{Homogenize Community Memberships} 6 | \usage{ 7 | community.homogenize(target.membership, convert.membership) 8 | } 9 | \arguments{ 10 | \item{target.membership}{Vector, matrix, or data frame. 11 | The target memberships that all other memberships input into 12 | \code{convert.membership} should be homogenize \strong{toward}} 13 | 14 | \item{convert.membership}{Vector, matrix, or data frame. 15 | Either a vector of memberships the same length as 16 | \code{target.membership} or a matrix or data frame of many 17 | membership solutions with either across rows or down columns the same 18 | length as \code{target.membership} (this function will automatically 19 | determine this orientation for you with precedence given solutions 20 | \emph{across rows})} 21 | } 22 | \value{ 23 | Returns a vector or matrix the length or size of 24 | \code{convert.membership} with memberships homogenized toward 25 | \code{target.membership} 26 | } 27 | \description{ 28 | Memberships from community detection algorithms do not always 29 | align numerically. This function seeks to homogenize 30 | community memberships between a target membership (the 31 | membership to homogenize toward) and one or more other 32 | memberships. This function is the core of the 33 | \code{\link[EGAnet]{dimensionStability}} and 34 | \code{\link[EGAnet]{itemStability}} functions 35 | } 36 | \examples{ 37 | # Get network 38 | network <- network.estimation(wmt2[,7:24]) 39 | 40 | # Apply Walktrap 41 | network_walktrap <- community.detection( 42 | network, algorithm = "walktrap" 43 | ) 44 | 45 | # Apply Louvain 46 | network_louvain <- community.detection( 47 | network, algorithm = "louvain" 48 | ) 49 | 50 | # Homogenize toward Walktrap 51 | community.homogenize(network_walktrap, network_louvain) 52 | 53 | } 54 | \references{ 55 | \strong{Original implementation of bootEGA} \cr 56 | Christensen, A. P., & Golino, H. (2021). 57 | Estimating the stability of the number of factors via Bootstrap Exploratory Graph Analysis: A tutorial. 58 | \emph{Psych}, \emph{3}(3), 479-500. 59 | } 60 | \author{ 61 | Hudson Golino and Alexander P. Christensen 62 | } 63 | -------------------------------------------------------------------------------- /man/compare.EGA.plots.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compare.EGA.plots.R 3 | \name{compare.EGA.plots} 4 | \alias{compare.EGA.plots} 5 | \title{Visually Compare Two or More \code{EGAnet} plots} 6 | \usage{ 7 | compare.EGA.plots( 8 | ..., 9 | input.list = NULL, 10 | base = 1, 11 | labels = NULL, 12 | rows = NULL, 13 | columns = NULL, 14 | plot.all = TRUE 15 | ) 16 | } 17 | \arguments{ 18 | \item{...}{Handles multiple arguments: 19 | 20 | \itemize{ 21 | 22 | \item \code{*EGA} objects --- can be dropped in without any argument 23 | designation. The function will search across input to find 24 | necessary \code{EGAnet} objects 25 | 26 | \item \code{\link[GGally]{ggnet2}} arguments --- can be passed along to \code{\link[GGally]{ggnet2}} 27 | 28 | \item \code{\link[sna]{gplot.layout}} --- can be specified using \code{mode = } or 29 | \code{layout = } using the name of the layout 30 | (e.g., \code{mode = "circle"} will produce the 31 | circle layout from \link[sna]{gplot.layout}). 32 | By default, the layout is the same as \code{qgraph} 33 | 34 | }} 35 | 36 | \item{input.list}{List. 37 | Bypasses \code{...} argument in favor of using a list 38 | as an input} 39 | 40 | \item{base}{Numeric (length = 1). 41 | Plot to be used as the base for the configuration of the networks. 42 | Uses the number of the order in which the plots are input. 43 | Defaults to \code{1} or the first plot} 44 | 45 | \item{labels}{Character (same length as input). 46 | Labels for each \code{EGAnet} object} 47 | 48 | \item{rows}{Numeric (length = 1). 49 | Number of rows to spread plots across} 50 | 51 | \item{columns}{Numeric (length = 1). 52 | Number of columns to spread plots down} 53 | 54 | \item{plot.all}{Boolean (length = 1). 55 | Whether plot should be produced or just output. 56 | Defaults to \code{TRUE}. 57 | Set to \code{FALSE} to avoid plotting (but still obtain 58 | plot objects)} 59 | } 60 | \value{ 61 | Visual comparison of \code{EGAnet} objects 62 | } 63 | \description{ 64 | Organizes EGA plots for comparison. Ensures that 65 | nodes are placed in the same layout to maximize comparison 66 | } 67 | \examples{ 68 | # Obtain WMT-2 data 69 | wmt <- wmt2[,7:24] 70 | 71 | # Draw random samples of 300 cases 72 | sample1 <- wmt[sample(1:nrow(wmt), 300),] 73 | sample2 <- wmt[sample(1:nrow(wmt), 300),] 74 | 75 | # Estimate EGAs 76 | ega1 <- EGA(sample1) 77 | ega2 <- EGA(sample2) 78 | 79 | \donttest{ 80 | # Compare EGAs via plot 81 | compare.EGA.plots( 82 | ega1, ega2, 83 | base = 1, # use "ega1" as base for comparison 84 | labels = c("Sample 1", "Sample 2"), 85 | rows = 1, columns = 2 86 | ) 87 | 88 | # Change layout to circle plots 89 | compare.EGA.plots( 90 | ega1, ega2, 91 | labels = c("Sample 1", "Sample 2"), 92 | mode = "circle" 93 | )} 94 | 95 | } 96 | \seealso{ 97 | \code{\link[EGAnet]{plot.EGAnet}} for plot usage in \code{EGAnet} 98 | } 99 | \author{ 100 | Alexander Christensen 101 | } 102 | -------------------------------------------------------------------------------- /man/convert2igraph.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/convert2igraph.R 3 | \name{convert2igraph} 4 | \alias{convert2igraph} 5 | \title{Convert networks to \code{igraph}} 6 | \usage{ 7 | convert2igraph(A, diagonal = 0) 8 | } 9 | \arguments{ 10 | \item{A}{Matrix or data frame. 11 | \emph{N} x \emph{N} matrix where \emph{N} is the number of nodes} 12 | 13 | \item{diagonal}{Numeric. 14 | Value to be placed on the diagonal of \code{A}. 15 | Defaults to \code{0}} 16 | } 17 | \value{ 18 | Returns a network in the \code{igraph} format 19 | } 20 | \description{ 21 | Converts networks to \code{igraph} format 22 | } 23 | \examples{ 24 | convert2igraph(ega.wmt$network) 25 | 26 | } 27 | \author{ 28 | Hudson Golino & Alexander P. Christensen 29 | } 30 | -------------------------------------------------------------------------------- /man/convert2tidygraph.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/convert2tidygraph.R 3 | \name{convert2tidygraph} 4 | \alias{convert2tidygraph} 5 | \title{Convert networks to \code{tidygraph}} 6 | \usage{ 7 | convert2tidygraph(EGA.object) 8 | } 9 | \arguments{ 10 | \item{EGA.object}{A single \code{\link{EGAnet}} object containing the outputs 11 | \code{$network} and \code{$wc}} 12 | } 13 | \value{ 14 | Returns a network in the \code{tidygraph} format 15 | } 16 | \description{ 17 | Converts networks to \code{tidygraph} format 18 | } 19 | \examples{ 20 | convert2tidygraph(ega.wmt) 21 | 22 | } 23 | \author{ 24 | Dominique Makowski, Hudson Golino , & Alexander P. Christensen 25 | } 26 | -------------------------------------------------------------------------------- /man/cosine.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cosine.R 3 | \name{cosine} 4 | \alias{cosine} 5 | \title{Cosine similarity} 6 | \usage{ 7 | cosine(x, y = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{Numeric vector, matrix, or data frame. 11 | If \code{nrow(x) > 1}, then \code{x} will be treated as a matrix 12 | to compute an \emph{n} by \emph{n} similarity matrix (\code{y} will not be used!)} 13 | 14 | \item{y}{Numeric vector, matrix, or data frame. 15 | Only used if \code{x} is a single variable. 16 | Used to compute similarity between one variable and \emph{n} other variables. 17 | Defaults to \code{NULL}} 18 | 19 | \item{...}{Not actually used but makes it easier for general functionality 20 | in the package} 21 | } 22 | \description{ 23 | Computes cosine similarity 24 | } 25 | \details{ 26 | On missing values: \code{0} will be used to replace missing values. 27 | When using (matrix) multiplication, the \code{0} value cancels out the 28 | product rendering the missing value as "not counting" in the sums 29 | } 30 | \examples{ 31 | # Load data 32 | wmt <- wmt2[,7:24] 33 | 34 | # Obtain cosines 35 | wmt_cosine <- cosine(wmt) 36 | 37 | } 38 | \author{ 39 | Alexander P. Christensen 40 | } 41 | -------------------------------------------------------------------------------- /man/depression.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/depression.R 3 | \docType{data} 4 | \name{depression} 5 | \alias{depression} 6 | \title{Depression Data} 7 | \format{ 8 | A 574x78 response matrix 9 | } 10 | \usage{ 11 | data(depression) 12 | } 13 | \description{ 14 | A response matrix (\emph{n} = 574) of the Beck Depression Inventory, 15 | Beck Anxiety Inventory, and the Athens Insomnia Scale. 16 | } 17 | \examples{ 18 | data("depression") 19 | 20 | } 21 | \keyword{datasets} 22 | -------------------------------------------------------------------------------- /man/dimensionStability.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dimensionStability.R 3 | \name{dimensionStability} 4 | \alias{dimensionStability} 5 | \title{Dimension Stability Statistics from \code{\link[EGAnet]{bootEGA}}} 6 | \usage{ 7 | dimensionStability(bootega.obj, IS.plot = TRUE, structure = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{bootega.obj}{A \code{\link[EGAnet]{bootEGA}} object} 11 | 12 | \item{IS.plot}{Boolean (length = 1). 13 | Should the plot be produced for \code{item.replication}? 14 | Defaults to \code{TRUE}} 15 | 16 | \item{structure}{Numeric (length = number of variables). 17 | A theoretical or pre-defined structure. 18 | Defaults to \code{NULL} or the empirical \code{\link[EGAnet]{EGA}} 19 | result in the \code{bootega.obj}} 20 | 21 | \item{...}{Additional arguments. 22 | Used for deprecated arguments from previous versions of \code{\link[EGAnet]{itemStability}}} 23 | } 24 | \value{ 25 | Returns a list containing: 26 | 27 | \item{dimension.stability}{A list containing: 28 | 29 | \itemize{ 30 | 31 | \item \code{structural.consistency} --- The proportion of times that 32 | each empirical \code{\link[EGAnet]{EGA}} dimension \emph{exactly} 33 | replicates across the \code{\link[EGAnet]{bootEGA}} samples 34 | 35 | \item \code{average.item.stability} --- The average item stability in 36 | each empirical \code{\link[EGAnet]{EGA}} dimension 37 | 38 | } 39 | 40 | } 41 | 42 | \item{item.stability}{Results from \code{\link[EGAnet]{itemStability}}} 43 | } 44 | \description{ 45 | Based on the \code{\link[EGAnet]{bootEGA}} results, 46 | this function computes the stability of dimensions. Stability is 47 | computed by assessing the proportion of times the 48 | original dimension is exactly replicated in across bootstrap samples 49 | } 50 | \examples{ 51 | # Load data 52 | wmt <- wmt2[,7:24] 53 | 54 | \dontrun{ 55 | # Estimate bootstrap EGA 56 | boot.wmt <- bootEGA( 57 | data = wmt, iter = 500, 58 | type = "parametric", ncores = 2 59 | )} 60 | 61 | # Estimate stability statistics 62 | dimensionStability(boot.wmt) 63 | 64 | } 65 | \references{ 66 | \strong{Original implementation of bootEGA} \cr 67 | Christensen, A. P., & Golino, H. (2021). 68 | Estimating the stability of the number of factors via Bootstrap Exploratory Graph Analysis: A tutorial. 69 | \emph{Psych}, \emph{3}(3), 479-500. 70 | 71 | \strong{Conceptual introduction} \cr 72 | Christensen, A. P., Golino, H., & Silvia, P. J. (2020). 73 | A psychometric network perspective on the validity and validation of personality trait questionnaires. 74 | \emph{European Journal of Personality}, \emph{34}(6), 1095-1108. 75 | } 76 | \author{ 77 | Hudson Golino and Alexander P. Christensen 78 | } 79 | -------------------------------------------------------------------------------- /man/dnn.weights.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dnn.weights.R 3 | \docType{data} 4 | \name{dnn.weights} 5 | \alias{dnn.weights} 6 | \title{Loadings Comparison Test Deep Learning Neural Network Weights} 7 | \format{ 8 | A list of with a length of 4 9 | } 10 | \usage{ 11 | data(dnn.weights) 12 | } 13 | \description{ 14 | A list of weights from four different neural network models: 15 | random vs. non-random model (\code{r_nr_weights}), 16 | low correlation factor vs. network model (\code{lf_n_weights}), 17 | high correlation with variables less than or equal to factors vs. network model (\code{hlf_n_weights}), and 18 | high correlation with variables greater than factors vs. network model (\code{hgf_n_weights}) 19 | } 20 | \examples{ 21 | data("dnn.weights") 22 | 23 | } 24 | \keyword{datasets} 25 | -------------------------------------------------------------------------------- /man/ega.wmt.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ega.wmt.R 3 | \docType{data} 4 | \name{ega.wmt} 5 | \alias{ega.wmt} 6 | \title{\code{\link[EGAnet]{EGA}} Network of \code{\link[EGAnet]{wmt2}}Data} 7 | \format{ 8 | A list with 8 objects (see \strong{Value} in \code{\link[EGAnet]{EGA}}) 9 | } 10 | \usage{ 11 | data(ega.wmt) 12 | } 13 | \description{ 14 | \code{\link[EGAnet]{EGA}} results from \code{ega.wmt <- EGA(wmt2[,7:24])} 15 | for the Wiener Matrizen-Test (WMT-2) 16 | } 17 | \examples{ 18 | data("ega.wmt") 19 | } 20 | \keyword{datasets} 21 | -------------------------------------------------------------------------------- /man/entropyFit.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/entropyFit.R 3 | \name{entropyFit} 4 | \alias{entropyFit} 5 | \title{Entropy Fit Index} 6 | \usage{ 7 | entropyFit(data, structure) 8 | } 9 | \arguments{ 10 | \item{data}{Matrix or data frame. 11 | Contains variables to be used in the analysis} 12 | 13 | \item{structure}{Numeric or character vector (length = \code{ncol(data)}). 14 | A vector representing the structure (numbers or labels for each item). 15 | Can be theoretical factors or the structure detected by \code{\link[EGAnet]{EGA}}} 16 | } 17 | \value{ 18 | Returns a list containing: 19 | 20 | \item{Total.Correlation}{The total correlation of the dataset} 21 | 22 | \item{Total.Correlation.MM}{Miller-Madow correction for the total correlation of the dataset} 23 | 24 | \item{Entropy.Fit}{The Entropy Fit Index} 25 | 26 | \item{Entropy.Fit.MM}{Miller-Madow correction for the Entropy Fit Index} 27 | 28 | \item{Average.Entropy}{The average entropy of the dataset} 29 | } 30 | \description{ 31 | Computes the fit of a dimensionality structure using empirical entropy. 32 | Lower values suggest better fit of a structure to the data. 33 | } 34 | \examples{ 35 | # Load data 36 | wmt <- wmt2[,7:24] 37 | 38 | \dontrun{ 39 | # Estimate EGA model 40 | ega.wmt <- EGA(data = wmt)} 41 | 42 | # Compute entropy indices 43 | entropyFit(data = wmt, structure = ega.wmt$wc) 44 | 45 | } 46 | \references{ 47 | \strong{Initial formalization and simulation} \cr 48 | 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). 49 | Entropy fit indices: New fit measures for assessing the structure and dimensionality of multiple latent variables. 50 | \emph{Multivariate Behavioral Research}. 51 | } 52 | \author{ 53 | Hudson F. Golino , Alexander P. Christensen and Robert Moulder 54 | } 55 | -------------------------------------------------------------------------------- /man/ergoInfo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ergoInfo.R 3 | \name{ergoInfo} 4 | \alias{ergoInfo} 5 | \title{Ergodicity Information Index} 6 | \usage{ 7 | ergoInfo( 8 | dynEGA.object, 9 | use = c("edge.list", "unweighted", "weighted"), 10 | shuffles = 5000 11 | ) 12 | } 13 | \arguments{ 14 | \item{dynEGA.object}{A \code{\link[EGAnet]{dynEGA.ind.pop}} object} 15 | 16 | \item{use}{Character (length = 1). 17 | A string indicating what network element will be used 18 | to compute the algorithm complexity, the list of edges or the weights of the network. 19 | Defaults to \code{use = "unweighted"}. 20 | Current options are: 21 | 22 | \itemize{ 23 | 24 | \item \code{"edge.list"} --- Calculates the algorithm complexity using the list of edges 25 | 26 | \item \code{"unweighted"} --- Calculates the algorithm complexity using the binary weights of the encoded prime 27 | transformed network. 0 = edge absent and 1 = edge present 28 | 29 | \item \code{"weighted"} --- Calculates the algorithm complexity using the weights of encoded prime-weight transformed network 30 | 31 | }} 32 | 33 | \item{shuffles}{Numeric. 34 | Number of shuffles used to compute the Kolmogorov complexity. 35 | Defaults to \code{5000}} 36 | } 37 | \value{ 38 | Returns a list containing: 39 | 40 | \item{PrimeWeight}{The prime-weight encoding of the individual networks} 41 | 42 | \item{PrimeWeight.pop}{The prime-weight encoding of the population network} 43 | 44 | \item{Kcomp}{The Kolmogorov complexity of the prime-weight encoded individual networks} 45 | 46 | \item{Kcomp.pop}{The Kolmogorov complexity of the prime-weight encoded population network} 47 | 48 | \item{complexity}{The complexity metric proposed by Santora and Nicosia (2020)} 49 | 50 | \item{EII}{The Ergodicity Information Index} 51 | } 52 | \description{ 53 | Computes the Ergodicity Information Index 54 | } 55 | \examples{ 56 | # Obtain data 57 | sim.dynEGA <- sim.dynEGA # bypasses CRAN checks 58 | 59 | \dontrun{ 60 | # Dynamic EGA individual and population structure 61 | dyn.ega1 <- dynEGA.ind.pop( 62 | data = sim.dynEGA[,-26], n.embed = 5, tau = 1, 63 | delta = 1, id = 25, use.derivatives = 1, 64 | ncores = 2, corr = "pearson" 65 | ) 66 | 67 | # Compute empirical ergodicity information index 68 | eii <- ergoInfo(dyn.ega1)} 69 | 70 | } 71 | \references{ 72 | \strong{Original Implementation} \cr 73 | Golino, H., Nesselroade, J. R., & Christensen, A. P. (2022). 74 | Toward a psychology of individuals: The ergodicity information index and a bottom-up approach for finding generalizations. 75 | \emph{PsyArXiv}. 76 | } 77 | \author{ 78 | Hudson Golino and Alexander Christensen 79 | } 80 | -------------------------------------------------------------------------------- /man/frobenius.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/frobenius.R 3 | \name{frobenius} 4 | \alias{frobenius} 5 | \title{Frobenius Norm (Similarity)} 6 | \usage{ 7 | frobenius(network1, network2) 8 | } 9 | \arguments{ 10 | \item{network1}{Matrix or data frame. 11 | Network to be compared} 12 | 13 | \item{network2}{Matrix or data frame. 14 | Second network to be compared} 15 | } 16 | \value{ 17 | Returns Frobenius Norm 18 | } 19 | \description{ 20 | Computes the Frobenius Norm (Ulitzsch et al., 2023) 21 | } 22 | \examples{ 23 | # Obtain wmt2 data 24 | wmt <- wmt2[,7:24] 25 | 26 | # Set seed (for reproducibility) 27 | set.seed(1234) 28 | 29 | # Split data 30 | split1 <- sample( 31 | 1:nrow(wmt), floor(nrow(wmt) / 2) 32 | ) 33 | split2 <- setdiff(1:nrow(wmt), split1) 34 | 35 | # Obtain split data 36 | data1 <- wmt[split1,] 37 | data2 <- wmt[split2,] 38 | 39 | # Perform EBICglasso 40 | glas1 <- EBICglasso.qgraph(data1) 41 | glas2 <- EBICglasso.qgraph(data2) 42 | 43 | # Frobenius norm 44 | frobenius(glas1, glas2) 45 | # 0.7070395 46 | 47 | } 48 | \references{ 49 | \strong{Simulation Study} \cr 50 | Ulitzsch, E., Khanna, S., Rhemtulla, M., & Domingue, B. W. (2023). 51 | A graph theory based similarity metric enables comparison of subpopulation psychometric networks 52 | \emph{Psychological Methods}. 53 | } 54 | \author{ 55 | Hudson Golino & Alexander P. Christensen 56 | } 57 | -------------------------------------------------------------------------------- /man/genTEFI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/genTEFI.R 3 | \name{genTEFI} 4 | \alias{genTEFI} 5 | \title{Generalized Total Entropy Fit Index using Von Neumman's entropy (Quantum Information Theory) for correlation matrices} 6 | \usage{ 7 | genTEFI(data, structure = NULL, verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{data}{Matrix, data frame, or \code{\link[EGAnet]{hierEGA}} object. 11 | Can be raw data or correlation matrix} 12 | 13 | \item{structure}{List (length = levels). 14 | A list containing the hierarchical structure. 15 | Each list element corresponds to increasing levels (1 = first level, 2 = second level, etc.). 16 | The length of the first element (first level) should be the same as the number of variables 17 | in \code{data}. Each level after should either be the number of variables (\code{ncol(data)}) or 18 | the maximum number of dimensions from the preceding level (\code{max(previous_dimensions)})} 19 | 20 | \item{verbose}{Boolean (length = 1). 21 | Whether messages and (insignificant) warnings should be output. 22 | Defaults to \code{TRUE} to see all messages and warnings for every 23 | function call. 24 | Set to \code{FALSE} to ignore messages and warnings} 25 | } 26 | \value{ 27 | Returns a \code{levels + 1} columns data frame of the Generalized Total Entropy 28 | Fit Index using Von Neumman's entropy (\code{VN.Entropy.Fit}) (first column) as well as 29 | each individual's levels entropy 30 | } 31 | \description{ 32 | Computes the fit (Generalized TEFI) of a hierarchical or correlated bifactor 33 | dimensionality structure (or \code{\link{hierEGA}} objects) using Von Neumman's entropy 34 | when the input is a correlation matrix. Lower values suggest better fit of a structure to the data 35 | } 36 | \examples{ 37 | # Example using network scores 38 | opt.hier <- hierEGA( 39 | data = optimism, scores = "network", 40 | plot.EGA = FALSE # No plot for CRAN checks 41 | ) 42 | 43 | # Compute the Generalized Total Entropy Fit Index 44 | genTEFI(opt.hier) 45 | 46 | } 47 | \author{ 48 | Hudson Golino and Alexander P. Christensen 49 | } 50 | -------------------------------------------------------------------------------- /man/glla.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/glla.R 3 | \name{glla} 4 | \alias{glla} 5 | \title{Generalized Local Linear Approximation} 6 | \usage{ 7 | glla(x, n.embed, tau, delta, order) 8 | } 9 | \arguments{ 10 | \item{x}{Numeric vector. 11 | An observed time series} 12 | 13 | \item{n.embed}{Numeric (length = 1). 14 | Number of embedded dimensions (the number of observations 15 | to be used in the \code{\link[EGAnet]{Embed}} function)} 16 | 17 | \item{tau}{Numeric (length = 1). 18 | Number of observations to offset successive embeddings in 19 | the \code{\link[EGAnet]{Embed}} function. A \code{tau} of one 20 | uses adjacent observations. 21 | Default is \code{1}} 22 | 23 | \item{delta}{Numeric (length = 1). 24 | The time between successive observations in the time series. 25 | Default is \code{1}} 26 | 27 | \item{order}{Numeric (length = 1). 28 | The maximum order of the derivative to be estimated. For example, 29 | \code{"order = 2"} will return a matrix with three columns with the estimates 30 | of the observed scores and the first and second derivative for each row of the embedded 31 | matrix (i.e. the reorganization of the time series implemented via 32 | the \code{\link[EGAnet]{Embed}} function)} 33 | } 34 | \value{ 35 | Returns a matrix containing \emph{n} columns in which \emph{n} 36 | is one plus the maximum order of the derivatives to be estimated via 37 | generalized local linear approximation 38 | } 39 | \description{ 40 | Estimates the derivatives of a time series using generalized 41 | local linear approximation (GLLA). GLLA is a filtering method for 42 | estimating derivatives from data that uses time delay embedding and a 43 | variant of Savitzky-Golay filtering to accomplish the task. 44 | } 45 | \examples{ 46 | # A time series with 8 time points 47 | tseries <- 49:56 48 | deriv.tseries <- glla(tseries, n.embed = 4, tau = 1, delta = 1, order = 2) 49 | 50 | } 51 | \references{ 52 | \strong{GLLA implementation} \cr 53 | Boker, S. M., Deboeck, P. R., Edler, C., & Keel, P. K. (2010) 54 | Generalized local linear approximation of derivatives from time series. In S.-M. Chow, E. Ferrer, & F. Hsieh (Eds.), 55 | \emph{The Notre Dame series on quantitative methodology. Statistical methods for modeling human dynamics: An interdisciplinary dialogue}, 56 | (p. 161-178). \emph{Routledge/Taylor & Francis Group}. 57 | 58 | Deboeck, P. R., Montpetit, M. A., Bergeman, C. S., & Boker, S. M. (2009) 59 | Using derivative estimates to describe intraindividual variability at multiple time scales. 60 | \emph{Psychological Methods}, \emph{14(4)}, 367-386. 61 | 62 | \strong{Filtering procedure} \cr 63 | Savitzky, A., & Golay, M. J. (1964). 64 | Smoothing and differentiation of data by simplified least squares procedures. 65 | \emph{Analytical Chemistry}, \emph{36(8)}, 1627-1639. 66 | } 67 | \author{ 68 | Hudson Golino 69 | } 70 | -------------------------------------------------------------------------------- /man/igraph2matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/igraph2matrix.R 3 | \name{igraph2matrix} 4 | \alias{igraph2matrix} 5 | \title{Convert \code{} network to matrix} 6 | \usage{ 7 | igraph2matrix(igraph_network, diagonal = 0) 8 | } 9 | \arguments{ 10 | \item{igraph_network}{\code{} network object} 11 | 12 | \item{diagonal}{Numeric (length = 1). 13 | Value to be placed on the diagonal of \code{network}. 14 | Defaults to \code{0}} 15 | } 16 | \value{ 17 | Returns a network in the \code{} format 18 | } 19 | \description{ 20 | Converts \code{} network to matrix 21 | } 22 | \examples{ 23 | # Convert network to {igraph} 24 | igraph_network <- convert2igraph(ega.wmt$network) 25 | 26 | # Convert network back to matrix 27 | igraph2matrix(igraph_network) 28 | 29 | } 30 | \author{ 31 | Hudson Golino & Alexander P. Christensen 32 | } 33 | -------------------------------------------------------------------------------- /man/infoCluster.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/infoCluster.R 3 | \name{infoCluster} 4 | \alias{infoCluster} 5 | \title{Information Theoretic Mixture Clustering for \code{\link[EGAnet]{dynEGA}}} 6 | \usage{ 7 | infoCluster(dynEGA.object, plot.cluster = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{dynEGA.object}{A \code{\link[EGAnet]{dynEGA}} or a 11 | \code{\link[EGAnet]{dynEGA.ind.pop}} object that is used to match 12 | the arguments of the EII object} 13 | 14 | \item{plot.cluster}{Boolean (length = 1). 15 | Should plot of optimal and hierarchical clusters be output? 16 | Defaults to \code{TRUE}. 17 | Set to \code{FALSE} to not plot} 18 | 19 | \item{...}{Additional arguments to be passed on to 20 | \code{\link[EGAnet]{jsd}}} 21 | } 22 | \value{ 23 | Returns a list containing: 24 | 25 | \item{clusters}{A vector corresponding to cluster each participant belongs to} 26 | 27 | \item{clusterTree}{The dendogram from \code{\link[stats]{hclust}} the hierarhical clustering} 28 | 29 | \item{clusterPlot}{Plot output from results} 30 | 31 | \item{JSD}{Jensen-Shannon Distance} 32 | } 33 | \description{ 34 | Performs hierarchical clustering using Jensen-Shannon distance 35 | followed by the Louvain algorithm with consensus clustering. The method 36 | iteratively identifies smaller and smaller clusters until there is no 37 | change in the clusters identified 38 | } 39 | \examples{ 40 | # Obtain data 41 | sim.dynEGA <- sim.dynEGA # bypasses CRAN checks 42 | 43 | \dontrun{ 44 | # Dynamic EGA individual and population structure 45 | dyn.ega1 <- dynEGA.ind.pop( 46 | data = sim.dynEGA, n.embed = 5, tau = 1, 47 | delta = 1, id = 25, use.derivatives = 1, 48 | ncores = 2, corr = "pearson" 49 | ) 50 | 51 | # Perform information-theoretic clustering 52 | clust1 <- infoCluster(dynEGA.object = dyn.ega1)} 53 | 54 | } 55 | \seealso{ 56 | \code{\link[EGAnet]{plot.EGAnet}} for plot usage in \code{\link{EGAnet}} 57 | } 58 | \author{ 59 | Hudson Golino & Alexander P. Christensen 60 | } 61 | -------------------------------------------------------------------------------- /man/intelligenceBattery.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/intelligenceBattery.R 3 | \docType{data} 4 | \name{intelligenceBattery} 5 | \alias{intelligenceBattery} 6 | \title{Intelligence Data} 7 | \format{ 8 | A 1185x125 response matrix 9 | } 10 | \usage{ 11 | data(intelligenceBattery) 12 | } 13 | \description{ 14 | A response matrix (n = 1152) of the International Cognitive Ability Resource (ICAR) 15 | intelligence battery developed by Condon and Revelle (2016). 16 | } 17 | \examples{ 18 | data("intelligenceBattery") 19 | 20 | } 21 | \keyword{datasets} 22 | -------------------------------------------------------------------------------- /man/itemDiagnostics.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/itemDiagnostics.R 3 | \name{itemDiagnostics} 4 | \alias{itemDiagnostics} 5 | \title{Diagnostics Analysis for Low Stability Items} 6 | \usage{ 7 | itemDiagnostics(data, ...) 8 | } 9 | \arguments{ 10 | \item{data}{Matrix or data frame. 11 | Should consist only of variables to be used in the analysis} 12 | 13 | \item{...}{Additional arguments to pass on to 14 | \code{\link[EGAnet]{bootEGA}}, 15 | \code{\link[EGAnet]{net.loads}}, and 16 | \code{\link[EGAnet]{UVA}}} 17 | } 18 | \value{ 19 | Returns a list containing: 20 | 21 | \item{diagnostics}{A data frame containing the diagnostics of low item stabilities 22 | (see \code{\link[EGAnet]{itemStability}})} 23 | 24 | \item{boot}{Output from \code{\link[EGAnet]{bootEGA}}} 25 | 26 | \item{uva}{Output from \code{\link[EGAnet]{UVA}}} 27 | 28 | \item{minor}{A list containing suggested items to \code{keep}, \code{remove}, and 29 | a matrix for probable minor dimensions (\code{minor.matrix})} 30 | 31 | \item{loadings}{Output from \code{\link[EGAnet]{net.loads}}} 32 | 33 | \item{suggested}{Variables that are suggested to be retained to increase item stability} 34 | } 35 | \description{ 36 | Computes item diagnostics to determine whether there exist several 37 | potential psychometric issues that affect \code{\link[EGAnet]{itemStability}}. 38 | These issues include local dependence (using \code{\link[EGAnet]{UVA}}), 39 | minor dimensions (using \code{\link[EGAnet]{cosine}} on the stability patterns), 40 | multidimensional items (using \code{\link[EGAnet]{net.loads}}), and 41 | items with low loadings (using \code{\link[EGAnet]{net.loads}}) 42 | } 43 | \examples{ 44 | # Load data 45 | wmt <- wmt2[,7:24] 46 | 47 | \dontrun{ 48 | # Obtain diagnostics 49 | diagnostics <- itemDiagnostics(wmt, ncores = 2)} 50 | 51 | } 52 | \author{ 53 | Alexander P. Christensen , Hudson Golino , and Luis Eduardo Garrido 54 | } 55 | -------------------------------------------------------------------------------- /man/itemStability.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/itemStability.R 3 | \name{itemStability} 4 | \alias{itemStability} 5 | \title{Item Stability Statistics from \code{\link[EGAnet]{bootEGA}}} 6 | \usage{ 7 | itemStability(bootega.obj, IS.plot = TRUE, structure = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{bootega.obj}{A \code{\link[EGAnet]{bootEGA}} object} 11 | 12 | \item{IS.plot}{Boolean (length = 1). 13 | Should the plot be produced for \code{item.replication}? 14 | Defaults to \code{TRUE}} 15 | 16 | \item{structure}{Numeric (length = number of variables). 17 | A theoretical or pre-defined structure. 18 | Defaults to \code{NULL} or the empirical \code{\link[EGAnet]{EGA}} 19 | result in the \code{bootega.obj}} 20 | 21 | \item{...}{Deprecated arguments from previous versions of \code{\link[EGAnet]{itemStability}}} 22 | } 23 | \value{ 24 | Returns a list containing: 25 | 26 | \item{membership}{A list containing: 27 | 28 | \itemize{ 29 | 30 | \item \code{empirical} --- A vector of the empirical memberships from the 31 | empirical \code{\link[EGAnet]{EGA}} result 32 | 33 | \item \code{bootstrap} --- A matrix of the homogenized memberships from the replicate samples in 34 | the \code{\link[EGAnet]{bootEGA}} results 35 | 36 | \item \code{structure} --- A vector of the structure used in the analysis. If \code{structure = NULL}, then this output 37 | will be the same as \code{empirical} 38 | 39 | } 40 | 41 | } 42 | 43 | \item{item.stability}{A list containing: 44 | 45 | \itemize{ 46 | 47 | \item \code{empirical.dimensions} --- A vector of the proportion of times each item replicated 48 | within the structure defined by \code{structure} 49 | 50 | \item \code{all.dimensions} --- A matrix of the proportion of times each item replicated 51 | in each of the \code{structure} defined dimensions 52 | 53 | } 54 | 55 | } 56 | 57 | \item{plot}{Plot output if \code{IS.plot = TRUE}} 58 | } 59 | \description{ 60 | Based on the \code{\link[EGAnet]{bootEGA}} results, this function 61 | computes and plots the number of times an variable is estimated 62 | in the same dimension as originally estimated by an empirical 63 | \code{\link[EGAnet]{EGA}} structure or a theoretical/input structure. 64 | The output also contains each variable's replication frequency (i.e., proportion of 65 | bootstraps that a variable appeared in each dimension 66 | } 67 | \examples{ 68 | # Load data 69 | wmt <- wmt2[,7:24] 70 | 71 | \dontrun{ 72 | # Standard EGA example 73 | boot.wmt <- bootEGA( 74 | data = wmt, iter = 500, 75 | type = "parametric", ncores = 2 76 | )} 77 | 78 | # Standard item stability 79 | wmt.is <- itemStability(boot.wmt) 80 | 81 | \dontrun{ 82 | # EGA fit example 83 | boot.wmt.fit <- bootEGA( 84 | data = wmt, iter = 500, 85 | EGA.type = "EGA.fit", 86 | type = "parametric", ncores = 2 87 | ) 88 | 89 | # EGA fit item stability 90 | wmt.is.fit <- itemStability(boot.wmt.fit) 91 | 92 | # Hierarchical EGA example 93 | boot.wmt.hier <- bootEGA( 94 | data = wmt, iter = 500, 95 | EGA.type = "hierEGA", 96 | type = "parametric", ncores = 2 97 | ) 98 | 99 | # Hierarchical EGA item stability 100 | wmt.is.hier <- itemStability(boot.wmt.hier) 101 | 102 | # Random-intercept EGA example 103 | boot.wmt.ri <- bootEGA( 104 | data = wmt, iter = 500, 105 | EGA.type = "riEGA", 106 | type = "parametric", ncores = 2 107 | ) 108 | 109 | # Random-intercept EGA item stability 110 | wmt.is.ri <- itemStability(boot.wmt.ri)} 111 | 112 | } 113 | \references{ 114 | \strong{Original implementation of bootEGA} \cr 115 | Christensen, A. P., & Golino, H. (2021). 116 | Estimating the stability of the number of factors via Bootstrap Exploratory Graph Analysis: A tutorial. 117 | \emph{Psych}, \emph{3}(3), 479-500. 118 | 119 | \strong{Conceptual introduction} \cr 120 | Christensen, A. P., Golino, H., & Silvia, P. J. (2020). 121 | A psychometric network perspective on the validity and validation of personality trait questionnaires. 122 | \emph{European Journal of Personality}, \emph{34}(6), 1095-1108. 123 | } 124 | \seealso{ 125 | \code{\link[EGAnet]{plot.EGAnet}} for plot usage in \code{\link{EGAnet}} 126 | } 127 | \author{ 128 | Hudson Golino and Alexander P. Christensen 129 | } 130 | -------------------------------------------------------------------------------- /man/jsd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/jsd.R 3 | \name{jsd} 4 | \alias{jsd} 5 | \title{Jensen-Shannon Distance} 6 | \usage{ 7 | jsd(network1, network2, method = c("kld", "spectral"), signed = TRUE) 8 | } 9 | \arguments{ 10 | \item{network1}{Matrix or data frame. 11 | Network to be compared} 12 | 13 | \item{network2}{Matrix or data frame. 14 | Second network to be compared} 15 | 16 | \item{method}{Character (length = 1). 17 | Method to compute Jensen-Shannon Distance. 18 | Defaults to \code{"spectral"}. 19 | Available options: 20 | 21 | \itemize{ 22 | 23 | \item \code{"kld"} --- Uses Kullback-Leibler Divergence 24 | 25 | \item \code{"spectral"} --- Uses eigenvalues of combinatorial Laplacian matrix to compute 26 | Von Neumann entropy 27 | 28 | }} 29 | 30 | \item{signed}{Boolean. (length = 1). 31 | Should networks be remain signed? 32 | Defaults to \code{TRUE}} 33 | } 34 | \value{ 35 | Returns Jensen-Shannon Distance 36 | } 37 | \description{ 38 | Computes the Jensen-Shannon Distance between two networks 39 | } 40 | \examples{ 41 | # Obtain wmt2 data 42 | wmt <- wmt2[,7:24] 43 | 44 | # Set seed (for reproducibility) 45 | set.seed(1234) 46 | 47 | # Split data 48 | split1 <- sample( 49 | 1:nrow(wmt), floor(nrow(wmt) / 2) 50 | ) 51 | split2 <- setdiff(1:nrow(wmt), split1) 52 | 53 | # Obtain split data 54 | data1 <- wmt[split1,] 55 | data2 <- wmt[split2,] 56 | 57 | # Perform EBICglasso 58 | glas1 <- EBICglasso.qgraph(data1) 59 | glas2 <- EBICglasso.qgraph(data2) 60 | 61 | # Spectral JSD 62 | jsd(glas1, glas2) 63 | # 0.1595893 64 | 65 | # Spectral JSS (similarity) 66 | 1 - jsd(glas1, glas2) 67 | # 0.8404107 68 | 69 | # Jensen-Shannon Divergence 70 | jsd(glas1, glas2, method = "kld") 71 | # 0.1393621 72 | 73 | } 74 | \author{ 75 | Hudson Golino & Alexander P. Christensen 76 | } 77 | -------------------------------------------------------------------------------- /man/modularity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modularity.R 3 | \name{modularity} 4 | \alias{modularity} 5 | \title{Computes the (Signed) Modularity Statistic} 6 | \usage{ 7 | modularity(network, memberships, resolution = 1, signed = FALSE) 8 | } 9 | \arguments{ 10 | \item{network}{Matrix or data frame. 11 | A symmetric matrix representing a network} 12 | 13 | \item{memberships}{Numeric (length = \code{ncol(network)}). 14 | A numeric vector of integer values corresponding to 15 | each node's community membership} 16 | 17 | \item{resolution}{Numeric (length = 1). 18 | A parameter that adjusts modularity to 19 | prefer smaller (\code{resolution} > 1) or larger 20 | (0 < \code{resolution} < 1) communities. 21 | Defaults to \code{1} (standard modularity computation)} 22 | 23 | \item{signed}{Boolean (length = 1). 24 | Whether signed or absolute modularity should be computed. 25 | The most common modularity metric is defined by positive values only. 26 | Gomez et al. (2009) introduced a signed version of modularity that 27 | will discount modularity for edges with negative values. This property 28 | isn't always desired for psychometric networks. If \code{TRUE}, then 29 | this signed modularity metric will be computed. If \code{FALSE}, then 30 | the absolute value of the edges in the network (using \code{abs}) will 31 | be used to compute modularity. 32 | Defaults to \code{FALSE}} 33 | } 34 | \value{ 35 | Returns the modularity statistic 36 | } 37 | \description{ 38 | Computes (signed) modularity statistic 39 | given a network and community structure. Allows the 40 | resolution parameter to be set 41 | } 42 | \examples{ 43 | # Load data 44 | wmt <- wmt2[,7:24] 45 | 46 | # Estimate EGA 47 | ega.wmt <- EGA(wmt, model = "glasso") 48 | 49 | # Compute standard (absolute values) modularity 50 | modularity( 51 | network = ega.wmt$network, 52 | memberships = ega.wmt$wc, 53 | signed = FALSE 54 | ) 55 | # 0.1697952 56 | 57 | # Compute signed modularity 58 | modularity( 59 | network = ega.wmt$network, 60 | memberships = ega.wmt$wc, 61 | signed = TRUE 62 | ) 63 | # 0.1701946 64 | 65 | } 66 | \references{ 67 | Gomez, S., Jensen, P., & Arenas, A. (2009). 68 | Analysis of community structure in networks of correlated data. 69 | \emph{Physical Review E}, \emph{80}(1), 016114. 70 | } 71 | \author{ 72 | Alexander P. Christensen with assistance from GPT-4 73 | } 74 | -------------------------------------------------------------------------------- /man/optimism.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/optimism.R 3 | \docType{data} 4 | \name{optimism} 5 | \alias{optimism} 6 | \title{Optimism Data} 7 | \format{ 8 | A 282x10 response matrix 9 | } 10 | \usage{ 11 | data(optimism) 12 | } 13 | \description{ 14 | A response matrix (n = 282) containing responses to 10 items of the Revised Life 15 | Orientation Test (LOT-R), developed by Scheier, Carver, & Bridges (1994). 16 | } 17 | \examples{ 18 | data("optimism") 19 | 20 | } 21 | \references{ 22 | Scheier, M. F., Carver, C. S., & Bridges, M. W. (1994). 23 | Distinguishing optimism from neuroticism (and trait anxiety, self-mastery, and self-esteem): a reevaluation of the Life Orientation Test. 24 | \emph{Journal of Personality and Social Psychology}, \emph{67}, 1063-1078. 25 | } 26 | \keyword{datasets} 27 | -------------------------------------------------------------------------------- /man/prime.num.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prime.num.R 3 | \docType{data} 4 | \name{prime.num} 5 | \alias{prime.num} 6 | \title{Prime Numbers through 100,000} 7 | \format{ 8 | A 1185x24 response matrix 9 | } 10 | \usage{ 11 | data(prime.num) 12 | } 13 | \description{ 14 | Numeric vector of primes generated from the primes package. Used in 15 | the function \code{[EGAnet]{ergoInfo}}. Not for general use 16 | } 17 | \examples{ 18 | data("prime.num") 19 | 20 | } 21 | \keyword{datasets} 22 | -------------------------------------------------------------------------------- /man/sim.dynEGA.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sim.dynEGA.R 3 | \docType{data} 4 | \name{sim.dynEGA} 5 | \alias{sim.dynEGA} 6 | \title{sim.dynEGA Data} 7 | \format{ 8 | A 5000 x 26 multivariate time series 9 | } 10 | \usage{ 11 | data(sim.dynEGA) 12 | } 13 | \description{ 14 | A simulated (multivariate time series) data with 24 variables, 15 | 100 individual observations, 50 time points per individual and 16 | 2 groups of individuals 17 | } 18 | \details{ 19 | Data were generated using the \code{\link[EGAnet]{simDFM}} function 20 | with the following arguments: 21 | 22 | \strong{Group 1} 23 | 24 | \code{simDFM( 25 | variab = 12, timep = 50, 26 | nfact = 2, error = 0.125, 27 | dfm = "DAFS", 28 | loadings = EGAnet:::runif_xoshiro( 29 | 1, min = 0.50, max = 0.70 30 | ), autoreg = 0.80, crossreg = 0.00, 31 | var.shock = 0.36, cov.shock = 0.18 32 | )} 33 | 34 | \strong{Group 2} 35 | 36 | \code{simDFM( 37 | variab = 8, timep = 50, 38 | nfact = 3, error = 0.125, 39 | dfm = "DAFS", 40 | loadings = EGAnet:::runif_xoshiro( 41 | 1, min = 0.50, max = 0.70 42 | ), autoreg = 0.80, crossreg = 0.00, 43 | var.shock = 0.36, cov.shock = 0.18 44 | )} 45 | } 46 | \examples{ 47 | data("sim.dynEGA") 48 | 49 | } 50 | \keyword{datasets} 51 | -------------------------------------------------------------------------------- /man/simDFM.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simDFM.R 3 | \name{simDFM} 4 | \alias{simDFM} 5 | \title{Simulate data following a Dynamic Factor Model} 6 | \usage{ 7 | simDFM( 8 | variab, 9 | timep, 10 | nfact, 11 | error, 12 | dfm = c("DAFS", "RandomWalk"), 13 | loadings, 14 | autoreg, 15 | crossreg, 16 | var.shock, 17 | cov.shock, 18 | burnin = 1000 19 | ) 20 | } 21 | \arguments{ 22 | \item{variab}{Number of variables per factor.} 23 | 24 | \item{timep}{Number of time points.} 25 | 26 | \item{nfact}{Number of factors.} 27 | 28 | \item{error}{Value to be used to construct a diagonal matrix Q. This matrix is p x p covariance matrix Q that will 29 | generate random errors following a multivariate normal distribution with mean zeros. 30 | The value provided is squared before constructing Q.} 31 | 32 | \item{dfm}{A string indicating the dynamical factor model to use. 33 | Current options are: 34 | 35 | \itemize{ 36 | 37 | \item \strong{\code{DAFS}} --- Simulates data using the direct autoregressive factor score model. 38 | This is the default method 39 | 40 | \item \strong{\code{RandomWalk}} --- Simulates data using a dynamic factor model with random walk factor scores 41 | 42 | }} 43 | 44 | \item{loadings}{Magnitude of the loadings.} 45 | 46 | \item{autoreg}{Magnitude of the autoregression coefficients.} 47 | 48 | \item{crossreg}{Magnitude of the cross-regression coefficients.} 49 | 50 | \item{var.shock}{Magnitude of the random shock variance.} 51 | 52 | \item{cov.shock}{Magnitude of the random shock covariance} 53 | 54 | \item{burnin}{Number of n first samples to discard when computing the factor scores. Defaults to 1000.} 55 | } 56 | \description{ 57 | Function to simulate data following a dynamic factor model (DFM). Two DFMs are currently available: 58 | the direct autoregressive factor score model (Engle & Watson, 1981; Nesselroade, McArdle, Aggen, and Meyers, 2002) and the 59 | dynamic factor model with random walk factor scores. 60 | } 61 | \examples{ 62 | \dontrun{ 63 | # Estimate EGA network 64 | data1 <- simDFM(variab = 5, timep = 50, nfact = 3, error = 0.05, 65 | dfm = "DAFS", loadings = 0.7, autoreg = 0.8, 66 | crossreg = 0.1, var.shock = 0.36, 67 | cov.shock = 0.18, burnin = 1000)} 68 | 69 | } 70 | \references{ 71 | Engle, R., & Watson, M. (1981). 72 | A one-factor multivariate time series model of metropolitan wage rates. 73 | \emph{Journal of the American Statistical Association}, \emph{76}(376), 774-781. 74 | 75 | Nesselroade, J. R., McArdle, J. J., Aggen, S. H., & Meyers, J. M. (2002). 76 | Dynamic factor analysis models for representing process in multivariate time-series. In D. S. Moskowitz & S. L. Hershberger (Eds.), 77 | \emph{Multivariate applications book series. Modeling intraindividual variability with repeated measures data: Methods and applications}, 235-265. 78 | } 79 | \author{ 80 | Hudson F. Golino 81 | } 82 | -------------------------------------------------------------------------------- /man/simEGM.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/simEGM.R 3 | \name{simEGM} 4 | \alias{simEGM} 5 | \title{Simulate data following a Exploratory Graph Model (\code{\link[EGAnet]{EGM}})} 6 | \usage{ 7 | simEGM( 8 | communities, 9 | variables, 10 | loadings, 11 | cross.loadings = 0.01, 12 | correlations, 13 | sample.size, 14 | max.iterations = 1000 15 | ) 16 | } 17 | \arguments{ 18 | \item{communities}{Numeric (length = 1). 19 | Number of communities to generate} 20 | 21 | \item{variables}{Numeric vector (length = 1 or \code{communities}). 22 | Number of variables per community} 23 | 24 | \item{loadings}{Numeric (length = 1, \code{communities}, or 25 | total variables \eqn{\times} \code{communities}). 26 | Magnitude of the assigned network loadings. 27 | For reference, small (0.20), moderate (0.35), and large (0.50). 28 | Input can be a loading matrix but must have the dimensions: 29 | total variables \eqn{\times} \code{communities} 30 | 31 | Uses \code{runif(n, min = value - 0.075, max = value + 0.075)} for some jitter in the loadings} 32 | 33 | \item{cross.loadings}{Numeric (length = 1). 34 | Standard deviation of a normal distribution with a mean of zero (\code{n, mean = 0, sd = value}). 35 | Defaults to \code{0.01}. 36 | Not recommended to change too drastically (small increments such as \code{0.01} work best)} 37 | 38 | \item{correlations}{Numeric (length = 1 or 39 | \code{communities} \eqn{\times} \code{communities} matrix). 40 | Magnitude of the community correlations. 41 | Input can be a correlations matrix but must have the dimensions: 42 | \code{communities} \eqn{\times} \code{communities}} 43 | 44 | \item{sample.size}{Numeric (length = 1). 45 | Number of observations to generate} 46 | 47 | \item{max.iterations}{Numeric (length = 1). 48 | Number of iterations to attempt to get convergence before erroring out. 49 | Defaults to \code{1000}} 50 | } 51 | \description{ 52 | Function to simulate data based on \code{\link[EGAnet]{EGM}} 53 | } 54 | \examples{ 55 | simulated <- simEGM( 56 | communities = 2, variables = 6, 57 | loadings = 0.55, # use standard factor loading sizes 58 | correlations = 0.30, 59 | sample.size = 1000 60 | ) 61 | 62 | } 63 | \author{ 64 | Hudson F. Golino and Alexander P. Christensen 65 | } 66 | -------------------------------------------------------------------------------- /man/tefi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tefi.R 3 | \name{tefi} 4 | \alias{tefi} 5 | \title{Total Entropy Fit Index using Von Neumman's entropy (Quantum Information Theory) for correlation matrices} 6 | \usage{ 7 | tefi(data, structure = NULL, verbose = TRUE) 8 | } 9 | \arguments{ 10 | \item{data}{Matrix, data frame, or \code{*EGA} class object. 11 | Matrix or data frame can be raw data or a correlation matrix. 12 | All \code{*EGA} objects are accepted. \code{\link[EGAnet]{hierEGA}} 13 | input will produced the Generalized TEFI (see \code{\link[EGAnet]{genTEFI}})} 14 | 15 | \item{structure}{Numeric or character vector (length = \code{ncol(data)}). 16 | Can be theoretical factors or the structure detected by \code{\link{EGA}}} 17 | 18 | \item{verbose}{Boolean (length = 1). 19 | Whether messages and (insignificant) warnings should be output. 20 | Defaults to \code{TRUE} to see all messages and warnings for every 21 | function call. 22 | Set to \code{FALSE} to ignore messages and warnings} 23 | } 24 | \value{ 25 | Returns a data frame with columns: 26 | 27 | \strong{Non-hierarchical Structure} 28 | 29 | \item{VN.Entropy.Fit}{The Total Entropy Fit Index using Von Neumman's entropy} 30 | 31 | \item{Total.Correlation}{The total correlation of the dataset} 32 | 33 | \item{Average.Entropy}{The average entropy of the dataset} 34 | 35 | \strong{Hierarchical Structure} 36 | 37 | \item{VN.Entropy.Fit}{The Generalized Total Entropy Fit Index using Von Neumman's entropy} 38 | 39 | \item{Level_#_VN}{An individual level's Von Neumann's entropy} 40 | } 41 | \description{ 42 | Computes the fit (TEFI) of a dimensionality structure using Von Neumman's entropy 43 | when the input is a correlation matrix. Lower values suggest better fit of a structure to the data. 44 | } 45 | \examples{ 46 | # Load data 47 | wmt <- wmt2[,7:24] 48 | 49 | # Estimate EGA model 50 | ega.wmt <- EGA( 51 | data = wmt, model = "glasso", 52 | plot.EGA = FALSE # no plot for CRAN checks 53 | ) 54 | 55 | # Compute entropy indices for empirical EGA 56 | tefi(ega.wmt) 57 | 58 | # User-defined structure (with `EGA` object) 59 | tefi(ega.wmt, structure = c(rep(1, 5), rep(2, 5), rep(3, 8))) 60 | 61 | } 62 | \references{ 63 | \strong{Initial formalization and simulation} \cr 64 | 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). 65 | Entropy fit indices: New fit measures for assessing the structure and dimensionality of multiple latent variables. 66 | \emph{Multivariate Behavioral Research}. 67 | } 68 | \author{ 69 | Hudson Golino , Alexander P. Christensen , and Robert Moulder 70 | } 71 | -------------------------------------------------------------------------------- /man/tefi.compare.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tefi.compare.R 3 | \name{tefi.compare} 4 | \alias{tefi.compare} 5 | \title{Compare Total Entropy Fit Index (\code{\link[EGAnet]{tefi}}) Between Two Structures} 6 | \usage{ 7 | tefi.compare(bootega.obj, base, comparison, plot.TEFI = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{bootega.obj}{A \code{\link[EGAnet]{bootEGA}} object} 11 | 12 | \item{base}{Numeric (length = columns in original dataset). 13 | A vector representing the base structure to be tested} 14 | 15 | \item{comparison}{Numeric (length = columns in original dataset). 16 | A vector representing the structure to be compared against the \code{base} structure} 17 | 18 | \item{plot.TEFI}{Boolean (length = 1). 19 | Whether the TEFI comparison and the p-value should be plotted. 20 | Defaults to \code{TRUE}} 21 | 22 | \item{...}{Additional arguments that can be passed on to \code{\link[EGAnet]{plot.EGAnet}}. 23 | See \code{Examples} for plotting arguments} 24 | } 25 | \value{ 26 | A list containing: 27 | 28 | \item{\code{TEFI.df}}{A data frame containing the TEFI values for both structures} 29 | 30 | \item{\code{p.value}}{The \emph{p}-value from the non-parametric bootstrap hypothesis test} 31 | } 32 | \description{ 33 | This function computes the \code{\link[EGAnet]{tefi}} values for two different structures using 34 | bootstrapped correlation matrices from \code{\link[EGAnet]{bootEGA}} and compares them using a 35 | non-parametric bootstrap test. It also visualizes the distributions of \code{\link[EGAnet]{tefi}} values 36 | for both structures. 37 | } 38 | \details{ 39 | The null hypothesis is that the TEFI values obtained in the bootstrapped correlation matrices for the \code{base} 40 | structure are than the TEFI values obtained in the bootstrapped correlation matrices for the \code{comparison} structure. 41 | Therefore, the \emph{p}-value in this bootstrap test can be interpreted as follows: 42 | 43 | \itemize{ 44 | 45 | \item{If the \emph{p}-value less than 0.05: TEFI values for the \code{base} structure tend to be lower 46 | than the \code{comparison} structure, indicating that the former provides a better fit (lower entropy) than the latter} 47 | 48 | \item{If the \emph{p}-value is greater than 0.05: TEFI values for the \code{base} structure are not significantly lower than 49 | the \code{comparison} structure, suggesting that both structures may provide similar fits or that \code{comparison} might fit better} 50 | 51 | } 52 | } 53 | \examples{ 54 | # Obtain data 55 | wmt <- wmt2[,7:24] 56 | 57 | \dontrun{ 58 | # Perform bootstrap EGA 59 | boot.wmt <- bootEGA( 60 | data = wmt, iter = 500, 61 | type = "parametric", ncores = 2 62 | )} 63 | 64 | # Perform comparison 65 | comparing_tefi <- tefi.compare( 66 | boot.wmt, 67 | base = boot.wmt$EGA$wc, # Compare Walktrap 68 | comparison = community.detection( 69 | boot.wmt$EGA$network, algorithm = "louvain" 70 | ) # With Louvain 71 | ) 72 | 73 | # Plot options (UVa colors) 74 | plot( 75 | comparing_tefi, 76 | base.name = "Walktrap", base.color = "#232D4B", 77 | comparison.name = "Louvain", comparison.color = "#E57200" 78 | ) 79 | 80 | } 81 | \author{ 82 | Hudson Golino and Alexander P. Christensen 83 | } 84 | -------------------------------------------------------------------------------- /man/totalCor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/totalCor.R 3 | \name{totalCor} 4 | \alias{totalCor} 5 | \title{Total Correlation} 6 | \usage{ 7 | totalCor(data, base = 2.718282) 8 | } 9 | \arguments{ 10 | \item{data}{Matrix or data frame. 11 | Should consist only of variables to be used in the analysis} 12 | 13 | \item{base}{Numeric (length = 1). 14 | Base to use for entropy. 15 | Defaults to \code{exp(1)} or \code{2.718282}} 16 | } 17 | \value{ 18 | Returns a list containing: 19 | 20 | \item{Ind.Entropies}{Individual entropies for each variable} 21 | 22 | \item{Joint.Entropy}{The joint entropy of the dataset} 23 | 24 | \item{Total.Cor}{The total correlation of the dataset} 25 | 26 | \item{Normalized}{Total correlation divided by the sum of the individual entropies minus the maximum of the individual entropies} 27 | } 28 | \description{ 29 | Computes the total correlation of a dataset 30 | } 31 | \examples{ 32 | # Compute total correlation 33 | totalCor(wmt2[,7:24]) 34 | 35 | } 36 | \references{ 37 | \strong{Formalization of total correlation} \cr 38 | Watanabe, S. (1960). 39 | Information theoretical analysis of multivariate correlation. 40 | \emph{IBM Journal of Research and Development} \emph{4}, 66-82. 41 | 42 | \strong{Applied implementation} \cr 43 | Felix, L. M., Mansur-Alves, M., Teles, M., Jamison, L., & Golino, H. (2021). 44 | Longitudinal impact and effects of booster sessions in a cognitive training program for healthy older adults. 45 | \emph{Archives of Gerontology and Geriatrics}, \emph{94}, 104337. 46 | } 47 | \author{ 48 | Hudson F. Golino 49 | } 50 | -------------------------------------------------------------------------------- /man/totalCorMat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/totalCorMat.R 3 | \name{totalCorMat} 4 | \alias{totalCorMat} 5 | \title{Total Correlation Matrix} 6 | \usage{ 7 | totalCorMat(data, base = 2.718282, normalized = FALSE) 8 | } 9 | \arguments{ 10 | \item{data}{Matrix or data frame. 11 | Should consist only of variables to be used in the analysis} 12 | 13 | \item{base}{Numeric (length = 1). 14 | Base to use for entropy. 15 | Defaults to \code{exp(1)} or \code{2.718282}} 16 | 17 | \item{normalized}{Boolean (length = 1). 18 | Should the normalized total correlation be computed? 19 | Defaults to \code{FALSE}} 20 | } 21 | \value{ 22 | Returns a symmetric matrix with pairwise total correlations 23 | } 24 | \description{ 25 | Computes the pairwise total correlation 26 | (\code{\link[EGAnet]{totalCor}}) for a dataset 27 | } 28 | \examples{ 29 | # Compute total correlation matrix 30 | totalCorMat(wmt2[,7:24]) 31 | 32 | } 33 | \references{ 34 | \strong{Formalization of total correlation} \cr 35 | Watanabe, S. (1960). 36 | Information theoretical analysis of multivariate correlation. 37 | \emph{IBM Journal of Research and Development} \emph{4}, 66-82. 38 | 39 | \strong{Applied implementation} \cr 40 | Felix, L. M., Mansur-Alves, M., Teles, M., Jamison, L., & Golino, H. (2021). 41 | Longitudinal impact and effects of booster sessions in a cognitive training program for healthy older adults. 42 | \emph{Archives of Gerontology and Geriatrics}, \emph{94}, 104337. 43 | } 44 | \author{ 45 | Hudson F. Golino 46 | } 47 | -------------------------------------------------------------------------------- /man/vn.entropy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/vn.entropy.R 3 | \name{vn.entropy} 4 | \alias{vn.entropy} 5 | \title{Entropy Fit Index using Von Neumman's entropy (Quantum Information Theory) for correlation matrices} 6 | \usage{ 7 | vn.entropy(data, structure) 8 | } 9 | \arguments{ 10 | \item{data}{Matrix or data frame. 11 | Contains variables to be used in the analysis} 12 | 13 | \item{structure}{Numeric or character vector (length = \code{ncol(data)}). 14 | A vector representing the structure (numbers or labels for each item). 15 | Can be theoretical factors or the structure detected by \code{\link[EGAnet]{EGA}}} 16 | } 17 | \value{ 18 | Returns a list containing: 19 | 20 | \item{VN.Entropy.Fit}{The Entropy Fit Index using Von Neumman's entropy} 21 | 22 | \item{Total.Correlation}{The total correlation of the dataset} 23 | 24 | \item{Average.Entropy}{The average entropy of the dataset} 25 | } 26 | \description{ 27 | Computes the fit of a dimensionality structure using Von Neumman's 28 | entropy when the input is a correlation matrix. Lower values suggest better 29 | fit of a structure to the data 30 | } 31 | \examples{ 32 | # Get EGA result 33 | ega.wmt <- EGA( 34 | data = wmt2[,7:24], model = "glasso", 35 | plot.EGA = FALSE # no plot for CRAN checks 36 | ) 37 | 38 | # Compute Von Neumman entropy 39 | vn.entropy(ega.wmt$correlation, ega.wmt$wc) 40 | 41 | } 42 | \references{ 43 | \strong{Initial formalization and simulation} \cr 44 | 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). 45 | Entropy fit indices: New fit measures for assessing the structure and dimensionality of multiple latent variables. 46 | \emph{Multivariate Behavioral Research}. 47 | } 48 | \author{ 49 | Hudson Golino , Alexander P. Christensen , and Robert Moulder 50 | } 51 | -------------------------------------------------------------------------------- /man/wmt2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/wmt2.R 3 | \docType{data} 4 | \name{wmt2} 5 | \alias{wmt2} 6 | \title{WMT-2 Data} 7 | \format{ 8 | A 1185x24 response matrix 9 | } 10 | \usage{ 11 | data(wmt2) 12 | } 13 | \description{ 14 | A response matrix (n = 1185) of the Wiener Matrizen-Test 2 (WMT-2). 15 | } 16 | \examples{ 17 | data("wmt2") 18 | 19 | } 20 | \keyword{datasets} 21 | -------------------------------------------------------------------------------- /man/wto.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/wto.R 3 | \name{wto} 4 | \alias{wto} 5 | \title{Weighted Topological Overlap} 6 | \usage{ 7 | wto(network, signed = TRUE, diagonal.zero = TRUE) 8 | } 9 | \arguments{ 10 | \item{network}{Symmetric matrix or data frame. 11 | A symmetric network} 12 | 13 | \item{signed}{Boolean (length = 1). 14 | Whether the signed version should be used. 15 | Defaults to \code{TRUE}. 16 | Use \code{FALSE} for absolute values} 17 | 18 | \item{diagonal.zero}{Boolean (length = 1). 19 | Whether diagonal of overlap matrix should be set to zero. 20 | Defaults to \code{TRUE}. 21 | Use \code{FALSE} to allow overlap of a node with itself} 22 | } 23 | \value{ 24 | A symmetric matrix of weighted topological overlap 25 | values between each pair of variables 26 | } 27 | \description{ 28 | Computes weighted topological overlap following 29 | the Novick et al. (2009) definition 30 | } 31 | \examples{ 32 | # Obtain network 33 | network <- network.estimation(wmt2[,7:24], model = "glasso") 34 | 35 | # Compute wTO 36 | wto(network) 37 | 38 | } 39 | \references{ 40 | \strong{Original formalization} \cr 41 | Nowick, K., Gernat, T., Almaas, E., & Stubbs, L. (2009). 42 | Differences in human and chimpanzee gene expression patterns define an evolving network of transcription factors in brain. 43 | \emph{Proceedings of the National Academy of Sciences}, \emph{106}, 22358-22363. 44 | } 45 | -------------------------------------------------------------------------------- /src/init.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | // Declare the C functions you want to make available to R here 6 | extern SEXP r_signed_modularity(SEXP r_input_network, SEXP r_input_memberships, SEXP r_resolution); 7 | extern SEXP r_polychoric_correlation_matrix(SEXP r_input_matrix, SEXP r_empty_method, SEXP r_empty_value, SEXP r_rows, SEXP r_cols); 8 | extern SEXP r_ziggurat(SEXP n, SEXP r_seed); 9 | extern SEXP r_xoshiro_seeds(SEXP n, SEXP r_seed); 10 | extern SEXP r_xoshiro_uniform(SEXP n, SEXP r_seed); 11 | extern SEXP r_xoshiro_shuffle(SEXP r_vector, SEXP r_seed); 12 | extern SEXP r_xoshiro_shuffle_replace(SEXP r_vector, SEXP r_seed); 13 | 14 | // Register native routine 15 | static const R_CallMethodDef CallEntries[] = { 16 | 17 | { 18 | "r_signed_modularity", // Name of function call in R 19 | (DL_FUNC)&r_signed_modularity, // Name of C function 20 | 3 // Number of arguments 21 | }, 22 | { 23 | "r_polychoric_correlation_matrix", // Name of function call in R 24 | (DL_FUNC)&r_polychoric_correlation_matrix, // Name of C function 25 | 5 // Number of arguments 26 | }, 27 | { 28 | "r_ziggurat", // Name of function call in R 29 | (DL_FUNC)&r_ziggurat, // Name of C function 30 | 2 // Number of arguments 31 | }, 32 | { 33 | "r_xoshiro_uniform", // Name of function call in R 34 | (DL_FUNC)&r_xoshiro_uniform, // Name of C function 35 | 2 // Number of arguments 36 | }, 37 | { 38 | "r_xoshiro_seeds", // Name of function call in R 39 | (DL_FUNC)&r_xoshiro_seeds, // Name of C function 40 | 2 // Number of arguments 41 | }, 42 | { 43 | "r_xoshiro_shuffle", // Name of function call in R 44 | (DL_FUNC)&r_xoshiro_shuffle, // Name of C function 45 | 2 // Number of arguments 46 | }, 47 | { 48 | "r_xoshiro_shuffle_replace", // Name of function call in R 49 | (DL_FUNC)&r_xoshiro_shuffle_replace, // Name of C function 50 | 2 // Number of arguments 51 | }, 52 | {NULL, NULL, 0} 53 | 54 | }; 55 | 56 | // Set up call in package 57 | void R_init_EGAnet(DllInfo *dll) { 58 | R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); 59 | R_useDynamicSymbols(dll, FALSE); 60 | } 61 | -------------------------------------------------------------------------------- /src/modularity.h: -------------------------------------------------------------------------------- 1 | #ifndef MODULARITY_H 2 | #define MODULARITY_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | // Structure for `modularity_values` 9 | struct modularity_result { 10 | double* positive_modularity_values; 11 | double* negative_modularity_values; 12 | double positive_sum_flag; 13 | double negative_sum_flag; 14 | double positive_total_sum; 15 | double negative_total_sum; 16 | }; 17 | 18 | // Function prototypes 19 | struct modularity_result modularity_values(double* network, int cols, double resolution); 20 | double signed_modularity(struct modularity_result Q_values, int* membership, int cols); 21 | 22 | #endif /* MODULARITY_H */ 23 | -------------------------------------------------------------------------------- /src/nanotime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | // Get clock time in nanoseconds 7 | uint64_t get_time_ns(void) { 8 | struct timespec ts; 9 | clock_gettime(CLOCK_REALTIME, &ts); 10 | return (uint64_t)ts.tv_sec * 1000000000ULL + (uint64_t)ts.tv_nsec; 11 | } 12 | -------------------------------------------------------------------------------- /src/nanotime.h: -------------------------------------------------------------------------------- 1 | #ifndef NANOTIME_H 2 | #define NANOTIME_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | // Function prototypes 10 | uint64_t get_time_ns(void); 11 | 12 | #endif /* NANOTIME_H */ 13 | -------------------------------------------------------------------------------- /src/polychoric_matrix.h: -------------------------------------------------------------------------------- 1 | #ifndef POLYCHORIC_H 2 | #define POLYCHORIC_H 3 | 4 | // Constant for hard cut-off for polychoric 5 | #define CUT 11 // similar to {Turbofuns} 6 | 7 | // Constants in `bsm_inverse_cdf` 8 | extern const double CONST_A[6]; 9 | extern const double CONST_B[5]; 10 | extern const double CONST_C[6]; 11 | extern const double CONST_D[4]; 12 | 13 | // Constants in `joint_frequency_table` 14 | #define MISSING 99 15 | 16 | // Constants in `error_function` 17 | #define A1 0.254829592 18 | #define A2 -0.284496736 19 | #define A3 1.421413741 20 | #define A4 -1.453152027 21 | #define A5 1.061405429 22 | #define P 0.3275911 23 | 24 | // Constants in `drezner_bivariate_normal` 25 | // #define INT_NX 5 // not needed with loop unrolling 26 | #define COR_MAX 0.7 27 | #define BV_FAC1 0.13298076 28 | #define BV_FAC2 0.053051647 29 | extern const double DOUBLE_X[5]; 30 | extern const double DOUBLE_W[5]; 31 | 32 | // Constants in `optimize` 33 | #define LOWER -1.0 34 | #define UPPER 1.0 35 | #define TOL 1e-05 // tolerate to floating point 36 | #define MAX_ITER 100 37 | #define ZEPS 1e-10 38 | 39 | #endif /* POLYCHORIC_H */ 40 | -------------------------------------------------------------------------------- /src/signed_modularity.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "modularity.h" 5 | 6 | SEXP r_signed_modularity(SEXP r_input_network, SEXP r_input_memberships, SEXP r_resolution) { 7 | 8 | // Obtain columns 9 | int cols = ncols(r_input_network); 10 | 11 | // Call the C functions 12 | struct modularity_result Q_values = modularity_values( 13 | REAL(r_input_network), cols, REAL(r_resolution)[0] 14 | ); 15 | 16 | // Initialize R object 17 | SEXP r_modularity = PROTECT(allocVector(REALSXP, 1)); 18 | 19 | // Calculate signed modularity 20 | REAL(r_modularity)[0] = signed_modularity(Q_values, INTEGER(r_input_memberships), cols); 21 | 22 | // Free R output 23 | UNPROTECT(1); 24 | 25 | // Free memory 26 | free(Q_values.positive_modularity_values); 27 | free(Q_values.negative_modularity_values); 28 | 29 | // Return the result 30 | return r_modularity; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/xoshiro.h: -------------------------------------------------------------------------------- 1 | #ifndef XOSHIRO256PLUSPLUS_H 2 | #define XOSHIRO256PLUSPLUS_H 3 | 4 | #include 5 | 6 | // Structure for seeding states 7 | typedef struct { 8 | uint64_t s[4]; 9 | } xoshiro256_state; 10 | 11 | 12 | // Function to get the next random number 13 | uint64_t next(xoshiro256_state* state); 14 | 15 | // Get initial states 16 | uint64_t splitmix64(uint64_t *x); 17 | 18 | // Function to set single seed to get the 4 random seeds 19 | void seed_xoshiro256(xoshiro256_state* state, uint64_t seed); 20 | 21 | // Function to generate random uniform data between 0 and 1 22 | double xoshiro_uniform(xoshiro256_state* state); 23 | 24 | #endif /* XOSHIRO256PLUSPLUS_H */ 25 | -------------------------------------------------------------------------------- /src/ziggurat.h: -------------------------------------------------------------------------------- 1 | #include "xoshiro.h" 2 | 3 | // Constants 4 | #define R 3.442620 // r 5 | #define DN 3.442619855899 // dn 6 | #define M1 2147483648.0 // m1 7 | #define VN 9.91256303526217E-03 // vn 8 | 9 | // Function prototypes 10 | void r4_nor_setup ( uint32_t kn[128], double fn[128], double wn[128] ); 11 | double r4_nor ( xoshiro256_state* state, uint32_t kn[128], double fn[128], double wn[128] ); 12 | --------------------------------------------------------------------------------