vblpcmcovs: create the design matrix for the network analysis

View source: R/covs.R

vblpcmcovsR Documentation

create the design matrix for the network analysis

Description

Add intercept (column of ones) and degree-based covariates (if model is for sociality effects) to a user-supplied (default is NULL) edge covariates matrix of size N^2 rows and C columns where C is the number of covariates. Node covariates may be converted to difference-between-pairs for edges.

Usage

vblpcmcovs(N, model, Y, edgecovs=NULL, sendcovs=NULL, receivecovs=NULL,
                  socialcovs=NULL)

Arguments

N

number of nodes

model

model; may be "plain", "rreceiver", "rsender" or "rsocial". See Details.

Y

adjacency matrix

edgecovs

optional additional covariate / attribute data on the edges

sendcovs

optional additional covariate / attribute data on the nodes for links out

receivecovs

optional additional covariate / attribute data on the nodes for links in

socialcovs

optional additional covariate / attribute data on the nodes for links in and out

Details

Can be used to construct design matrices with edge covariates or node covariates and / or sociality effects. "rreceiver", "rsender" and "rsocial" model random social effects. Node covariates are differenced and treated as edge covariates.

Value

An edge design matrix that is Pe x N^2 and a node design matrix that is Pn x N where Pe is the number of edge covariates and Pn is the number of node covariates.

Author(s)

Michael Salter-Townshend

See Also

vblpcmstart


VBLPCM documentation built on March 31, 2023, 9:21 p.m.