What is nodecov in ERGM ?

标签:
杂谈 |
分类: R |
http://s15/middle/4a238ec2ga061e88091ee&690is nodecov in ERGM ?" TITLE="What is nodecov in ERGM ?" />
-
nodecov(attrname)
-
Main effect of a
covariate:
The attrname
argument is a character string giving the name of a numeric (not categorical) attribute in the network's vertex attribute list. This term adds a single network statistic to the model equaling the sum of attrname(i)
and attrname(j)
for all edges (i,j) in the network. For categorical attributes, see nodefactor
. Note that for directed networks,nodecov
equalsnodeicov
plus nodeocov
.
-
nodefactor(attrname, base=1)
-
Factor attribute
effect:
The attrname
argument is a character vector giving one or more names of categorical attributes in the network's vertex attribute list. This term adds multiple network statistics 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 statistics gives the number of times a node with that attribute or those attributes appears in an edge in the network. In particular, for edges whose endpoints both have the same attribute values, this value is counted twice. To include all attribute values is usually not a good idea – though this may be accomplished if desired by setting base=0
– because the sum of all such statistics equals twice the number of edges and hence a linear dependency would arise in any model also including edges
. Thus, thebase
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 usingnodefactor("fruit", base=2:3)
. For an analogous term for quantitative vertex attributes, seenodecov
.
-
nodeicov(attrname)
-
Main effect of a covariate for
in-edges:
The attrname
argument is a character string giving the name of a numeric (not categorical) attribute in the network's vertex attribute list. This term adds a single network statistic to the model equaling the total value of attrname(j)
for all edges (i,j) in the network. This term may only be used with directed networks. For categorical attributes, see nodeifactor
.
-
nodeifactor(attrname, base=1)
-
Factor attribute effect for
in-edges:
The attrname
argument is a character vector giving one or more names of a categorical attribute in the network's vertex attribute list. This term adds multiple network statistics 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 statistics gives the number of times a node with that attribute or those attributes appears as the terminal node of a directed tie. To include all attribute values is usually not a good idea – though this may be accomplished if desired by setting base=0
– because the sum of all such statistics equals the number of edges and hence a linear dependency would arise in any model also including edges
. Thus, thebase
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 usingnodefactor("fruit", base=2:3)
. For an analogous term for quantitative vertex attributes, seenodeicov
.
-
nodematch(attrname, diff=FALSE, keep=NULL)
-
Uniform homophily and differential
homophily:
The attrname
argument is a character vector giving one or more names of attributes in the network's vertex attribute list. When diff=FALSE
, this term adds one network statistic to the model, which counts the number of edges(i,j) for which attrname(i)==attrname(j)
. (When multiple names are given, the statistic counts only those on which all the named attributes match.) Whendiff=TRUE
,p network statistics are added to the model, where p is the number of unique values of the attrname
attribute. The kth such statistic counts the number of edges (i,j) for which attrname(i) == attrname(j) == value(k)
, wherevalue(k)
is the kth smallest unique value of the attrname attribute. If set to non-NULL, the optional keep
argument should be a vector of integers giving the values ofk
that should be considered for matches; other values are ignored (this works for both diff=FALSE
and diff=TRUE
). For instance, to add two statistics, counting the matches for just the 2nd and 4th categories, usenodematch
with diff=TRUE
and keep=c(2,4)
.
-
nodemix(attrname, base=NULL)
-
Nodal attribute
mixing:
The attrname
argument is a character vector giving the names of categorical attributes in the network's vertex attribute list. 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 names are given, a statistic is added for each combination of attribute values for those names.) In other words, this term produces one statistic for every entry in the mixing matrix for the attribute(s). The ordering of the attribute values is alphabetical (for nominal categories) or numerical (for ordered categories). The optional base
argument is a vector of integers corresponding to the pairings that should not be included. If base
contains only negative integers, then these integers correspond to the only pairings that should be included. By default (i.e., withbase=NULL
or base=0
), all pairings are included.
-
nodeocov(attrname)
-
Main effect of a covariate for
out-edges:
The attrname
argument is a character string giving the name of a numeric (not categorical) attribute in the network's vertex attribute list. This term adds a single network statistic to the model equaling the total value of attrname(i)
for all edges (i,j) in the network. This term may only be used with directed networks. For categorical attributes, see nodeofactor
.
-
nodeofactor(attrname, base=1)
-
Factor attribute effect for
out-edges:
The attrname
argument is a character string giving one or more names of categorical attributes in the network's vertex attribute list. This term adds multiple network statistics 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 statistics gives the number of times a node with that attribute or those attributes appears as the node of origin of a directed tie. To include all attribute values is usually not a good idea – though this may be accomplished if desired by setting base=0
– because the sum of all such statistics equals the number of edges and hence a linear dependency would arise in any model also including edges
. Thus, thebase
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 usingnodefactor("fruit", base=2:3)
. For an analogous term for quantitative vertex attributes, seenodeocov
.
-
nsp(d)
-
Nonedgewise shared partners:
This is just like the dsp
and esp
terms, except this term adds one network statistic to the model for each element in d
where the ith such statistic equals the number ofnon-edges (that is, dyads that do not have an edge) in the network with exactly d[i]
shared partners. This term can be used with directed and undirected networks. For directed networks the count is over homogeneous shared partners only (i.e., only partners on a directed two-path connecting the nodes in the non-edge and in the same direction).
-
odegree(d, by=NULL, homophily=FALSE)
-
Out-degree:
The d
argument is a vector of distinct integers. This term adds one network statistic to the model for each element in d
; theith such statistic equals the number of nodes in the network of out-degree d[i]
, i.e. the number of nodes with exactlyd[i]
out-edges. The optional argument by
is a character string giving the name of an attribute in the network's vertex attribute list. If this is specified and homophily
is TRUE
, then degrees are calculated using the subnetwork consisting of only edges whose endpoints have the same value of theby
attribute. If by
is specified and homophily
isFALSE
(the default), then separate degree statistics are calculated for nodes having each separate value of the attribute. This term can only be used with directed networks; for undirected networks see degree
.
-
ostar(k, attrname=NULL)
-
k-Outstars:
The k
argument is a vector of distinct integers. This term adds one network statistic to the model for each element in k
. Theith such statistic counts the number of distinct k[i]
-outstars in the network, where ak-outstar is defined to be a node N and a set of k different nodes \{O_1, …, O_k\} such that the ties (N,O_j) exist for j=1, …, k. The optional argument attrname
is a character string giving the name of an attribute in the network's vertex attribute list. If this is specified then the count is the number of k-outstars where all nodes have the same value of the attribute. This term can only be used with directed networks; for undirected networks see kstar
. Note thatostar(1)
is equal to both istar(1)
and edges
.
-
receiver(base=1)
-
Receiver effect:
This term adds one network statistic for each node equal to the number of in-ties for that node. This measures the popularity of the node. The term for the first node is omitted by default because of linear dependence that arises if this term is used together with edges
, but its coefficient can be computed as the negative of the sum of the coefficients of all the other actors. That is, the average coefficient is zero, following the Holland-Leinhardt parametrization of the $p_1$ model (Holland and Leinhardt, 1981). Thebase
argument allows the user to determine which nodes' statistics should be omitted. The base
argument can also be a vector of negative indices, to specify which should be added instead of deleted, and base=0
specifies that all statistics should be included. This term can only be used with directed networks. For undirected networks, see sociality
.
-
sender(base=1)
-
Sender effect:
This term adds one network statistic for each node equal to the number of out-ties for that node. This measures the activity of the node. The term for the first node is omitted by default because of linear dependence that arises if this term is used together with edges
, but its coefficient can be computed as the negative of the sum of the coefficients of all the other actors. That is, the average coefficient is zero, following the Holland-Leinhardt parametrization of the $p_1$ model (Holland and Leinhardt, 1981). Thebase
argument allows the user to determine which nodes' statistics should be omitted. The base
argument can also be a vector of negative indices, to specify which should be added instead of deleted, and base=0
specifies that all statistics should be included. This term can only be used with directed networks. For undirected networks, see sociality
.
-
simmelian
-
Simmelian triads:
This term adds one statistic to the model equal to the number of Simmelian triads, as defined by Krackhardt and Handcock (2007). This is a complete sub-graph of size three. This term can only be used with directed networks.
-
simmelianties
-
Ties in simmelian triads:
This term adds one statistic to the model equal to the number of ties in the network that are associated with Simmelian triads, as defined by Krackhardt and Handcock (2007). Each Simmelian has six ties in it but, because Simmelians can overlap in terms of nodes (and associated ties), the total number of ties in these Simmelians is less than six times the number of Simmelians. Hence this is a measure of the clustering of Simmelians (given the number of Simmelians). This term can only be used with directed networks.
-
sociality(attrname=NULL, base=1)
-
Undirected degree:
This term adds one network statistic for each node equal to the number of ties of that node. The optional attrname
argument is a character string giving the name of an attribute in the network's vertex attribute list that takes categorical values. If provided, this term only counts ties between nodes with the same value of the attribute (an actor-specific version of the nodematch
term). This term can only be used with undirected networks. For directed networks, seesender
and receiver
. By default,base=1
means that the statistic for the first node will be omitted, but this argument may be changed to control which statistics are included just as for the sender
and receiver
terms.
-
threepath(keep=1:4)
-
Three-paths:
For an undirected network, this term adds one statistic equal to the number of threepaths, where a threepath is defined as a path of length three that traverses three distinct edges. Note that a threepath need not include four distinct nodes; in particular, a triangle counts as three threepaths. For a directed network, this term adds four statistics (or some subset of these four specified by the keep
argument), one for each of the four distinct types of directed three-paths. If the nodes of the path are written from left to right such that the middle edge points to the right (R), then the four types are RRR, RRL, LRR, and LRL. That is, an RRR threepath is of the form i-->j-->k-->l, and RRL threepath is of the form i-->j-->k<--l, etc. Like in the undirected case, there is no requirement that the nodes be distinct in a directed threepath. However, the three edges must all be distinct. Thus, a mutual tie i<-->j does not count as a threepath of the form i-->j-->i<--j; however, in the subnetwork i<-->j-->k, there are two directed threepaths, one LRR (k<--j-->i-->j) and one RRR (k<--j-->i-->j).
-
transitive
-
Transitive triads:
This term adds one statistic to the model, equal to the number of triads in the network that are transitive. The transitive triads are those of type 120D
,030T
,120U
, or300
in the categorization of Davis and Leinhardt (1972). For details on the 16 possible triad types, see triad.classify
in the sna
package. Note the distinction from the ttriple
term. This term can only be used with directed networks.
-
transitiveties(attrname=NULL)
-
Transitive ties:
This term adds one statistic, equal to the number of ties i-->j such that there exists a two-path from i to j. (Related to the ttriple
term.) When a nodal attribute is passed via attrname
, all three nodes involved (i,j, and the node on the two-path) must match on this attribute in order for i-->j to be counted. This term can only be used with directed networks.
-
triadcensus(d)
-
Triad census:
For a directed network, this term adds one network statistic for each of an arbitrary subset of the 16 possible types of triads categorized by Davis and Leinhardt (1972) as 003, 012, 102, 021D, 021U, 021C, 111D, 111U, 030T, 030C, 201, 120D, 120U, 120C, 210,
and 300
. Note that at least one category should be dropped; otherwise a linear dependency will exist among the 16 statistics, since they must sum to the total number of three-node sets. By default, the category003
, which is the category of completely empty three-node sets, is dropped. This is considered category zero, and the others are numbered 1 through 15 in the order given above. By specifying a numeric vector of integers from 0 to 15 as thed
argument, the user may specify a set of terms to add other than the default value of 1:15
. Each statistic is the count of the corresponding triad type in the network. For details on the 16 types, see?triad.classify
in the {sna}
package, on which this code is based. For an undirected network, the triad census is over the four types defined by the number of ties (i.e., 0, 1, 2, and 3), and the default is to add 1:3
, which is to say that the 0 is dropped; however, this too may be controlled by changing thed
argument to a numeric vector giving a subset of \{0, 1, 2, 3\}.
-
triangle(attrname=NULL)
-
Triangles:
This term adds one statistic to the model equal to the number of triangles in the network. For an undirected network, a triangle is defined to be any set \{(i,j), (j,k), (k,i)\} of three edges. For a directed network, a triangle is defined as any set of three edges (i,j) and (j,k) and either (k,i) or (i,k). The former case is called a “transitive triple” and the latter is called a “cyclic triple”, so in the case of a directed network, triangle
equals ttriple
plus ctriple
— thus at most two of these three terms can be in a model. The optional argument attrname
restricts the count to those triples of nodes with equal values of the vertex attribute specified by attrname
.
-
tripercent(attrname=NULL)
-
Triangle percentage:
This term adds one statistic to the model equal to 100 times the ratio of the number of triangles in the network to the sum of the number of triangles and the number of 2-stars not in triangles (the latter is considered a potential but incomplete triangle). In case the denominator equals zero, the statistic is defined to be zero. For the definition of triangle, see triangle
. The optional argumentattrname
restricts the counts (both numerator and denominator) to those triples of nodes with equal values of the vertex attribute specified by attrname
. This is often called the mean correlation coefficient. This term can only be used with undirected networks; for directed networks, it is difficult to define the numerator and denominator in a consistent and meaningful way.
-
ttriple(attrname=NULL)
-
Transitive triples:
This term adds one statistic to the model, equal to the number of transitive triples in the network, defined as a set of edges {(i,j), (j,k), (i,k)}. Note that triangle
equals ttriple+ctriple
for a directed network, so at most two of the three terms can be in a model. The optional argument attrname
is a character string giving the name of an attribute in the network's vertex attribute list. If this is specified then the count is over the number of transitive triples where all three nodes have the same value of the attribute. This term can only be used with directed networks.
-
twopath
-
2-Paths:
This term adds one statistic to the model, equal to the number of 2-paths in the network. For a directed network this is defined as a pair of edges (i,j), (j,k), where i and j must be distinct. That is, it is a directed path of length 2 from i to k via j. For directed networks a 2-path is also a mixed 2-star but the interpretation is usually different; see m2star
. For undirected networks a twopath is defined as a pair of edges\{i,j\}, \{j,k\}. That is, it is an undirected path of length 2 from i to k via j, also known as a 2-star.