Package ‘NetworkToolbox’ · Package ‘NetworkToolbox ... NEO-PI-3 Openness to Experience...
Transcript of Package ‘NetworkToolbox’ · Package ‘NetworkToolbox ... NEO-PI-3 Openness to Experience...
Package ‘NetworkToolbox’April 29, 2018
Title Methods and Measures for Brain, Cognitive, and PsychometricNetwork Analysis
Version 1.1.2
Date 2018-04-20
Author Alexander Christensen
Maintainer Alexander Christensen <[email protected]>
Description Implements network analysis and graph theory measures used in neuroscience, cogni-tive science, and psychology. Methods include various filtering methods and ap-proaches such as threshold, dependency (Kenett, Tumminello, Madi, Gur-Gershogoren, Man-tegna, & Ben-Jacob, 2010 <doi:10.1371/journal.pone.0015032>), Information Filtering Net-works (Barfuss, Massara, Di Mat-teo, & Aste, 2016 <doi:10.1103/PhysRevE.94.062306>), and Efficiency-Cost Optimization (Fal-lani, Latora, & Chavez, 2017 <doi:10.1371/journal.pcbi.1005305>). Brain methods in-clude the recently developed Connectome Predictive Modeling (see references in pack-age). Also implements several network measures including local network characteris-tics (e.g., centrality), global network characteristics (e.g., clustering coefficient), and vari-ous other measures associated with the reliability and reproducibility of network analysis.
Depends R (>= 3.3.0)
License GPL (>= 3.0)
Encoding UTF-8
LazyData true
Imports Matrix, psych, corrplot, fdrtool, R.matlab, MASS, pwr, igraph,qgraph, IsingFit, ppcor, parallel, foreach, doSNOW
RoxygenNote 6.0.1.9000
NeedsCompilation no
Repository CRAN
Date/Publication 2018-04-29 21:46:26 UTC
R topics documented:NetworkToolbox-package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1
2 R topics documented:
animals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4behavOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4betweenness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5binarize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6bootgen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7bootgenPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8centlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9closeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10clustcoeff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11comcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12commboot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13conn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14convert2igraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15convertConnBrainMat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16cor2cov . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17cpmEV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17cpmFP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18cpmFPperm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19cpmIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20degree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22depend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22depna . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25diversity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26ECO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27ECOplusMaST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28edgerep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28eigenvector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30hybrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31impact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32is.graphical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33kld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34lattnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35leverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35LoGo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36louvain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37MaST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38nams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39neoOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40neuralcorrtest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41neuralgrouptest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42neuralnetfilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43neuralstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44participation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46pathlengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47randnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48reg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
NetworkToolbox-package 3
rmse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49rspbc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50semnetboot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51semnetmeas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52sim.swn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53smallworldness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54splitsamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55splitsampNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56splitsampStats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57stable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58strength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59threshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59TMFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61transitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Index 64
NetworkToolbox-package
NetworkToolbox–package
Description
Implements network analysis and graph theory measures used in neuroscience, cognitive science,and psychology. Methods include various filtering methods and approaches such as threshold, de-pendency, Information Filtering Networks, and Efficiency-Cost Optimization. Brain methods in-clude the recently developed Connectome Predictive Modeling. Also implements several networkmeasures including local network characteristics (e.g., centrality), global network characteristics(e.g., clustering coefficient), and various other measures associated with the reliability and repro-ducibility of network analysis.
Author(s)
Alexander Christensen <[email protected]>
References
Christensen, A. P. (2018). NetworkToolbox: Methods and measures for brain, cognitive, and psy-chometric network analysis. R package version 1.1.2. Available from https://github.com/AlexChristensen/NetworkToolbox
4 behavOpen
animals Animal Verbal Fluency Data
Description
Verbal fluency reponses for the animal category. The group variable specifies people’s level ofNEO-FFI-3 Openness to Experience (low = 1, moderate = 2, high = 3).
Usage
data(animals)
Format
A 802x48 response matrix
Details
A binary verbal fluency response matrix (n = 354) from Christensen, Kenett, Cotter, Beaty, & Silvia(under review).
References
Christensen, A.P., Kenett, Y. N., Cotter, K.N., Beaty, R. E., & Silvia, P.J. (under review). Remotelyclose associations: Openness to Experience and semantic memory structure
Examples
data("animals")
behavOpen NEO-PI-3 for Resting-state Data
Description
NEO-PI-3 Openness to Experience associated with resting-state data (n = 144).
Usage
data(behavOpen)
Format
behavOpen (vector, length = 144)
betweenness 5
Details
Behavioral data of NEO-PI-3 associated with each connectivity matrix (open).
To access the resting-state brain data, please go to https://drive.google.com/file/d/1ugwi7nRrlHQYuGPzEB4wYzsizFrIMvKR/view
References
Beaty, R. E., Chen, Q., Christensen, A. P., Qiu, J., Silvia, P. J., & Schacter, D. L. (2018). Brainnetworks of the imaginative mind: Dynamic functional connectivity of default and cognitive controlnetworks relates to Openness to Experience. Human Brain Mapping, 39(2), 811-821.
Beaty, R. E., Kenett, Y. N., Christensen, A. P., Rosenberg, M. D., Benedek, M., Chen, Q., ... & Sil-via, P. J. (2018). Robust prediction of individual creative ability from brain functional connectivity.Proceedings of the National Academy of Sciences, 201713532.
Examples
data("behavOpen")
betweenness Betwenness Centrality
Description
Computes betweenness centrlaity of each node in a network
Usage
betweenness(A, weighted = TRUE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to TRUE. Set to FALSE for unweightedmeasure of betwenness centrality
Value
A vector of betweenness centrality values for each node in the network
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
6 binarize
Examples
A<-TMFG(neoOpen)$A
weighted_BC<-betweenness(A)
unweighted_BC<-betweenness(A,weighted=FALSE)
binarize Binarize Network
Description
Converts weighted adjacency matrix to a binarized adjacency matrix
Usage
binarize(A)
Arguments
A An adjacency matrix of network data (or an array of matrices)
Value
Returns an adjancency matrix of 1’s and 0’s
Author(s)
Alexander Christensen <[email protected]>
Examples
net<-TMFG(neoOpen)$A
psyb<-binarize(net)
bootgen 7
bootgen Bootstrapped Network Generalization
Description
Bootstraps the sample to identify the most stable correlations. Also produces a network that ispenalizes low reliability edges. This function is useful for overcoming the structural constraint ofthe IFN approach
Usage
bootgen(data, method = c("MaST", "TMFG", "LoGo", "threshold"), alpha = 0.05,n = nrow(data), iter = 1000, normal = FALSE, na.data = c("pairwise","listwise", "fiml", "none"), cores, progBar = TRUE, ...)
Arguments
data A set of data
method A network filtering method. Defaults to "TMFG"
alpha Alpha threshold bootstrapped network generalization network
n Number of people to use in the bootstrap. Defaults to full sample size
iter Number of bootstrap iterations. Defaults to 1000 iterations
normal Should data be transformed to a normal distribution? Defaults to FALSE. Datais not transformed to be normal. Set to TRUE if data should be transformed tobe normal (computes correlations using the cor_auto function)
na.data How should missing data be handled? For "listwise" deletion the na.omit func-tion is applied. Set to "fiml" for Full Information Maxmimum Likelihood (cor-Fiml). Full Information Maxmimum Likelihood is recommended but time con-suming
cores Number of computer processing cores to use for bootstrapping samples. De-faults to n - 1 total number of cores. Set to any number between 1 and maxmi-mum amount of cores on your computer
progBar Should progress bar be displayed? Defaults to TRUE. Set to FALSE for noprogress bar
... Additional arguments for filtering methods
Value
Returns a list that includes the original filtered network (orignet), correlation matrix of the meanbootstrapped network (bootmat), and unfiltered reliabilities of all of the connections (netrel)
Author(s)
Alexander Christensen <[email protected]>
8 bootgenPlot
References
Perez, M. E., & Pericchi, L. R. (2014). Changing statistical significance with the amount of infor-mation: The adaptive a significance level. Statistics & Probability Letters, 85, 20-24.
Tumminello, M., Coronnello, C., Lillo, F., Micciche, S., & Mantegna, R. N. (2007). Spanningtrees and bootstrap reliability estimation in correlation-based networks. International Journal ofBifurcation and Chaos, 17(7), 2319-2329.
Examples
## Not run:bootTMFG<-bootgen(neoOpen)
bootLoGo<-bootgen(neoOpen,method="LoGo")
bootMaST<-bootgen(neoOpen,method="MaST")
bootThreshold<-bootgen(neoOpen,method="threshold")
## End(Not run)
bootgenPlot Bootstrapped Network Generalization Plots
Description
Generates reliability plots from the bootgen function
Usage
bootgenPlot(object, bootmat = FALSE, breaks = 20)
Arguments
object An output from the bootgen function
bootmat Should the bootstrap generalization matrix be included? Defaults to FALSE. Setto TRUE to plot the original and bootmat networks’ reliablities
breaks If bootmat = TRUE, then reliability comparison histogram is produced. Thebreaks may not appear as desired, so the researcher can adjust as needed. De-faults to 20 (try 10 if 20 isn’t equivalent breaks)
Value
Returns the following plots: a reliability matrix for the original network ("Original Network Corre-lation Reliabilities" upper triangle = network reliabilites from the filtered network, lower triangle =full, unfiltered matrix reliablities), a plot of retained correlations on their reliability ("Original Net-work Correlation Strength on Reliability"), If bootmat is set to TRUE, then also a reliability matrix
centlist 9
for the bootgen network ("bootgen Network Correlation Reliabilities" upper triangle = network reli-abilites from the bootgen filtered network, lower triangle = full, unfiltered matrix reliablities), a plotof retained correlations on their reliability ("bootgen Network Correlation Strength on Reliability"),a frequency of the reliability of edges in both the original and bootgen network
Author(s)
Alexander Christensen <[email protected]>
References
Wei, T. & Simko, V.(2017). R package "corrplot": Visualization of a correlation matrix (Version0.84). Available from https://github.com/taiyun/corrplot
Examples
## Not run:bootTMFG <- bootgen(neoOpen)
bootPlot <- bootPlot(bootTMFG)
## End(Not run)
centlist List of Centrality Measures
Description
Computes centrality measures of the network
Usage
centlist(A, weighted = TRUE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to TRUE. Set to FALSE for unweighted listof centrality measures
Value
Returns a list of betweenness, closeness, degree (weighted = strength), eigenvector, and leveragecentralities
Author(s)
Alexander Christensen <[email protected]>
10 closeness
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
A<-TMFG(neoOpen)$A
weighted_centralitylist<-centlist(A)
unweighted_centralitylist<-centlist(A, weighted=FALSE)
closeness Closeness Centrality
Description
Computes closeness centrlaity of each node in a network
Usage
closeness(A, weighted = TRUE)
Arguments
A An adjacency matrix of network dataweighted Is the network weighted? Defaults to TRUE. Set to FALSE for unweighted
measure of closeness centrality
Value
A vector of closeness centrality values for each node in the network
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
A<-TMFG(neoOpen)$A
weighted_LC<-closeness(A)
unweighted_LC<-closeness(A,weighted=FALSE)
clustcoeff 11
clustcoeff Clustering Coefficient
Description
Computes global clustering coefficient (CC) and local clustering coefficient (CCi)
Usage
clustcoeff(A, weighted = FALSE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for weighted mea-sures of CC and CCi
Value
Returns a list of CC and CCi
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
A<-TMFG(neoOpen)$A
unweighted_CC<-clustcoeff(A)
weighted_CC<-clustcoeff(A, weighted=TRUE)
12 comcat
comcat Communicating Nodes
Description
Computes the between-community strength for each node in the network
Usage
comcat(A, factors = c("walktrap", "louvain"), cent = c("strength","degree"), ...)
Arguments
A An adjacency matrix of network data
factors Can be a vector of factor assignments or community detection algorithms ("walk-trap" or "louvain") can be used to determine the number of factors. Defaults to"walktrap". Set to "louvain" for louvain community detection
cent Centrality measure to be used. Defaults to "strength".
... Additional arguments for community detection algorithms
Value
A matrix containing the between-community strength value for each node
Author(s)
Alexander Christensen <[email protected]>
References
Blanken, T. F., Deserno, M. K., Dalege, J., Borsboom, D., Blanken, P., Kerkhof, G. A., & Cramer,A. O. (2018). The role of stabilizing and communicating symptoms given overlapping communitiesin psychopathology networks. Scientific Reports, 8(1), 5854.
Examples
A<-TMFG(neoOpen)$A
communicating <- comcat(A, factors = "walktrap")
commboot 13
commboot Bootstrapped Communities Likelihood
Description
Bootstraps the sample with replace to compute walktrap reliability
Usage
commboot(data, normal = FALSE, n = nrow(data), iter = 1000,filter = c("TMFG", "threshold", "EBICglasso", "IsingFit"),method = c("louvain", "walktrap"), na.data = c("pairwise", "listwise","fiml", "none"), steps = 4, cores, ...)
Arguments
data A set of data
normal Should data be transformed to a normal distribution? Defaults to FALSE. Datais not transformed to be normal. Set to TRUE if data should be transformed tobe normal
n Number of people to use in the bootstrap. Defaults to full sample size
iter Number of bootstrap iterations. Defaults to 100 iterations
filter Set filter method. Defaults to "TMFG". See EBICglasso and IsingFit foradditional arguments
method Defaults to "walktrap". Set to "louvain" for the louvain community detectionalgorithm
na.data How should missing data be handled? For "listwise" deletion the na.omit func-tion is applied. Set to "fiml" for Full Information Maxmimum Likelihood (cor-Fiml). Full Information Maxmimum Likelihood is recommended but time con-suming
steps Number of steps to use in the walktrap algorithm. Defaults to 4. Use a largernumber of steps for smaller networks
cores Number of computer processing cores to use for bootstrapping samples. De-faults to n - 1 total number of cores. Set to any number between 1 and maxmi-mum amount of cores on your computer
... Additional arguments for network filtering methods
Value
Returns the number of factors and their relative frequency found across bootstrapped samples
Author(s)
Alexander Christensen <[email protected]>
14 conn
References
Blondel, V. D., Guillaume, J. L., Lambiotte, R., & Lefebvre, E. (2008). Fast unfolding of com-munities in large networks. Journal of Statistical Mechanics: Theory and Experiment, 2008(10),P10008.
Csardi, G., & Nepusz, T. (2006). The igraph software package for complex network research.InterJournal, Complex Systems, 1695(5), 1-9.
Examples
## Not run:commTMFG<-commboot(neoOpen)
commThreshold<-commboot(neoOpen,filter="threshold")
## End(Not run)
conn Network Connectivity
Description
Computes the average and standard deviation of the weights in the network
Usage
conn(A)
Arguments
A An adjacency matrix of network A
Value
Returns a list of the edge weights (weights), the mean (mean), the standard deviation (sd), and thesum of the edge weights (total) in the network
Author(s)
Alexander Christensen <[email protected]>
Examples
A<-TMFG(neoOpen)$A
connectivity<-conn(A)
convert2igraph 15
convert2igraph Convert Network(s) to igraph’s Format
Description
Converts single or multiple networks into igraph’s format for network analysis
Usage
convert2igraph(A, neural = FALSE)
Arguments
A Adjacency matrix (network matrix) or brain connectivity array (from convertConnBrainMat)
neural Is input a brain connectivity array (i.e., m x m x n)? Defaults to FALSE. Set toTRUE to convert each brain connectivity matrix
Value
Returns a network matrix in igraph’s format or returns a list of brain connectivity matrices each ofwhich have been convert to igraph’s format
Author(s)
Alexander Christensen <[email protected]>
Examples
A <- TMFG(neoOpen)$A
igraphNetwork <- convert2igraph(A)
## Not run:neuralarray<-convertConnBrainMat()
igraphNeuralList <- convert2igraph(neuralarray, neural = TRUE)
## End(Not run)
16 convertConnBrainMat
convertConnBrainMat Import CONN Toolbox Brain Matrices to R format
Description
Converts a Matlab brain z-score connectivity array (n x n x m) where n is the n x n connectivitymatrices and m is the participant. If you would like to simply import a connectivity array fromMatlab, then see the examples
Usage
convertConnBrainMat(MatlabData, progBar = TRUE)
Arguments
MatlabData Input for Matlab data file. Defaults to interactive file choice
progBar Should progress bar be displayed? Defaults to TRUE. Set FALSE for no progressbar
Value
Returns a list of correlation (rmat) and z-score (zmat) arrays of neural connectivity matrices (n x nx m)
Author(s)
Alexander Christensen <[email protected]>
Examples
## Not run:neuralarray<-convertConnBrainMat()
#Import correlation connectivity array from Matlablibrary(R.matlab)neuralarray<-readMat(file.choose())
## End(Not run)
cor2cov 17
cor2cov Convert Correlation Matrix to Covariance Matrix
Description
Converts a correlation matrix to a covariance matrix
Usage
cor2cov(cormat, data)
Arguments
cormat A correlation matrix
data The dataset the correlation matrix is from
Value
Returns a covariance matrix
Author(s)
Alexander Christensen <[email protected]>
Examples
cormat <- cor(neoOpen)
covmat <- cor2cov(cormat,neoOpen)
cpmEV Connectome-based Predictive Modeling–External Validation
Description
Applies the Connectome-based Predictive Modeling approach to neural data. This method predictsa behavioral statistic using neural connectivity from the sample. Results may differ from Matlabresults because of robust GLM methodology. This function is still in its testing phase. Please citeFinn et al., 2015; Rosenberg et al., 2016; Shen et al., 2017
Usage
cpmEV(train_na, train_b, valid_na, valid_b, thresh = 0.01, overlap = FALSE,progBar = TRUE)
18 cpmFP
Arguments
train_na Training dataset (an array from convertConnBrainMat function)
train_b Behavioral statistic for each participant for the training neural data (a vector)
valid_na Validation dataset (an array from convertConnBrainMat function)
valid_b Behavioral statistic for each participant for the validation neural data (a vector)
thresh Sets an alpha threshold for edge weights to be retained. Defaults to .01
overlap Should leave-one-out cross-validation be used? Defaults to FALSE (use fulldataset, no leave-one-out). Set to TRUE to select edges that appear in everyleave-one-out cross-validation network (time consuming)
progBar Should progress bar be displayed? Defaults to TRUE. Set to FALSE for noprogress bar
Value
Returns a list containing a matrix (r coefficient (r), p-value (p-value), mean absolute error (mae),root mean square error (rmse)). The list also contains the positive (posMask) and negative (neg-Mask) masks used
Author(s)
Alexander Christensen <[email protected]>
References
Finn, E. S., Shen, X., Scheinost, D., Rosenberg, M. D., Huang, J., Chun, M. M., Papademetris,X., Constable, R. T. (2015). Functional connectome fingerprinting: Identifying individuals usingpatterns of brain connectivity. Nature Neuroscience, 18(11), 1664-1671.
Rosenberg, M. D., Finn, E. S., Scheinost, D., Papademetris, X., Shen, X., Constable, R. T., Chun,M. M. (2016). A neuromarker of sustained attention from whole-brain functional connectivity.Nature Neuroscience, 19(1), 165-171.
Shen, X. Finn, E. S., Scheinost, D., Rosenberg, M. D., Chun, M. M., Papademetris, X., Constable,R. T. (2017). Using connectome-based predictive modeling to predict individual behavior frombrain connectivity. Nature Protocols, 12(3), 506-518.
Wei, T. & Simko, V.(2017). R package "corrplot": Visualization of a correlation matrix (Version0.84). Available from https://github.com/taiyun/corrplot
cpmFP Connectome-based Predictive Modeling–Fingerprinting
Description
Applies the Connectome-based Predictive Modeling approach to neural data. This method identifiesindividuals based on their specific connectivity patterns. Please cite Finn et al., 2015; Rosenberget al., 2016; Shen et al., 2017
cpmFPperm 19
Usage
cpmFP(session1, session2, progBar = TRUE)
Arguments
session1 Array from convertConnBrainMat function (first session)
session2 Array from convertConnBrainMat function (second session)
progBar Should progress bar be displayed? Defaults to TRUE. Set to FALSE for noprogress bar
Value
Returns a matrix containing the percentage and number of correctly identified subjects for sessions1 and 2
Author(s)
Alexander Christensen <[email protected]>
References
Finn, E. S., Shen, X., Scheinost, D., Rosenberg, M. D., Huang, J., Chun, M. M., Papademetris,X., Constable, R. T. (2015). Functional connectome fingerprinting: Identifying individuals usingpatterns of brain connectivity. Nature Neuroscience, 18(11), 1664-1671.
Rosenberg, M. D., Finn, E. S., Scheinost, D., Papademetris, X., Shen, X., Constable, R. T., Chun,M. M. (2016). A neuromarker of sustained attention from whole-brain functional connectivity.Nature Neuroscience, 19(1), 165-171.
Shen, X. Finn, E. S., Scheinost, D., Rosenberg, M. D., Chun, M. M., Papademetris, X., Constable,R. T. (2017). Using connectome-based predictive modeling to predict individual behavior frombrain connectivity. Nature Protocols, 12(3), 506-518.
cpmFPperm Connectome-based Predictive Modeling–Fingerprinting Permutation
Description
Applies the Connectome-based Predictive Modeling approach to neural data. This method identifiesindividuals based on their specific connectivity patterns. Please cite Finn et al., 2015; Rosenberget al., 2016; Shen et al., 2017
Usage
cpmFPperm(session1, session2, iter = 1000, progBar = TRUE)
20 cpmIV
Arguments
session1 Array from convertConnBrainMat function (first session)
session2 Array from convertConnBrainMat function (second session)
iter Number of iterations to perform. Defaults to 1,000
progBar Should progress bar be displayed? Defaults to TRUE. Set to FALSE for noprogress bar
Value
Returns a matrix containing the percentage and number of correctly identified subjects for sessions1 and 2
Author(s)
Alexander Christensen <[email protected]>
References
Finn, E. S., Shen, X., Scheinost, D., Rosenberg, M. D., Huang, J., Chun, M. M., Papademetris,X., Constable, R. T. (2015). Functional connectome fingerprinting: Identifying individuals usingpatterns of brain connectivity. Nature Neuroscience, 18(11), 1664-1671.
Rosenberg, M. D., Finn, E. S., Scheinost, D., Papademetris, X., Shen, X., Constable, R. T., Chun,M. M. (2016). A neuromarker of sustained attention from whole-brain functional connectivity.Nature Neuroscience, 19(1), 165-171.
Shen, X. Finn, E. S., Scheinost, D., Rosenberg, M. D., Chun, M. M., Papademetris, X., Constable,R. T. (2017). Using connectome-based predictive modeling to predict individual behavior frombrain connectivity. Nature Protocols, 12(3), 506-518.
cpmIV Connectome-based Predictive Modeling–Internal Validation
Description
Applies the Connectome-based Predictive Modeling approach to neural data. This method predictsa behavioral statistic using neural connectivity from the sample. Please cite Finn et al., 2015;Rosenberg et al., 2016; Shen et al., 2017
Usage
cpmIV(neuralarray, bstat, covar, thresh = 0.01, method = c("mean", "sum"),model = c("linear", "quadratic", "cubic"), corr = c("pearson","spearman"), shen = FALSE, cores, progBar = TRUE)
cpmIV 21
Arguments
neuralarray Array from convertConnBrainMat function
bstat Behavioral statistic for each participant with neural data (a vector)
covar Covariates to be included in predicting relevant edges (time consuming). Mustbe input as a list() (see examples)
thresh Sets an alpha threshold for edge weights to be retained. Defaults to .01
method Use "mean" or "sum" of edge strengths in the positive and negative connec-tomes. Defaults to "mean"
model Regression model to use for fitting the data. Defaults to "linear"
corr Correlation method for assessing the relatonship between the behavioral mea-sure and edges between ROIs. Defaults to "pearson". Set to "spearman" fornon-linear or monotonic associations
shen Are ROIs from Shen et al. 2013 atlas? Defaults to FALSE. Set to TRUE forcanonical networks plot
cores Number of computer processing cores to use when performing covariate analy-ses. Defaults to n - 1 total number of cores. Set to any number between 1 andmaxmimum amount of cores on your computer
progBar Should progress bar be displayed? Defaults to TRUE. Set to FALSE for noprogress bar
Value
Returns a list containing a matrix (correlation coefficient (r), p-value (p), mean absolute error(mae), root mean square error (rmse)). The list also contains the positive (posMask) and negative(negMask) masks, which can be visualized here: http://bisweb.yale.edu/build/connviewer.html
Author(s)
Alexander Christensen <[email protected]>
References
Finn, E. S., Shen, X., Scheinost, D., Rosenberg, M. D., Huang, J., Chun, M. M., Papademetris,X., Constable, R. T. (2015). Functional connectome fingerprinting: Identifying individuals usingpatterns of brain connectivity. Nature Neuroscience, 18(11), 1664-1671.
Rosenberg, M. D., Finn, E. S., Scheinost, D., Papademetris, X., Shen, X., Constable, R. T., Chun,M. M. (2016). A neuromarker of sustained attention from whole-brain functional connectivity.Nature Neuroscience, 19(1), 165-171.
Shen, X. Finn, E. S., Scheinost, D., Rosenberg, M. D., Chun, M. M., Papademetris, X., Constable,R. T. (2017). Using connectome-based predictive modeling to predict individual behavior frombrain connectivity. Nature Protocols, 12(3), 506-518.
Wei, T. & Simko, V.(2017). R package "corrplot": Visualization of a correlation matrix (Version0.84). Available from https://github.com/taiyun/corrplot
22 depend
degree Degree
Description
Computes degree of each node in a network
Usage
degree(A)
Arguments
A An adjacency matrix of network data
Value
A vector of degree values for each node in the network. If directed network, returns a list of in-degree (inDegree), out-degree (outDegree), and relative influence (relInf)
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
A<-TMFG(neoOpen)$A
deg<-degree(A)
depend Dependency Network Approach
Description
Generates a dependency matrix of the data (index argument is still in testing phase)
Usage
depend(data, normal = FALSE, na.data = c("pairwise", "listwise", "fiml","none"), index = FALSE, fisher = FALSE, progBar = TRUE)
depend 23
Arguments
data A set of data
normal Should data be transformed to a normal distribution? Defaults to FALSE. Datais not transformed to be normal. Set to TRUE if data should be transformed tobe normal (computes correlations using the cor_auto function)
na.data How should missing data be handled? For "listwise" deletion the na.omit func-tion is applied. Set to "fiml" for Full Information Maxmimum Likelihood (cor-Fiml). Full Information Maxmimum Likelihood is recommended but time con-suming
index Should correlation with the latent variable (i.e., weighted average of all vari-ables) be removed? Defaults to FALSE. Set to TRUE to remove common latentfactor
fisher Should Fisher’s Z-test be used to keep significantly higher influences (indexonly)? Defaults to FALSE. Set to TRUE to remove non-significant influences
progBar Should progress bar be displayed? Defaults to TRUE. Set to FALSE for noprogress bar
Value
Returns an adjacency matrix of dependencies
Author(s)
Alexander Christensen <[email protected]>
References
Kenett, D. Y., Tumminello, M., Madi, A., Gur-Gershgoren, G., Mantegna, R. N., & Ben-Jacob, E.(2010). Dominating clasp of the financial sector revealed by partial correlation analysis of the stockmarket. PloS one, 5(12), e15032.
Kenett, D. Y., Huang, X., Vodenska, I., Havlin, S., & Stanley, H. E. (2015). Partial correlationanalysis: Applications for financial markets. Quantitative Finance, 15(4), 569-578.
Examples
D<-depend(neoOpen)
Dindex<-depend(neoOpen,index=TRUE)
24 depna
depna Dependency Neural Networks
Description
Applies the dependency network approach to neural network array
Usage
depna(neuralarray, pB = TRUE, ...)
Arguments
neuralarray Array from convertConnBrainMat function
pB Should progress bar be displayed? Defaults to TRUE. Set FALSE for no progressbar
... Additional arguments from depend function
Value
Returns an array of n x n x m dependency matrices
Author(s)
Alexander Christensen <[email protected]>
References
Jacob, Y., Winetraub, Y., Raz, G., Ben-Simon, E., Okon-Singer, H., Rosenberg-Katz, K., ... & Ben-Jacob, E. (2016). Dependency Network Analysis (DEPNA) Reveals Context Related Influence ofBrain Network Nodes. Scientific Reports, 6, 27444.
Kenett, D. Y., Tumminello, M., Madi, A., Gur-Gershgoren, G., Mantegna, R. N., & Ben-Jacob, E.(2010). Dominating clasp of the financial sector revealed by partial correlation analysis of the stockmarket. PloS one, 5(12), e15032.
Examples
## Not run:neuralarray <- convertConnBrainMat()
dependencyneuralarray <- depna(neuralarray)
## End(Not run)
distance 25
distance Distance
Description
Computes distance matrix of the network
Usage
distance(A, weighted = FALSE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for weighted mea-sure of distance
Value
A distance matrix of the network
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
A<-TMFG(neoOpen)$A
unweighted_D<-distance(A)
weighted_D<-distance(A, weighted=TRUE)
26 diversity
diversity Diversity Coefficient
Description
Computes the diversity coefficient for each node. The diversity coefficient measures a node’s con-nections to communitites outside of its own community. Nodes that have many connections to othercommunities will have higher diversity coefficient values. Positive and negative signed weights fordiversity coefficients are computed separately.
Usage
diversity(A, factors = c("walktrap", "louvain"))
Arguments
A Network adjacency matrix
factors A vector of corresponding to each item’s factor. Defaults to "walktrap" for thewalktrap community detection algorithm. Set to "louvain" for the louvain com-munity detection algorithm. Can also be set to user-specified factors (see exam-ples)
Value
Returns a list of overall (signs not considered; overall), negative (negative), and positive (positive)gateway coefficients
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
#theoretical factorsfactors <- c(rep(1,8), rep(2,8), rep(3,8), rep(4,8), rep(5,8), rep(6,8))
A <- TMFG(neoOpen)$A
gdiv <- diversity(A, factors = factors)
#walktrap factorswdiv <- diversity(A, factors = "walktrap")
ECO 27
ECO ECO Neural Network Filter
Description
Applies the ECO neural network filtering method
Usage
ECO(data, weighted = TRUE, directed = FALSE)
Arguments
data Can be a dataset or a correlation matrix
weighted Should network be weighted? Defaults to TRUE. Set to FALSE to produce anunweighted (binary) network
directed Is the network directed? Defaults to FALSE. Set TRUE if the network is directed
Value
A sparse association matrix
Author(s)
Alexander Christensen <[email protected]>
References
Fallani, F. D. V., Latora, V., & Chavez, M. (2017). A topological criterion for filtering informationin complex brain networks. PLoS Computational Biology, 13(1), e1005305.
Examples
## Not run:weighted_undirected_ECOnetwork<-ECO(neoOpen)
unweighted_undirected_ECOnetwork<-ECO(neoOpen,weighted=FALSE)
weighted_directed_ECOnetwork<-ECO(neoOpen,directed=TRUE)
unweighted_directed_ECOnetwork<-ECO(neoOpen,weighted=FALSE,directed=TRUE)
## End(Not run)
28 edgerep
ECOplusMaST ECO+MaST Network Filter
Description
Applies the ECO neural network filtering method combined with the MaST filtering method
Usage
ECOplusMaST(data, weighted = TRUE)
Arguments
data Can be a dataset or a correlation matrix
weighted Should network be weighted? Defaults to TRUE. Set to FALSE to produce anunweighted (binary) network
Value
A sparse association matrix
Author(s)
Alexander Christensen <[email protected]>
References
Fallani, F. D. V., Latora, V., & Chavez, M. (2017). A topological criterion for filtering informationin complex brain networks. PLoS Computational Biology, 13(1), e1005305.
Examples
weighted_ECOplusMaSTnetwork<-ECOplusMaST(neoOpen)
edgerep Edge Replication
Description
Computes the number of edges that replicate between two cross-sectional networks
Usage
edgerep(A, B, corr = c("pearson", "spearman", "kendall"), plot = FALSE)
eigenvector 29
Arguments
A An adjacency matrix of network A
B An adjacency matrix of network B
corr Correlation method for assessing the relatonship between the replicated edgeweights. Defaults to "pearson". Set to "spearman" for non-linear or monotonicassociations. Set to "kendall" for rank-order correlations
plot Should there be a plot of the replicated weights? Defaults to FALSE. Set toTRUE for a plot to be produced
Value
Returns a list of the edges that replicated and their weights (replicatedEdges), number of edges thatreplicate (replicated), total number of edges (totalEdgesA & totalEdgesB), the percentage of edgesthat replicate (percentageA & percentageB), the density of edges (densityA & densityB), the meandifference between edges that replicate (meanDifference), the sd of the difference between edgesthat replicate (sdDifference), and the correlation between the edges that replicate for both networks(correlation)
Author(s)
Alexander Christensen <[email protected]>
Examples
A<-TMFG(neoOpen)$A
B<-MaST(neoOpen)
edges<-edgerep(A,B)
eigenvector Eigenvector Centrality
Description
Computes eigenvector centrality of each node in a network
Usage
eigenvector(A, weighted = TRUE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to TRUE. Set to FALSE for unweightedmeasure of eigenvector centrality
30 gateway
Value
A vector of eigenvector centrality values for each node in the network
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
A<-TMFG(neoOpen)$A
weighted_EC<-eigenvector(A)
unweighted_EC<-eigenvector(A,weighted=FALSE)
gateway Gateway Coefficient
Description
Computes the gateway coefficient for each node. The gateway coefficient measures a node’s con-nections between its community and other communities. Nodes that are solely responsible forinter-community connectivity will have higher gateway coefficient values. Positive and negativesigned weights for gateway coefficients are computed separately.
Usage
gateway(A, factors = c("walktrap", "louvain"), cent = c("strength","betweenness"))
Arguments
A Network adjacency matrix
factors A vector of corresponding to each item’s factor. Defaults to "walktrap" for thewalktrap community detection algorithm. Set to "louvain" for the louvain com-munity detection algorithm. Can also be set to user-specified factors (see exam-ples)
cent Centrality to community gateway coefficient. Defaults to "strength". Set to"betweenness" to use the betweenness centrality
hybrid 31
Value
Returns a list of overall (signs not considered; overall), negative (negative), and positive (positive)gateway coefficients
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Vargas, E. R., & Wahl, L. M. (2014). The gateway coefficient: A novel metric for identifyingcritical connections in modular networks. The European Physical Journal B, 87(161), 1-10.
Examples
#theoretical factorsfactors <- c(rep(1,8), rep(2,8), rep(3,8), rep(4,8), rep(5,8), rep(6,8))
A <- TMFG(neoOpen)$A
gw <- gateway(A, factors = factors)
#walktrap factorswgw <- gateway(A, factors = "walktrap")
hybrid Hybrid Centrality
Description
Computes hybrid centrality of each node in a network
Usage
hybrid(A, BC = c("standard", "random", "average"), beta)
Arguments
A An adjacency matrix of network data
BC How should the betweenness centrality be computed? Defaults to "standard".Set to "random" for rspbc. Set to "average" for the average of "standard" and"random"
beta Beta parameter to be passed to the rspbc function
32 impact
Value
A vector of hybrid centrality values for each node in the network (higher values are more central,lower values are more peripheral)
Author(s)
Alexander Christensen <[email protected]>
References
Pozzi, F., Di Matteo, T., & Aste, T. (2013). Spread of risk across financial markets: Better to investin the peripheries. Scientific Reports, 3(1655), 1-7.
Examples
A<-TMFG(neoOpen)$A
HC<-hybrid(A)
impact Node Impact
Description
Computes impact measure or how much the average distance in the network changes with that noderemoved of each node in a network (Please see and cite Kenett et al., 2011. See also impact for aseparate but related measure)
Usage
impact(A, progBar = TRUE)
Arguments
A An adjacency matrix of network data
progBar Defaults to FALSE. Set to TRUE to see progress bar
Value
A vector of node impact values for each node in the network (impact > 0, greater ASPL when nodeis removed; impact < 0, lower ASPL when node is removed)
Author(s)
Alexander Christensen <[email protected]>
is.graphical 33
References
Kenett, Y. N., Kenett, D. Y., Ben-Jacob, E., & Faust, M. (2011). Global and local features ofsemantic networks: Evidence from the Hebrew mental lexicon. PloS one, 6(8), e23912.
Examples
A<-TMFG(neoOpen)$A
nodeimpact<-impact(A)
is.graphical Determines if Network is Graphical
Description
Tests for whether the network is graphical. Input must be a partial correlation network. Functionassumes that partial correlations were computed from a multivariate normal distribution
Usage
is.graphical(A)
Arguments
A A partial correlation network (adjacency matrix)
Value
Returns a TRUE/FALSE for whether network is graphical
Author(s)
Alexander Christensen <[email protected]>
Examples
A <- LoGo(neoOpen, normal = TRUE, partial = TRUE)
is.graphical(A)
34 kld
kld Kullback-Leibler Divergence
Description
Estimates the Kullback-Leibler Divergence which measures how one probability distribution di-verges from the original distribution (equivalent means are assumed) Matrices must be positivedefinite inverse covariance matrix for accurate measurement. This is not a quantitative metric
Usage
kld(base, test)
Arguments
base Full or base model
test Reduced or testing model
Value
A value greater than 0. Smaller values suggest the probablity distribution of the reduced model isnear the full model
Author(s)
Alexander Christensen <[email protected]>
References
Kullback, S., & Leibler, R. A. (1951). On information and sufficiency. The Annals of MathematicalStatistics, 22(1), 79-86.
Examples
A1 <- solve(cov(neoOpen))
A2 <- LoGo(neoOpen)
kld_value <- kld(A1, A2)
lattnet 35
lattnet Generates a Lattice Network
Description
Generates a lattice network
Usage
lattnet(nodes, edges)
Arguments
nodes Number of nodes in lattice network
edges Number of edges in lattice network
Value
Returns an adjacency matrix of a lattice network
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
latt <- lattnet(10,27)
leverage Leverage Centrality
Description
Computes leverage centrlaity of each node in a network (the degree of connected neighbors) (Pleasesee and cite Joyce et al., 2010)
Usage
leverage(A, weighted = TRUE)
36 LoGo
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to TRUE. Set to FALSE for unweightedmeasure of leverage centrality
Value
A vector of leverage centrality values for each node in the network
Author(s)
Alexander Christensen <[email protected]>
References
Joyce, K. E., Laurienti, P. J., Burdette, J. H., & Hayasaka, S. (2010). A new measure of centralityfor brain networks. PLoS One, 5(8), e12200.
Examples
A<-TMFG(neoOpen)$A
weighted_lev<-leverage(A)
unweighted_lev<-leverage(A, weighted=FALSE)
LoGo Local/Global Sparse Inverse Covariance Matrix
Description
Applies the Local/Global method to estimate the sparse inverse covariance matrix using a TMFG-filtered network (see and cite Barfuss et al., 2016)
Usage
LoGo(data, cliques, separators, partial = FALSE, normal = FALSE,standardize = FALSE, na.data = c("pairwise", "listwise", "fiml", "none"))
Arguments
data Must be a dataset
cliques Cliques defined in the network. Input can be a list or matrix
separators Separators defined in the network. Input can be a list or matrix
partial Should the output network’s connections be the partial correlation between twonodes given all other nodes? Defaults to FALSE, which returns a sparse inversecovariance matrix. Set to TRUE for a partial correlation matrix
louvain 37
normal Should data be transformed to a normal distribution? Defaults to FALSE. Datais not transformed to be normal. Set to TRUE if data should be transformed tobe normal (computes correlations using the cor_auto function)
standardize Should inverse covariance matrix be standardized? Defaults to FALSE. Set toTRUE for inverse correlation matrix
na.data How should missing data be handled? For "listwise" deletion the na.omit func-tion is applied. Set to "fiml" for Full Information Maxmimum Likelihood (cor-Fiml). Full Information Maxmimum Likelihood is recommended but time con-suming
Value
Returns the sparse LoGo-filtered inverse covariance matrix (partial = FALSE) or LoGo-filteredpartial correlation matrix (partial = TRUE)
Author(s)
Alexander Christensen <[email protected]>
References
Barfuss, W., Massara, G. P., Di Matteo, T., & Aste, T. (2016). Parsimonious modeling with infor-mation filtering networks. Physical Review E, 94(6), 062306.
Examples
LoGonet<-LoGo(neoOpen, partial = TRUE)
louvain Louvain Community Detection Algorithm
Description
Computes a vector of communities (community) and a global modularity measure (Q)
Usage
louvain(A, gamma, M0)
Arguments
A An adjacency matrix of network data
gamma Defaults to 1. Set to gamma > 1 to detect smaller modules and gamma < 1 forlarger modules
M0 Input can be an initial community vector. Defaults to none
38 MaST
Value
Returns a list of community and Q
Author(s)
Alexander Christensen <[email protected]>
References
Blondel, V. D., Guillaume, J. L., Lambiotte, R., & Lefebvre, E. (2008). Fast unfolding of com-munities in large networks. Journal of Statistical Mechanics: Theory and Experiment, 2008(10),P10008.
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
A<-TMFG(neoOpen)$A
modularity<-louvain(A)
MaST Maximum Spanning Tree
Description
Applies the Maximum Spanning Tree (MaST) filtering method
Usage
MaST(data, normal = FALSE, weighted = TRUE, depend = FALSE,na.data = c("pairwise", "listwise", "fiml", "none"))
Arguments
data Can be a dataset or a correlation matrixnormal Should data be transformed to a normal distribution? Defaults to FALSE. Data
is not transformed to be normal. Set to TRUE if data should be transformed tobe normal (computes correlations using the cor_auto function)
weighted Should network be weighted? Defaults to TRUE. Set to FALSE to produce anunweighted (binary) network
depend Is network a dependency (or directed) network? Defaults to FALSE. Set TRUEto generate a MaST-filtered dependency network (output obtained from the dependfunction)
na.data How should missing data be handled? For "listwise" deletion the na.omit func-tion is applied. Set to "fiml" for Full Information Maxmimum Likelihood (cor-Fiml). Full Information Maxmimum Likelihood is recommended but time con-suming
nams 39
Value
A sparse association matrix
Author(s)
Alexander Christensen <[email protected]>
References
Adapted from: https://www.mathworks.com/matlabcentral/fileexchange/23276-maximum-weight-spanning-tree--undirected
Examples
weighted_MaSTnetwork<-MaST(neoOpen)
unweighted_MaSTnetwork<-MaST(neoOpen,weighted=FALSE)
nams Network Adjusted Mean/Sum
Description
The hybrid centrality is used to adjust the mean or sum score of participant’s factor scores basedon each node’s centrality. Each participant’s response values are multipled by the correspondinghybrid centrality value (uses "random" for BC argument). In this way, more central nodes contributea greater score and less central nodes contribute a lesser score
Usage
nams(data, A, normal = FALSE, standardize = TRUE, adjusted = c("mean","sum"), factors = c("walktrap", "louvain"), method = c("TMFG", "LoGo","EBICglasso", "IsingFit", "threshold"), na.data = c("pairwise", "listwise","fiml", "none"), ...)
Arguments
data Must be a dataset
A Adjacency matrix that has already been filtered
normal Should data be transformed to a normal distribution? Defaults to FALSE. Datais not transformed to be normal. Set to TRUE if data should be transformed tobe normal (computes correlations using the cor_auto function)
standardize Should mean/sum scores be standardized? Defaults to TRUE. Set to FALSE forunstandardized mean/sum scores
adjusted Should adjusted values be the mean or sum score? Defaults to "mean". Set to"sum" for sum scores
40 neoOpen
factors Can be a vector of factor assignments or community detection algorithms ("walk-trap" or "louvain") can be used to determine the number of factors. Defaults to 1factor. Set to "walktrap" for the walktrap algortihm. Set to "louvain" for louvaincommunity detection
method A network filtering method. Defaults to "TMFG". The "threshold" option is setto the default arguments (thresh = "alpha", a = .05). To use additional argumentsfor "threshold", apply threshold function with desired arguments and input intoargument A
na.data How should missing data be handled? For "listwise" deletion the na.omit func-tion is applied. Set to "fiml" for Full Information Maxmimum Likelihood (cor-Fiml). Full Information Maxmimum Likelihood is recommended but time con-suming
... Additional arguments for community detection algorithms
Value
Returns a list of the network adjusted score (NetAdjScore) and the items associated with the speci-fied or identified factors (FactorItems)
Author(s)
Alexander Christensen <[email protected]>
Examples
sumadj <- nams(neoOpen, adjusted = "sum")
knownfactors <- nams(neoOpen,factors = c(rep(1,8),rep(2,8),rep(3,8),rep(4,8),rep(5,8),rep(6,8)))
walkadj <- nams(neoOpen, method="threshold", factors = "walktrap")
neoOpen NEO-PI-3 Openness to Experience Data
Description
A response matrix (n = 802) of NEO-PI-3’s Openness to Experience from Christensen, Cotter, &Silvia (in press).
Usage
data(neoOpen)
neuralcorrtest 41
Format
A 802x48 response matrix
References
Christensen, A.P., Cotter, K.N., & Silvia, P.J. (in press). Reopening Openness to Experience: Anetwork analysis of four Openness to Experience inventories. Journal of Personality Assessment,doi: 10.1080/00223891.2018.1467428 http://doi.org/10.17605/OSF.IO/954A7
Examples
data("neoOpen")
neuralcorrtest Neural-Behavioral Correlation Test
Description
Correlational test for global or local network characteristics of neural network data with behavioraldata (still in testing phase)
Usage
neuralcorrtest(bstat, nstat)
Arguments
bstat Behavioral statistic for each participant with neural data
nstat A statistic vector (whole-network) or matrix (ROI) from the neuralstat function
Value
Returns correlation test statistics for given statistics
Author(s)
Alexander Christensen <[email protected]>
Examples
## Not run:neuralarray <- convertConnBrainMat()
filteredneuralarray <- neuralnetfilter(neuralarray, method = "threshold", thres = .50)
AverageShortestPathLength <- neuralstat(filteredneuralarray, statistic = "ASPL")
Degree <- neuralstat(filteredneuralarray, statistic = "deg")
42 neuralgrouptest
bstat <- iq
WholeNetwork_corr <- neuralcorrtest(bstat, AverageShortestPathLength)
ROI_corr <- neuralcorrtest(bstat, Degree)
## End(Not run)
neuralgrouptest Neural Network Group Statistics Tests
Description
Statistical test for group differences for global or local network characteristics of neural networkdata (still in testing phase)
Usage
neuralgrouptest(groups, nstat, correction = c("bonferroni", "FDR"))
Arguments
groups Participant vector of desired groups (see examples)
nstat A statistic vector (whole-network) or matrix (ROI) from the neuralstat func-tion
correction Multiple comparisons correction for ROI testing. Defaults to local false discov-ery rate (i.e., "FDR")
Value
Returns test statistics for given groups and statistics
Author(s)
Alexander Christensen <[email protected]>
Examples
## Not run:neuralarray <- convertConnBrainMat()
filteredneuralarray <- neuralnetfilter(neuralarray, method = "threshold", thres = .50)
AverageShortestPathLength <- neuralstat(filteredneuralarray, statistic = "ASPL")
Degree <- neuralstat(filteredneuralarray, statistic = "deg")
groups <- c(rep(1,30),rep(2,30))
neuralnetfilter 43
WholeNetwork_t-test <- neuralstattest(groups, AverageShortestPathLength)
ROI_t-test <- neuralstattest(groups, Degree)
## End(Not run)
neuralnetfilter Neural Network Filter
Description
Applies a network filtering methodology to neural network array. Removes edges from the neuralnetwork output from convertConnBrainMat using a network filtering approach
Usage
neuralnetfilter(neuralarray, method = c("TMFG", "MaST", "ECOplusMaST", "ECO","threshold"), progBar = TRUE, ...)
Arguments
neuralarray Array from convertConnBrainMat function
method Filtering method to be applied
progBar Should progress bar be displayed? Defaults to TRUE. Set FALSE for no progressbar
... Additional arguments from filtering methods
Value
Returns an array of n x n x m filtered matrices
Author(s)
Alexander Christensen <[email protected]>
References
Fallani, F. D. V., Latora, V., & Chavez, M. (2017). A topological criterion for filtering informationin complex brain networks. PLoS Computational Biology, 13(1), e1005305.
Massara, G. P., Di Matteo, T., & Aste, T. (2016). Network filtering for big data: Triangulatedmaximally filtered graph. Journal of Complex Networks, 5(2), 161-178.
44 neuralstat
Examples
## Not run: neuralarray <- convertConnBrainMat()
filteredneuralarray <- neuralnetfilter(neuralarray, method = "threshold", thresh = .50)
dependencyarray <- depna(neuralarray)
filtereddependencyarray <- neuralnetfilter(dependencyarray, method = "TMFG", depend = TRUE)
## End(Not run)
neuralstat Local and Global Neural Network Characteristics
Description
Obtains a global or local network characteristic from neural network data
Usage
neuralstat(filarray, statistic = c("CC", "ASPL", "Q", "S", "transitivity","conn", "BC", "LC", "deg", "inDeg", "outDeg", "degRI", "str", "inStr","outStr", "strRI", "comm", "EC", "lev", "rspbc", "hybrid", "impact"),progBar = TRUE, ...)
Arguments
filarray Filtered array from neuralnetfilter function
statistic A statistic to compute
progBar Should progress bar be displayed? Defaults to TRUE. Set FALSE for no progressbar
... Additional arguments for statistics functions
Value
Returns vector of global characteristics (rows = participants, columns = statistic) or a matrix of localcharacteristics (rows = ROIs, columns = participants)
Author(s)
Alexander Christensen <[email protected]>
neuralstat 45
References
Blondel, V. D., Guillaume, J. L., Lambiotte, R., & Lefebvre, E. (2008). Fast unfolding of com-munities in large networks. Journal of Statistical Mechanics: Theory and Experiment, 2008(10),P10008.
Joyce, K. E., Laurienti, P. J., Burdette, J. H., & Hayasaka, S. (2010). A new measure of centralityfor brain networks. PLoS One, 5(8), e12200.
Kenett, Y. N., Kenett, D. Y., Ben-Jacob, E., & Faust, M. (2011). Global and local features ofsemantic networks: Evidence from the Hebrew mental lexicon. PloS one, 6(8), e23912.
Kivimaki, I., Lebichot, B., Saramaki, J., & Saerens, M. (2016). Two betweenness centrality mea-sures based on Randomized Shortest Paths. Scientific Reports, 6(19668), 1-15.
Pozzi, F., Di Matteo, T., & Aste, T. (2013). Spread of risk across financial markets: Better to investin the peripheries. Scientific Reports, 3(1655), 1-7.
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
## Not run:neuralarray <- convertConnBrainMat()
filteredneuralarray <- neuralnetfilter(neuralarray, method = "threshold", thres = .50)
ClusteringCoefficient <- neuralstat(filteredneuralarray, statistic = "CC")
AverageShortestPathLength <- neuralstat(filteredneuralarray, statistic = "ASPL")
Modularity <- neuralstat(filteredneuralarray, statistic = "Q")
Smallworldness <- neuralstat(filteredneuralarray, statistic = "S")
Trasitivity <- neuralstat(filteredneuralarray, statistic = "transitivity")
Connectivity <- neuralstat(filteredneuralarray, statistic = "conn")
BetweennessCentrality <- neuralstat(filteredneuralarray, statistic = "BC")
ClosenessCentrality <- neuralstat(filteredneuralarray, statistic = "LC")
Degree <- neuralstat(filteredneuralarray, statistic = "deg")
NodeStrength <- neuralstat(filteredneuralarray, statistic = "str")
Communities <- neuralstat(filteredneuralarray, statistic = "comm")
EigenvectorCentrality <- neuralstat(filteredneuralarray, statistic = "EC")
LeverageCentrality <- neuralstat(filteredneuralarray, statistic = "lev")
RandomShortestPathBC <- neuralstat(filteredneuralarray, statistic = "rspbc")
46 participation
HybridCentrality <- neuralstat(filteredneuralarray, statistic = "hybrid")
NodeImpact <- neuralstat(filteredneuralarray, statistic = "impact")
## End(Not run)
participation Participation Coefficient
Description
Computes the participation coefficient for each node. The participation coefficient measures thestrength of a node’s connections within its community. Positive and negative signed weights forparticipation coefficients are computed separately.
Usage
participation(A, factors = c("walktrap", "louvain"))
Arguments
A Network adjacency matrix
factors A vector of corresponding to each item’s factor. Defaults to "walktrap" for thewalktrap community detection algorithm. Set to "louvain" for the louvain com-munity detection algorithm. Can also be set to user-specified factors (see exam-ples)
Value
Returns a list of overall (signs not considered; overall), negative (negative), and positive (positive)participation coefficient. Values closer to 1 suggest greater within-community connectivity andvalues closer to 0 suggest greater between-community connectivity
Author(s)
Alexander Christensen <[email protected]>
References
Guimera, R., & Amaral, L. A. N. (2005). Functional cartography of complex metabolic networks.Nature, 433(7028), 895-900.
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
pathlengths 47
Examples
#theoretical factorsfactors <- c(rep(1,8), rep(2,8), rep(3,8), rep(4,8), rep(5,8), rep(6,8))
A <- TMFG(neoOpen)$A
pc <- participation(A, factors = factors)
#walktrap factorswpc <- participation(A, factors = "walktrap")
pathlengths Characteristic Path Lengths
Description
Computes global average shortest path length (ASPL), local average shortest path length (ASPLi),eccentricity (ecc), and diameter (D) of a network
Usage
pathlengths(A, weighted = FALSE)
Arguments
A An adjacency matrix of network dataweighted Is the network weighted? Defaults to FALSE. Set to TRUE for weighted mea-
sures of ASPL, ASPLi, ecc, and D
Value
Returns a list of ASPL, ASPLi, ecc, and D of a network
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
A<-TMFG(neoOpen)$A
unweighted_PL<-pathlengths(A)
weighted_PL<-pathlengths(A, weighted=TRUE)
48 reg
randnet Generates a Random Network
Description
Generates a random network
Usage
randnet(nodes, edges)
Arguments
nodes Number of nodes in random network
edges Number of edges in random network
Value
Returns an adjacency matrix of a random network
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
rand <- randnet(10,27)
reg Regression Matrix
Description
Computes regression such that one variable is regressed over all other variables
Usage
reg(data, family = c("binomial", "gaussian", "Gamma", "poisson"),symmetric = TRUE)
rmse 49
Arguments
data A dataset
family Error distribution to be used in the regression model. Defaults to "logistic". Setto any family used in function family
symmetric Should matrix be symmetric? Defaults to TRUE, taking the mean of the twoedge weights (i.e., [i,j] and [j,i]) Set to FALSE for asymmwtric weights (i.e.,[i,j] does not equal [j,i])
Value
A matrix of fully regressed coefficients where one variable is regressed over all others
Author(s)
Alexander Christensen <[email protected]>
Examples
#binarize responsespsyb <- ifelse(neoOpen>=4, 1, 0)
#perform logistic regressionmat <- reg(psyb)
rmse Root Mean Square Error
Description
Computes the root mean square error of a sparse model to a full model
Usage
rmse(base, test)
Arguments
base Base (or full) model to be evaulated against
test Reduced (or testing) model (e.g., a sparse correlation or covariance matrix)
Value
RMSE value. Lower values suggest more similarity between the full and sparse model
Author(s)
Alexander Christensen <[email protected]>
50 rspbc
Examples
A1 <- solve(cov(neoOpen))
A2 <- LoGo(neoOpen)
root <- rmse(A1, A2)
rspbc Randomized Shortest Paths Betweenness Centrality
Description
Computes betweenness centrlaity based on randomized shortest paths of each node in a network(Please see and cite Kivimaki et al., 2016)
Usage
rspbc(A, beta = 0.01)
Arguments
A An adjacency matrix of network data
beta Sets the beta parameter. Defaults to 0.01 (recommended). Beta > 0.01 measuregets closer to weighted betweenness centrality (10) and beta < 0.01 measure getscloser to degree (.0001)
Value
A vector of randomized shortest paths betweenness centrality values for each node in the network
Author(s)
Alexander Christensen <[email protected]>
References
Kivimaki, I., Lebichot, B., Saramaki, J., & Saerens, M. (2016). Two betweenness centrality mea-sures based on Randomized Shortest Paths. Scientific Reports, 6(19668), 1-15.
Examples
A<-TMFG(neoOpen)$A
rspbc<-rspbc(A, beta=0.01)
semnetboot 51
semnetboot Partial Bootstrapped Semantic Network Analysis
Description
Bootstraps (without replacement) the nodes in the network and computes global network character-istics
Usage
semnetboot(data, method = c("TMFG", "LoGo", "MaST", "threshold"),normal = FALSE, nodes, iter = 1000, na.data = c("pairwise", "listwise","fiml", "none"), ...)
Arguments
data A set of data
method A network filtering method. Defaults to "TMFG"
normal Should data be transformed to a normal distribution? Defaults to FALSE. Datais not transformed to be normal. Set to TRUE if data should be transformed tobe normal (computes correlations using the cor_auto function)
nodes Number of nodes (i.e., variables) to use in the bootstrap. Defaults to 50 Other-wise accepts the number of the nodes to be included
iter Number of bootstrap iterations. Defaults to 1000 iterations
na.data How should missing data be handled? For "listwise" deletion the na.omit func-tion is applied. Set to "fiml" for Full Information Maxmimum Likelihood (cor-Fiml). Full Information Maxmimum Likelihood is recommended but time con-suming
... Additional arguments for filtering methods
Value
Returns a list that includes the original semantic network measures (origmeas; ASPL, CC, Q, S),and the bootstrapped semantic network measures (bootmeas)
References
Kenett, Y. N., Wechsler-Kashi, D., Kenett, D. Y., Schwartz, R. G., Ben Jacob, E., & Faust, M.(2013). Semantic organization in children with cochlear implants: Computational analysis of verbalfluency. Frontiers in Psychology, 4(543), 1-11.
52 semnetmeas
Examples
## Not run:lowO <- subset(animals, Group==1)[-1]
semTMFG<-semnetboot(lowO)
semLoGo<-semnetboot(lowO,method="LoGo")
semMaST<-semnetboot(lowO,method="MaST")
semThreshold<-semnetboot(lowO,method="threshold")
## End(Not run)
semnetmeas Semantic Network Measures
Description
Computes the average shortest path length (ASPL), clustering coefficient(CC), modularity (Q), andsmall-worldness (S; defaults to "rand")
Usage
semnetmeas(A, iter)
Arguments
A An adjacency matrix of network A
iter Number of iterations for the small-worldness measure
Value
Returns a values for ASPL, CC, Q, and S
Author(s)
Alexander Christensen <[email protected]>
Examples
## Not run:lowO <- subset(animals, Group==1)[-1]
A<-TMFG(lowO)
globmeas<-semnetmeas(A)
## End(Not run)
sim.swn 53
sim.swn Simulate Small-world Network
Description
Simulates a small-world network based on specified topological properties. Data will also be simu-lated based on the true network structure
Usage
sim.swn(nodes, n, pos = 0.8, ran = c(0.3, 0.7), nei = 1, p = 0.5,corr = FALSE, replace = NULL, ordinal = FALSE, ordLevels = NULL)
Arguments
nodes Number of nodes in the simulated network
n Number of cases in the simulated dataset
pos Proportion of positive correlations in the simulated network
ran Range of correlations in the simulated network
nei Adjusts the number of connections each node has to neighboring nodes (seesample_smallworld)
p Adjusts the rewiring probability (default is .5). p > .5 rewires the simulatednetwork closer to a random network. p < .5 rewires the simulated network closerto a lattice network
corr Should the simualted network be a correlation network? Defaults to FALSE. Setto TRUE for a simulated correlation network
replace If noise > 0, then should participants be sampled with replacement? Defaults toTRUE. Set to FALSE to not allow the potential for participants to be consecu-tively entered into the simulated dataset.
ordinal Should simulated continuous data be converted to ordinal? Defaults to FALSE.Set to TRUE for simulated ordinal data
ordLevels If ordinal = TRUE, then how many levels should be used? Defaults to NULL.Set to desired number of intervals (defaults to 5)
Value
Returns a list that includes the simulated network (simNetwork), simulated data (simData), andsimulated correlation matrix (simRho)
Author(s)
Alexander Christensen <[email protected]>
54 smallworldness
References
Csardi, G., & Nepusz, T. (2006). The igraph software package for complex network research.InterJournal, Complex Systems, 1695(5), 1-9.
Examples
sim.norm <- sim.swn(25, 500, nei = 3)
sim.Likert <- sim.swn(25, 500, nei = 3,replace = TRUE, ordinal = TRUE, ordLevels = 5)
smallworldness Small-worldness Measure
Description
Computes the small-worldness measure of a network
Usage
smallworldness(A, iter = 100, progBar = FALSE, method = c("HG", "rand","TJHBL"))
Arguments
A An adjacency matrix of network data
iter Number of random (or lattice) networks to generate, which are used to calculatethe mean random ASPL and CC (or lattice)
progBar Defaults to FALSE. Set to TRUE to see progress bar
method Defaults to "HG" (Humphries & Gurney, 2008). Set to "rand" for the CC to becalculated using a random network or set to "TJHBL" for (Telesford et al., 2011)where CC is calculated from a lattice network
Value
Returns a list with value of small-worldness (swm) and random ASPL (rASPL). For "rand", values> 1 indicate a small-world network (lrCCt = random CC). For "HG", values > 3 indicate a small-world network (lrCCt = random Transitivity). For "TJHBL" values near 0 indicate a small-worldnetwork (lrCCt = lattice CC), while < 0 indicates a more regular network and > 0 indicates a morerandom network
Author(s)
Alexander Christensen <[email protected]>
splitsamp 55
References
Humphries, M. D., & Gurney, K. (2008). Network ’small-world-ness’: A quantitative method fordetermining canonical network equivalence. PloS one, 3(4), e0002051.
Telesford, Q. K., Joyce, K. E., Hayasaka, S., Burdette, J. H., & Laurienti, P. J. (2011). The ubiquityof small-world networks. Brain Connectivity, 1(5), 367-375.
Examples
A<-TMFG(neoOpen)$A
swmHG <- smallworldness(A, method="HG")
swmRand <- smallworldness(A, method="rand")
swmTJHBL <- smallworldness(A, method="TJHBL")
splitsamp Split sample
Description
Randomly splits sample into equally divded sub-samples
Usage
splitsamp(data, samples = 10, splits = 2)
Arguments
data Must be a dataset
samples Number of samples to produce (Defaults to 10)
splits Number to divide the sample by (Defaults to 2; i.e., split-half)
Value
A list containing the training (trainSample) and testing (testSample) sizes (training sample is madeto have slightly larger sizes in the case of uneven splits), and their respective sample sizes (trainSizeand testSize)
Author(s)
Alexander Christensen <[email protected]>
Examples
splithalf<-splitsamp(neoOpen)
56 splitsampNet
splitsampNet Network Construction for splitsamp
Description
Applies a network construction method to samples generated from the splitsamp function
Usage
splitsampNet(object, method = c("MaST", "TMFG", "LoGo", "threshold"),bootmat = FALSE, pB = TRUE, ...)
Arguments
object Object output from splitsamp function
method A network filtering method. Defaults to "TMFG"
bootmat Should bootgen function be used? Defaults to FALSE. Set to TRUE to constuc-tion bootgen networks
pB Should progress bar be displayed? Defaults to TRUE. Set to FALSE for noprogress bar
... Additional arguments to be passed to the network construction methods
Value
Returns a list of networks for training (train) and testing (test) samples
Author(s)
Alexander Christensen <[email protected]>
Examples
samples <- splitsamp(neoOpen)
nets <- splitsampNet(samples, method="TMFG")
splitsampStats 57
splitsampStats Statistics for splitsamp Networks
Description
Applies a network statistics to the networks generated from the splitsampNet function
Usage
splitsampStats(object, stats = c("edges", "centralities"),edges = c("lower", "upper"), BC = c("standard", "random"))
Arguments
object Object output from splitsampNet function
stats Which stats should be computed? "edges" will compute statistics for the edgerepfunction. "centralities" will compute betweenness, closeness, and strength. Bothoptions are allowed
edges If stats = "edges, should the lower or upper replication percentage be used?Defaults to "lower".
BC How should the betweenness centrality be computed? Defaults to "standard"betweenness centrlaity. Set to "random" for rspbc
Value
Returns a list of statistics for edges (Edges), centralities (Centralities), or both
Author(s)
Alexander Christensen <[email protected]>
Examples
samples <- splitsamp(neoOpen)
nets <- splitsampNet(samples, method="TMFG")
stats <- splitsampStats(nets, stats = "edges", edges = "lower")
58 stable
stable Stabilizing Nodes
Description
Computes the within-community centrality for each node in the network
Usage
stable(A, factors = c("walktrap", "louvain"), cent = c("betweenness","rspbc", "strength", "degree", "hybrid"), ...)
Arguments
A An adjacency matrix of network data
factors Can be a vector of factor assignments or community detection algorithms ("walk-trap" or "louvain") can be used to determine the number of factors. Defaults to"walktrap". Set to "louvain" for louvain community detection
cent Centrality measure to be used. Defaults to "strength".
... Additional arguments for community detection algorithms
Value
A matrix containing the within-community centrality value for each node
Author(s)
Alexander Christensen <[email protected]>
References
Blanken, T. F., Deserno, M. K., Dalege, J., Borsboom, D., Blanken, P., Kerkhof, G. A., & Cramer,A. O. (2018). The role of stabilizing and communicating symptoms given overlapping communitiesin psychopathology networks. Scientific Reports, 8(1), 5854.
Examples
A<-TMFG(neoOpen)$A
stabilizing <- stable(A, factors = "walktrap")
strength 59
strength Node Strength
Description
Computes strength of each node in a network
Usage
strength(A)
Arguments
A An adjacency matrix of network data
Value
A vector of strength values for each node in the network. If directed network, returns a list ofin-strength (inStrength), out-strength (outStrength), and relative influence (relInf)
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Examples
A<-TMFG(neoOpen)$A
str<-strength(A)
threshold Threshold Filter
Description
Filters the network based on an r-value, alpha, adaptive alpha (see Perez & Pericchi, 2014), bonfer-roni, false-discovery rate (FDR, fdrtool package), or proportional density (fixed number of edges)value
60 threshold
Usage
threshold(data, a, thresh = c("alpha", "adaptive", "bonferroni", "FDR","proportional"), n = nrow(data), normal = FALSE, na.data = c("pairwise","listwise", "fiml", "none"))
Arguments
data Can be a dataset or a correlation matrix
a When thresh = "alpha", "adaptive", and "bonferroni" an alpha threshold is ap-plied (defaults to .05). For "adaptive", beta (Type II error) is set to a*5 for amedium effect size (r = .3). When thresh = "FDR", a q-value threshold is ap-plied (defaults to .10). When thresh = "proportional", a density threshold isapplied (defaults to .15)
thresh Sets threshold. Defaults to "alpha". Set to any value 0> r >1 to retain valuesgreater than set value, "adaptive" for an adapative alpha based on sample size(Perez & Pericchi, 2014), "bonferroni" for the bonferroni correction on alpha,"FDR" for local false discovery rate, and "proportional" for a fixed density ofedges (keeps strongest correlations within density)
n Number of participants in sample. Defaults to the number of rows in the data. Ifinput is a correlation matrix, then n must be set
normal Should data be transformed to a normal distribution? Defaults to FALSE. Datais not transformed to be normal. Set to TRUE if data should be transformed tobe normal (computes correlations using the cor_auto function)
na.data How should missing data be handled? For "listwise" deletion the na.omit func-tion is applied. Set to "fiml" for Full Information Maxmimum Likelihood (cor-Fiml). Full Information Maxmimum Likelihood is recommended but time con-suming
Value
Returns a list containing a filtered adjacency matrix (A) and the critical r value (r.cv)
Author(s)
Alexander Christensen <[email protected]>
References
Perez, M. E., & Pericchi, L. R. (2014). Changing statistical significance with the amount of infor-mation: The adaptive a significance level. Statistics & Probability Letters, 85, 20-24.
Strimmer, K. (2008). fdrtool: A versatile R package for estimating local and tail area-based falsediscovery rates. Bioinformatics, 24(12), 1461-1462.
TMFG 61
Examples
threshnet<-threshold(neoOpen)
alphanet<-threshold(neoOpen, thresh = "alpha", a = .05)
bonnet<-threshold(neoOpen, thresh = "bonferroni", a = .05)
FDRnet<-threshold(neoOpen, thresh = "FDR", a = .10)
propnet<-threshold(neoOpen, thresh = "proportional", a = .15)
TMFG Triangulated Maximally Filtered Graph
Description
Applies the Triangulated Maximally Filtered Graph (TMFG) filtering method (Please see and citeMassara et al., 2016)
Usage
TMFG(data, normal = FALSE, weighted = TRUE, depend = FALSE,na.data = c("pairwise", "listwise", "fiml", "none"))
Arguments
data Can be a dataset or a correlation matrix
normal Should data be transformed to a normal distribution? Input must be a dataset.Defaults to FALSE. Data is not transformed to be normal. Set to TRUE if datashould be transformed to be normal (computes correlations using the cor_autofunction)
weighted Should network be weighted? Defaults to TRUE. Set to FALSE to produce anunweighted (binary) network
depend Is network a dependency (or directed) network? Defaults to FALSE. Set toTRUE to generate a TMFG-filtered dependency network (output obtained fromthe depend function)
na.data How should missing data be handled? For "listwise" deletion the na.omit func-tion is applied. Set to "fiml" for Full Information Maxmimum Likelihood (cor-Fiml). Full Information Maxmimum Likelihood is recommended but time con-suming
Value
Returns a list of the adjacency matrix (A), separators (separators), and cliques (cliques)
62 transitivity
Author(s)
Alexander Christensen <[email protected]>
References
Christensen, A. P., Kenett, Y. N., Aste, T., Silvia, P. J., & Kwapil, T. R. (2018). Network struc-ture of the Wisconsin Schizotypy Scales-Short Forms: Examining psychometric network filteringapproaches. Behavior Research Methods, 1-20, doi:10.3758/s13428-018-1032-9
Massara, G. P., Di Matteo, T., & Aste, T. (2016). Network filtering for big data: Triangulatedmaximally filtered graph. Journal of Complex Networks, 5(2), 161-178.
Examples
weighted_TMFGnetwork<-TMFG(neoOpen)
unweighted_TMFGnetwork<-TMFG(neoOpen,weighted=FALSE)
transitivity Transitivity
Description
Computes transitivity of a network
Usage
transitivity(A, weighted = FALSE)
Arguments
A An adjacency matrix of network data
weighted Is the network weighted? Defaults to FALSE. Set to TRUE for a weighted mea-sure of transitivity
Value
Returns a value of transitivity
Author(s)
Alexander Christensen <[email protected]>
References
Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses andinterpretations. Neuroimage, 52(3), 1059-1069.
Index
∗Topic datasetsanimals, 4behavOpen, 4neoOpen, 40
animals, 4
behavOpen, 4betweenness, 5binarize, 6bootgen, 7, 56bootgenPlot, 8
centlist, 9closeness, 10clustcoeff, 11comcat, 12commboot, 13conn, 14convert2igraph, 15convertConnBrainMat, 15, 16, 18–21, 24, 43cor2cov, 17cor_auto, 7, 23, 37–39, 51, 60, 61corFiml, 7, 13, 23, 37, 38, 40, 51, 60, 61cpmEV, 17cpmFP, 18cpmFPperm, 19cpmIV, 20
degree, 22depend, 22, 24, 38, 61depna, 24distance, 25diversity, 26
EBICglasso, 13ECO, 27ECOplusMaST, 28edgerep, 28, 57eigenvector, 29
family, 49
gateway, 30
hybrid, 31
igraph, 15impact, 32, 32is.graphical, 33IsingFit, 13
kld, 34
lattnet, 35leverage, 35LoGo, 36louvain, 37
MaST, 38
na.omit, 7, 13, 23, 37, 38, 40, 51, 60, 61nams, 39neoOpen, 40NetworkToolbox
(NetworkToolbox-package), 3NetworkToolbox-package, 3neuralcorrtest, 41neuralgrouptest, 42neuralnetfilter, 43, 44neuralstat, 42, 44
participation, 46pathlengths, 47
randnet, 48reg, 48rmse, 49rspbc, 50, 57
sample_smallworld, 53semnetboot, 51
64