backbone.extract: Extracts a backbone network from a backbone object

View source: R/backbone.extract.R

backbone.extractR Documentation

Extracts a backbone network from a backbone object

Description

backbone.extract returns a binary or signed adjacency matrix containing the backbone that retains only the significant edges.

Usage

backbone.extract(
  bb.object,
  signed = FALSE,
  alpha = 0.05,
  mtc = "none",
  class = bb.object$class,
  narrative = FALSE
)

Arguments

bb.object

backbone: backbone S3 class object.

signed

Boolean: TRUE for a signed backbone, FALSE for a binary backbone (see details)

alpha

Real: significance level of hypothesis test(s)

mtc

string: type of Multiple Test Correction to be applied; can be any method allowed by p.adjust.

class

string: the class of the returned backbone graph, one of c("matrix", "sparseMatrix", "igraph", "edgelist"), converted via tomatrix.

narrative

boolean: TRUE if suggested text & citations should be displayed.

Details

The "backbone" S3 class object is composed of (1) the weighted graph as a matrix, (2) upper-tail p-values as a matrix, (3, if signed = TRUE) lower-tail p-values as a matrix, (4, if present) node attributes as a dataframe, and (5) several properties of the original graph and backbone model

When signed = FALSE, a one-tailed test (is the weight stronger) is performed for each edge with a non-zero weight. It yields a backbone that perserves edges whose weights are significantly stronger than expected in the chosen null model. When signed = TRUE, a two-tailed test (is the weight stronger or weaker) is performed for each every pair of nodes. It yields a backbone that contains positive edges for edges whose weights are significantly stronger, and negative edges for edges whose weights are significantly weaker, than expected in the chosen null model. NOTE: Before v2.0.0, all significance tests were two-tailed and zero-weight edges were evaluated.

Value

backbone graph: Binary or signed backbone graph of class given in parameter class.

Examples

#A binary bipartite network of 30 agents & 75 artifacts; agents form three communities
B <- rbind(cbind(matrix(rbinom(250,1,.8),10),
                 matrix(rbinom(250,1,.2),10),
                 matrix(rbinom(250,1,.2),10)),
           cbind(matrix(rbinom(250,1,.2),10),
                 matrix(rbinom(250,1,.8),10),
                 matrix(rbinom(250,1,.2),10)),
           cbind(matrix(rbinom(250,1,.2),10),
                 matrix(rbinom(250,1,.2),10),
                 matrix(rbinom(250,1,.8),10)))

backbone.object <- fixedrow(B, alpha = NULL)
bb <- backbone.extract(backbone.object, alpha = 0.05)

backbone documentation built on Oct. 19, 2022, 1:09 a.m.