varCovar | R Documentation |
This function creates a changing covariate object from a matrix.
varCovar(val, centered=TRUE, nodeSet="Actors", warn=TRUE,
imputationValues=NULL)
val |
Matrix of covariate values, one row for each actor, one column for each period. |
centered |
Boolean: if TRUE, then the overall mean value is subtracted. |
nodeSet |
Character string containing the name of the associated node set. 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 |
Matrix of covariate values of same
dimensions as |
When part of a Siena data object, the covariate is assumed to be
associated with 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 overall mean value. In both cases, cases with imputed values
are not used for calculating target statistics (see the manual).
The value of the changing covariate for wave m
is supposed
in the simulations to be valid in the whole period from wave m
to wave m+1
.
If the data set has M
waves, this means that the values,
if any, for wave M
will not be used. Therefore, the number of columns
can be M
or M-1
; if the former, the values in the last
column will not be used.
Returns the covariate as an object of class "varCovar", in which
form it can be used as an argument to sienaDataCreate
.
Ruth Ripley
See https://www.stats.ox.ac.uk/~snijders/siena/
sienaDataCreate
, coCovar
,
coDyadCovar
, varDyadCovar
,
sienaNodeSet
myvarCovar <- varCovar(s50a)
senders <- sienaNodeSet(50, nodeSetName="senders")
receivers <- sienaNodeSet(30, nodeSetName="receivers")
senders.covariate <- varCovar(s50a, nodeSet="senders")
receivers.covariate <- varCovar(s50s[1:30,], nodeSet="receivers")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.