Learn R Programming

CDatanet (version 2.2.1)

homophili.data: Converting Data between Directed Network Models and Symmetric Network Models.

Description

homophili.data converts the matrix of explanatory variables between directed network models and symmetric network models.

Usage

homophili.data(data, nvec, to = c("lower", "upper", "symmetric"))

Value

The transformed data.frame.

Arguments

data

A matrix or data.frame of the explanatory variables of the network formation model. This corresponds to the X matrix in homophily.fe or homophily.re.

nvec

A vector of the number of individuals in the networks.

to

Indicates the direction of the conversion. For a matrix of explanatory variables X (n*(n-1) rows), one can select lower triangular entries (to = "lower") or upper triangular entries (to = "upper"). For a triangular X (n*(n-1)/2 rows), one can convert to a full matrix of n*(n-1) rows by using symmetry (to = "symmetric").