Learn R Programming

ergm (version 4.7.1)

nodemix-ergmTerm: Nodal attribute mixing

Description

By default, this term adds one network statistic to the model for each possible pairing of attribute values. The statistic equals the number of edges in the network in which the nodes have that pairing of values. (When multiple attributes are specified, a statistic is added for each combination of attribute values for those attributes.) In other words, this term produces one statistic for every entry in the mixing matrix for the attribute(s). By default, the ordering of the attribute values is lexicographic: alphabetical (for nominal categories) or numerical (for ordered categories).

Usage

# binary: nodemix(attr, base=NULL, b1levels=NULL, b2levels=NULL, levels=NULL, levels2=-1)

# valued: nodemix(attr, base=NULL, b1levels=NULL, b2levels=NULL, levels=NULL, # levels2=-1, form="sum")

Arguments

attr

a vertex attribute specification (see Specifying Vertex attributes and Levels (?nodal_attributes) for details.)

base

deprecated

b1levels, b2levels, levels

control what statistics are included in the model and the order in which they appear. levels applies to unipartite networks; b1levels and b2levels apply to bipartite networks (see Specifying Vertex attributes and Levels (?nodal_attributes) for details)

levels2

similar to the other levels arguments above and applies to all networks. Optionally allows a factor or character matrix to be specified to group certain levels. Level combinations corresponding to NA are excluded. Combinations specified by the same character or level will be grouped together and summarised by the same statistic. If an empty string is specified, the level combinations will be ungrouped. Only the upper triangle needs to be specified for undirected networks. For example, levels2=matrix(c('A', '', NA, 'A'), 2, 2, byrow=TRUE) on an undirected matrix will group homophilous ties while leaving ties between 1 and 2 ungrouped.

form

character how to aggregate tie values in a valued ERGM

See Also

ergmTerm for index of model terms currently visible to the package.

ergm:::.formatTermKeywords("ergmTerm", "nodemix", "subsection")