Learn R Programming

latentnet (version 2.11.0)

latentcov-ergmTerm: Edge covariates for the latent model

Description

This term adds multiple covariates to the model, one for each of (a subset of) the unique values of the attrname attribute (or each combination of the attributes given). Each of these covariates has x[i,i]=1 if attrname(i)==l, where l is that covariate's level, and x[i,j]=0 otherwise. To include all attribute values se base=0 -- because the sum of all such statistics equals twice the number of self-loops and hence a linear dependency would arise in any model also including loops. Thus, the base argument tells which value(s) (numbered in order according to the sort function) should be omitted. The default value, base=1, means that the smallest (i.e., first in sorted order) attribute value is omitted. For example, if the “fruit” factor has levels “orange”, “apple”, “banana”, and “pear”, then to add just two terms, one for “apple” and one for “pear”, then set “banana” and “orange” to the base (remember to sort the values first) by using nodefactor("fruit", base=2:3). For an analogous term for quantitative vertex attributes, see nodecov.attrname is a character string giving the name of a numeric (not categorical) attribute in the network's vertex attribute list. This term adds one covariate to the model, for which x[i,i]=attrname(i) and x[i,j]=0 for i!=j. This term only makes sense if the network has self-loops.

latentcov can be called more than once, to model the effects of multiple covariates. Note that some covariates can be more conveniently specified using the following terms.

Important: This term works in latentnet's ergmm() only. Using it in ergm() will result in an error.

Usage

# binary: latentcov(x, attrname=NULL, mean=0, var=9)

# valued: latentcov(x, attrname=NULL, mean=0, var=9)

Arguments

x

either a matrix of covariates on each pair of vertices, a network, or an edge attribute.

attrname

optional argument to provide the name of the edge attribute.

mean, var

prior mean and variance.

See Also

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

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