mlvsbm_create_network: Create a MLVSBM object from observed data

Description Usage Arguments Value Examples

View source: R/user_function.R

Description

Create a MLVSBM object from observed data

Usage

1
2
3
4
5
6
mlvsbm_create_network(
  X,
  A,
  directed = NULL,
  distribution = list("bernoulli", "bernoulli")
)

Arguments

X

A list of 2 squares binary matrices, the first one being the individual or lower level the second one being the organizational or upper level

A

A matrix the affiliation matrix with individuals in rows and organizations in columns

directed

A list of 2 boolean are the upper and lower level directed or not. Default will check if the matrix are symmetric or not.

distribution

A list for the distribution of X, only "bernoulli" is implemented

Value

An unfitted MLVSBM object corresponding to the multilevel network

Examples

1
2
3
4
5
6
7
8
ind_adj <- matrix(stats::rbinom(n = 10**2, size = 1, prob = .2),
                  nrow = 10, ncol = 10)
org_adj <- matrix(stats::rbinom(n = 10**2, size = 1, prob = .3),
                  nrow = 10, ncol = 10)
affiliation <- diag(1, 10)
my_mlvsbm <- mlvsbm_create_network(X = list(I = ind_adj, O = org_adj),
                                   directed = list(I = FALSE, O = FALSE),
                                   A = affiliation)

Chabert-Liddell/MLVSBM documentation built on Sept. 22, 2020, 3:38 p.m.