NetCompare | R Documentation |
a wrapper of NetworkComparisonTest::NCT
NetCompare(
data1,
data2,
it = 5000,
binary.data = FALSE,
paired = FALSE,
weighted = TRUE,
AND = TRUE,
abs_edge = TRUE,
test.edges = TRUE,
edges = "all",
progressbar = TRUE,
make.positive.definite = TRUE,
p.adjust.methods = "none",
test.centrality = TRUE,
centrality = "all",
nodes = "all",
add.bridge = FALSE,
communities = NULL,
useCommunities = "all",
sig.level = 0.05,
...
)
data1 |
One of two datasets. The dimension of the matrix is nobs x nvars; each row is a vector of observations of the variables. Must be cross-sectional data. Can also be the result of estimateNetwork from the bootnet package. |
data2 |
The other of two datasets. The dimension of the matrix is nobs x nvars; each row is a vector of observations of the variables. Must be cross-sectional data. Can also be the result of estimateNetwork from the bootnet package. |
it |
The number of iterations (permutations). |
binary.data |
Logical. Can be TRUE or FALSE to indicate whether the data is binary or not. If binary.data is FALSE, the data is regarded gaussian. |
paired |
Logical. Can be TRUE of FALSE to indicate whether the samples are dependent or not. If paired is TRUE, relabeling is performed within each pair of observations. If paired is FALSE, relabeling is not restricted to pairs of observations. Note that, currently, dependent data is assumed to entail one group measured twice. |
weighted |
Logical. Can be TRUE of FALSE to indicate whether the networks to be compared should be weighted of not. If not, the estimated networks are dichotomized. Defaults to TRUE. |
AND |
Logical. Can be TRUE of FALSE to indicate whether the AND-rule or the OR-rule should be used to define the edges in the network. Defaults to TRUE. Only necessary for binary data. |
test.edges |
Logical. Can be TRUE of FALSE to indicate whether or not differences in individual edges should be tested. |
edges |
Character or list. When 'all', differences between all individual edges are tested. When provided a list with one or more pairs of indices referring to variables, the provided edges are tested. |
progressbar |
Logical. Should the pbar be plotted in order to see the progress of the estimation procedure? Defaults to TRUE. |
make.positive.definite |
If |
p.adjust.methods |
Character. Can be one of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", or "none". To control (or not) for testing of multiple edges. Defaults to "none". |
add.bridge |
a logical value to calculate the difference of bridge coefficients or not. If the value is TRUE, "bridgeStrength", "bridgeCloseness", "bridgeBetweenness", "bridgeExpectedInfluence" will be added to the results. |
communities |
used for bridge centrality measures. If add.bridge is set TRUE, this should be provided. Note: should only be a numeric vector with the same length of nodes, the number indicates the community that each community belongs to. |
useCommunities |
character vector specifying which communities should be included. Default set to "all". |
sig.level |
significance level of the test, this only affect the output of diff_sig_nw1>nw2 and diff_sig_nw1<nw2. |
... |
other paramaters from |
abs |
Logical. Should global strength consider the absolute value of edge weights, or the raw value (i.e., global expected influence)? |
returns a 'NCT' object that contains the following items:
glstrinv.real:
The difference in global strength between the networks of the observed data sets.
glstrinv.perm:
The difference in global strength between the networks of the permutated data sets.
glstrinv.sep:
The global strength values of the individual networks.
glstrinv.pval:
The p value resulting from the permutation test concerning difference in global strength.
nwinv.real:
The value of the maximum difference in edge weights of the observed networks.
nwinv.perm:
The values of the maximum difference in edge weights of the permuted networks.
nwinv.pval:
The p value resulting from the permutation test concerning the maximum difference in edge weights.
einv.pvals:
p-values (corrected for multiple testing or not according to 'p.adjust.methods') per edge from the permutation test concerning differences in edges weights. Only returned if test.edges = TRUE.
edges.tested:
The pairs of variables between which the edges are called to be tested. Only if test.edges = TRUE.
einv.real:
The value of the difference in edge weight of the observed networks (multiple values if more edges are called to test). Only if test.edges = TRUE.
einv.perm:
The values of the difference in edge weight of the permuted networks. Only if test.edges = TRUE.
diffcen.real:
The values of the difference in centralities of the observed networks. Only if test.centrality = TRUE.
diffcen.perm:
The values of the difference in centralities of the permuted networks. Only if test.centrality = TRUE.
diffcen.pval:
p-values(corrected for multiple testing or not according to 'p.adjust.methods') per node from the permutation test concerning differences in centralities. Only if test.centrality = TRUE.
edge_weight_p
the wide format of einv.pvals, p-values (corrected for multiple testing or not according to 'p.adjust.methods') per edge from the permutation test concerning differences in edges weights. Only returned if test.edges = TRUE.
diff_sig_nw1>nw2:
the value of significant edge weight differences by nw1-nw2, unsignificant edge weights are set as 0.
diff_sig_nw1<nw2:
the value of significant edge weight differences by nw2-nw1, unsignificant edge weights are set as 0.
net1_mask:
a binary matrix that indicates non-zero edges in the EBICglasso network constructed from data1.
net2_mask:
a binary matrix that indicates non-zero edges in the EBICglasso network constructed from data2.
data('mtcars')
NetCompare(mtcars, mtcars^3, it = 100)
NetCompare(mtcars, mtcars^3, it = 100, add.bridge = TRUE, communities = c(rep(1,4),rep(2,4),rep(3,3)), useCommunities = c(1,2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.