Learn R Programming

EpiModel (version 0.95)

get.nodematch.attributes: Get Nodematch Term Proportions

Description

This function outputs a list of values and proportions of static vertex attributes present in the formation formula as nodematch terms.

Usage

get.nodematch.attributes(nw, formation)

Arguments

nw
an object of class network or networkDynamic.
formation
a right-hand sided STERGM formation formula (see epiNet.est).

Details

Incoming nodes in a dynamic network simulation require values for any attributes that are used in the formation formula through nodematch network terms. This function gets the proportional distribution of those attribute values of existing nodes in the network. The distributions may then be fed into set.nodematch.attributes to update the attributes of new nodes.

See Also

set.nodematch.attributes

Examples

Run this code
# Set network with two vertex attributes
nw <- network.initialize(100)
nw <- set.vertex.attribute(nw, "race", value = rep(0:1, each=50))
nw <- set.vertex.attribute(nw, "sex",
                           value = c(rep("M", 10), rep("F", 90)))

# Formation formula uses both attributes
formation <- ~ edges + nodematch("race") + nodematch("sex")

# Get existing proportions of those two terms
get.nodematch.attributes(nw, formation)

Run the code above in your browser using DataLab