Skip to contents

This index was proposed by Krackhardt and Stern (1988) to distinguish between the relative prevalence of between and within-group ties. This measure can be interpreted as homophily at the network level.

Usage

ei_index(A, mixed = TRUE, att = NULL)

Arguments

A

A symmetric matrix object

mixed

Whether the matrix provided is already a mixed matrix or not

att

Categorical attribute of the nodes

Value

Numerical value of the E-I index.

Examples


set.seed(18051889)
n <- 100
A <- matrix(c(rbinom(n, 1, 0.5)),
  ncol = sqrt(n), nrow = sqrt(n), byrow = TRUE
)
rownames(A) <- letters[1:nrow(A)]
colnames(A) <- letters[1:ncol(A)]

att <- rbinom(sqrt(n), 3, 0.5)
ei_index(A, mixed = FALSE, att = att)
#> [1] 0.05263158