coCovar | R Documentation |
This function creates a constant covariate object from a vector.
coCovar(val, centered=TRUE, nodeSet="Actors", warn=TRUE, imputationValues=NULL)
val |
Vector of covariate values |
centered |
Boolean: if TRUE, then the mean value is subtracted. |
nodeSet |
Name of node set: character string. If the entire data set contains more than one node set, then the node sets must be specified in all data objects. |
warn |
Logical: is a warning given if all values are |
imputationValues |
Vector of covariate values of same
length as |
When part of a Siena data object,
the covariate is associated with the node set
nodeSet
of the Siena data object.
In practice, the node set needs to be specified only in the case of
the use of the covariate with a two-mode network.
If there are any NA
values in val
, and
imputationValues
is given, then the corresponding elements
of imputationValues
are used for imputation.
If imputationValues
is NULL
, imputation
is by the mean value. In both cases, cases with imputed values
are not used for calculating target statistics (see the manual).
Returns the covariate as an object of class "coCovar", in which
form it can be used as an argument to sienaDataCreate
.
Ruth Ripley
See https://www.stats.ox.ac.uk/~snijders/siena/
sienaDataCreate
, varCovar
,
coDyadCovar
, varDyadCovar
,
sienaNodeSet
myconstCovar <- coCovar(s50a[,1])
senders <- sienaNodeSet(50, nodeSetName="senders")
receivers <- sienaNodeSet(30, nodeSetName="receivers")
senders.attribute <- coCovar(rep(1:10, each=5), nodeSet="senders")
receivers.attribute <- coCovar(rep(1:5, each=6), nodeSet="receivers")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.