# sdsm: Extract backbone using the Stochastic Degree Sequence Model In backbone: Extracts the Backbone from Graphs

 sdsm R Documentation

## Extract backbone using the Stochastic Degree Sequence Model

### Description

`sdsm` extracts the backbone of a bipartite projection using the Stochastic Degree Sequence Model.

### Usage

```sdsm(
B,
alpha = 0.05,
signed = FALSE,
mtc = "none",
class = "original",
narrative = FALSE,
...
)
```

### Arguments

 `B` An unweighted bipartite graph, as: (1) an incidence matrix in the form of a matrix or sparse `Matrix`; (2) an edgelist in the form of a two-column dataframe; (3) an `igraph` object. `alpha` real: significance level of hypothesis test(s) `signed` boolean: TRUE for a signed backbone, FALSE for a binary backbone (see details) `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("original", "matrix", "Matrix", "igraph", "edgelist"). If "original", the backbone graph returned is of the same class as `B`. `narrative` boolean: TRUE if suggested text & citations should be displayed. `...` optional arguments

### Details

The `sdsm` function compares an edge's observed weight in the projection `B*t(B)` to the distribution of weights expected in a projection obtained from a random bipartite network where both the row vertex degrees and column vertex degrees are approximately fixed at their values in `B`. It uses the Bipartite Configuration Model bicm to compute probabilities for the Poisson binomial distribution.

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

If `alpha` != NULL: Binary or signed backbone graph of class `class`.

If `alpha` == NULL: An S3 backbone object containing (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, from which a backbone can subsequently be extracted using `backbone.extract()`.

### References

package: Neal, Z. P. (2022). backbone: An R Package to Extract Network Backbones. PLOS ONE, 17, e0269137. doi: 10.1371/journal.pone.0269137

sdsm: Neal, Z. P. (2014). The backbone of bipartite projections: Inferring relationships from co-authorship, co-sponsorship, co-attendance, and other co-behaviors. Social Networks, 39, 84-97. doi: 10.1016/j.socnet.2014.06.001

sdsm: Neal, Z. P., Domagalski, R., and Sagan, B. (2021). Comparing Alternatives to the Fixed Degree Sequence Model for Extracting the Backbone of Bipartite Projections. Scientific Reports, 11, 23929. doi: 10.1038/s41598-021-03238-3

### 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)))

P <- B%*%t(B) #An ordinary weighted projection...