ssi: Spectral Segregation Index for Social Networks

View source: R/ssi.R

ssiR Documentation

Spectral Segregation Index for Social Networks


These functions implement Spectral Segregation Index as proposed by Echenique & Fryer (2006). This index is a node-level measure of segregation in a given network.


ssi(g, vattr)



object of class "igraph" representing a network


character, name of the vertex attribute


For a full description and axiomatization see Echenique & Fryer (2006).

The network g is converted to adjacency matrix and normalized so that all rows sum-up to 1.

The procedure essentially consists of creating a submatrix, say, B of the adjacency matrix, say A. This submatrix B contains only vertices of the given type. It may be viewed as a type-homogeneous subnetwork of A. This subnetwork is further decomposed into connected components. Then, for every component, an eigenvalue decomposition is applied. The value of the index for the component is simply the largest eigenvalue, and the individual-level indices are obtained by distributing it according to the corresponding eigenvector.


Named vector of individual level values of SSI. Names correspond to vertex ids in g.


Echenique, F., & Fryer Jr, R. G. (2007). A measure of segregation based on social interactions. The Quarterly Journal of Economics, 122(2), 441-485.

See Also

Other segregation measures: assort(), coleman(), ei(), freeman(), gamix(), orwg(), smi()


if(requireNamespace("igraph", quietly = TRUE)) {

### artificial EF data
x <- ssi(EF3, "race")

# show it on picture
a <- igraph::V(EF3)$race
# rescale SSI values to use as shades of gray
k <- 1 - scale(x, center=min(x), scale=max(x) - min(x))
plot( EF3, layout=igraph::layout.fruchterman.reingold,
vertex.color= gray(k),"",
vertex.shape=c("circle", "square")[a],
vertex.label.color=gray( (1-k) > .4 )

### For White's kinship data
x <- ssi(WhiteKinship, "gender")

# plot it
a <- match(igraph::V(WhiteKinship)$gender, unique(igraph::V(WhiteKinship)$gender))
k <- 1 - scale(x, center=min(x), scale=max(x) - min(x))
plot( WhiteKinship, layout=igraph::layout.fruchterman.reingold,
main="Node segregation in White's kinship data","",
vertex.color= gray(k),
vertex.shape=c("circle", "csquare")[a],
legend( "topleft", legend=c("Men", "Women"), pch=c(0,1), col=1)

netseg documentation built on July 9, 2023, 6:33 p.m.