varDyadCovar: Function to create a changing dyadic covariate object.

View source: R/sienautils.r

varDyadCovarR Documentation

Function to create a changing dyadic covariate object.

Description

This function creates a changing dyadic covariate object from an array.

Usage

varDyadCovar(val, centered=TRUE, nodeSets=c("Actors", "Actors"),
     warn=TRUE, sparse=is.list(val), type=c("oneMode", "bipartite"))

Arguments

val

Array of covariate values, third dimension is the time. Alternatively, a list of sparse matrices of type "TsparseMatrix".

centered

Boolean: if TRUE, then the overall mean value is subtracted.

nodeSets

Names (character string) of the associated node sets. 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 NA, or all non-missing values are the same.

sparse

Boolean: whether sparse matrices or not.

type

oneMode or bipartite: whether the matrix refers to a one-mode or a bipartite (two-mode) network.

Details

When part of a Siena data object, the covariate is assumed to be associated with the node sets named NodeSets of the Siena data object. The names of the associated node sets will only be checked when the Siena data object is created. In practice, the node set needs to be specified only in the case of the use of the covariate with a two-mode network.
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.

Value

Returns the covariate as an object of class "varDyadCovar", in which form it can be used as an argument to SienaDataCreate.

Author(s)

Ruth Ripley

References

See https://www.stats.ox.ac.uk/~snijders/siena/

See Also

sienaDataCreate, coDyadCovar, coCovar, varCovar, sienaNodeSet

Examples


mydyadvar <- varDyadCovar(array(c(s501, s502), dim=c(50, 50, 2)))


RSiena documentation built on Nov. 2, 2023, 5:19 p.m.