sienaDependent | R Documentation |
Creates a Siena dependent variable: either a network,
created from a matrix or array or list of sparse matrix of triples;
or a behavior variable, created from a matrix.
sienaDependent()
and sienaNet()
are identical
functions; the second name was used from the start of the
RSiena
package, but the first name
indicates more precisely the purpose of this function.
sienaDependent(netarray, type=c("oneMode", "bipartite", "behavior", "continuous"),
nodeSet="Actors", sparse=is.list(netarray), allowOnly=TRUE, imputationValues=NULL)
sienaNet(netarray, type=c("oneMode", "bipartite", "behavior", "continuous"),
nodeSet="Actors", sparse=is.list(netarray), allowOnly=TRUE, imputationValues=NULL)
netarray |
|
type |
type of dependent variable, default |
nodeSet |
character string naming the appropriate node set. For a bipartite network, a vector containing 2 character strings: "rows" first, then "columns". |
sparse |
logical: TRUE indicates the data is in sparse matrix format, FALSE otherwise. |
allowOnly |
logical: If TRUE, it will be detected when between any
two consecutive waves the changes are non-decreasing or non-increasing,
and if this is the case, this will also be a constraint for the
simulations between these two waves.
This is done by means of the internal parameters For normal operation when this is the case for all periods, usually
TRUE is the appropriate option. When it is only the case for some of the
periods, and for data sets that will be part of a multi-group object
created by |
imputationValues |
for |
Adds attributes so that the array or list of matrices can be used in a Siena model fit.
An object of class sienaDependent
. An array or (networks only) a list of
sparse matrices with attributes:
netdims |
Dimensions of the network or behavior variable: senders, receivers (1 for behavior), periods |
type |
oneMode, bipartite or behavior |
sparse |
Boolean: whether the network is given as a list of sparse matrices or not |
nodeSet |
Character string with name(s) of node set(s) |
allowOnly |
The value of the |
Ruth Ripley and Tom A.B. Snijders
See https://www.stats.ox.ac.uk/~snijders/siena/ .
sienaDataCreate
, sienaNodeSet
,
sienaDataConstraint
mynet1 <- sienaDependent(array(c(s501, s502, s503), dim=c(50, 50, 3)))
mybeh <- sienaDependent(s50a, type="behavior")
## note that the following example works although the node sets do not yet exist!
mynet3 <- sienaDependent(array(c(s501, s502, s503), dim=c(50, 50, 3)),
type="bipartite", nodeSet=c("senders", "receivers"))
## sparse matrix input
## To show this, we first go back from the adjacency matrices to edgelists.
## The manual shows one way to do this.
## Another way is to use the sparse matrix representation which internally
## indeed is an edge list:
library(Matrix)
sp501 <- as(Matrix(s501), "TsparseMatrix")
sp502 <- as(Matrix(s502), "TsparseMatrix")
sp503 <- as(Matrix(s503), "TsparseMatrix")
## If you are interested in the internal structure of these sparse matrices,
## you can request
str(sp501)
## Slot @i is the row, @j is the column, and @x the value;
## here the values all are 1.
## Slots @i and @j do not contain information about the number of nodes,
## so that is supplied additionally by @Dim.
mymatlist <- list(sp501, sp502, sp503)
mynet.sp <- sienaDependent(mymatlist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.