sienaGroupCreate: Function to group together several Siena data objects

View source: R/sienaDataCreate.r

sienaGroupCreateR Documentation

Function to group together several Siena data objects

Description

Creates an object of class "sienaGroup" from a list of Siena data objects.

Usage

sienaGroupCreate(objlist, singleOK = FALSE, getDocumentation=FALSE)

Arguments

objlist

List of objects of class siena.

singleOK

Boolean: is it OK to only have one object?

getDocumentation

Flag to allow documentation of internal functions, not for use by users.

Details

This function creates a Siena group object from several Siena data objects ('groups'), all of which use networks, covariates and actor sets with the same names. The variables must correspond exactly between all data objects; the numbers of waves may differ. It can be used as data input to siena07 for the multigroup option. Also used internally for convenience with a single Siena data object.

Each covariate should either be centered in all groups, or non-centered in all groups. Centered actor covariates are re-centered at the overall mean. This means that the original values are used, and the overall mean of all non-missing observations is subtracted. Note that this implies that group-dependent variables that are constant for all actors in each group, can be used as centered actor covariates.

For combining two-wave with more-wave groups in one group object, covariates that are changing covariates for the more-wave groups have to be specified as changing covariates also for the two-wave groups. This can be done by specifying them with values for the two waves; for actor covariates this will be by using an n \times 2 matrix, for dyadic covariates an n \times n \times 2 array (or n \times m \times 2 for the two-mode case). The values for the second wave should be identical to those for the first wave (they will be used only for centering operations).

For later use in siena07, it will often (but not always...) be helpful when creating the Siena data objects in objlist to use allowOnly=FALSE in the call of sienaDependent; see the help page for this function.

If there are multiple dependent networks, it may be necessary to run sienaDataConstraint before sienaGroupCreate to ensure that these constraints are equal for all groups.

Value

An object of class sienaGroup; this is a list containing the input objects, with attributes:

netnames

names of the dependent variables in each set

symmetric

vector of booleans, one for each dependent variable. TRUE if all occurrences of the network are symmetric.

structural

vector of booleans, indicating whether structurally fixed values occur in this network

allUpOnly

vector of booleans, indicating whether changes are all upwards in all the occurrences of this network

allDownOnly

similar to previous, but for downward changes

anyUpOnly

vector of booleans, indicating whether changes are all upwards in any of the occurrences of this network

anyDownOnly

similar to previous, but for downward changes

types

vector of network types of the dependent variables

observations

Total number of periods to process

periodNos

Sequence of numbers of periods which are not skipped in multigroup processing

netnodeSets

list of names of the node sets corresponding to the dependent variables

cCovars

names of the constant covariates, if any

vCovars

names of the changing covariates, if any

dycCovars

names of the constant dyadic covariates, if any

dyvCovars

names of the changing dyadic covariates, if any

ccnodeSets

list of the names of the node sets corresponding to the constant covariates

cvnodeSets

list of the names of the node sets corresponding to the changing covariates

dycnodeSets

list of the names of the node sets corresponding to the constant dyadic covariates

dyvcnodeSets

list of the names of the node sets corresponding to the changing dyadic covariates

compositionChange

boolean: any composition change at all?

exooptions

named vector of composition change options for the node sets

names

Either from the input objects or "Data1", "Data2" etc

class

"sienaGroup" inheriting from "siena"

balmean

vector of means for balance calculations

bRange

vector of difference between maximum and minimum values for behavior variables, NA for other dependent variables

behRange

matrix of maximum and minimum values for behavior variables, NA for other dependent variables

bSim

vector of similarity means for behavior variables, NA for other dependent variables

bPoszvar

vector of booleans indicating positive variance for behavior variables. NA for other dependent variables

bMoreThan2

vector of booleans indicating whether the behavior variables take more than 2 distinct values

cCovarPoszvar

vector of booleans indicating positive variance for constant covariates

cCovarMoreThan2

vector of booleans indicating whether the constant covariates take more than 2 distinct values

cCovarRange

vector of difference between maximum and minimum values for constant covariates

cCovarRange2

matrix of maximum and minimum values for constant covariates

cCovarSim

vector of similarity means for constant covariates

cCovarMean

vector of means for constant covariates

vCovarRange

vector of difference between maximum and minimum values for changing covariates

vCovarSim

vector of similarity means for changing covariates

vCovarMoreThan2

vector of booleans indicating whether the changing covariates take more than 2 distinct values

vCovarPoszvar

vector of booleans indicating positive variance for changing covariates

vCovarMean

vector of means for changing covariates

dycCovarMean

vector of means for constant dyadic covariates

dycCovarRange

vector of ranges for constant dyadic covariates

dycCovarRange2

matrix of maximum and minimum values for constant dyadic covariates

dyvCovarRange

vector of ranges for changing dyadic covariates

dyvCovarMean

vector of means for changing dyadic covariates

anyMissing

vector of booleans, one for each dependent variable, indicating the presence of any missing values

netRanges

matrix of maximum and minimum values for dependent networks, NA for behavior variables

Author(s)

Ruth Ripley, Modification by Tom Snijders

References

See the Section on Multi-group Siena analysis in the manual available from https://www.stats.ox.ac.uk/~snijders/siena/.

See Also

sienaDataCreate, sienaDataConstraint

Examples

Group1 <- sienaDependent(array(c(N3401, HN3401), dim=c(45, 45, 2)))
Group3 <- sienaDependent(array(c(N3403, HN3403), dim=c(37, 37, 2)))
Group4 <- sienaDependent(array(c(N3404, HN3404), dim=c(33, 33, 2)))
Group6 <- sienaDependent(array(c(N3406, HN3406), dim=c(36, 36, 2)))
# Illustration of the use of group-level variables:
# dum1 is a dummy variable for group 1,
# having constant value 1 in group 1, and constant value 0 in the other groups.
dum1.1  <- coCovar(c(rep(1,45)), warn = FALSE)
dum1.3  <- coCovar(c(rep(0,37)), warn = FALSE)
dum1.4  <- coCovar(c(rep(0,33)), warn = FALSE)
dum1.6  <- coCovar(c(rep(0,36)), warn = FALSE)
# In a similar way, dummies for the other groups can be defined.
dataset.1 <- sienaDataCreate(Friends = Group1, dum1 = dum1.1)
dataset.3 <- sienaDataCreate(Friends = Group3, dum1 = dum1.3)
dataset.4 <- sienaDataCreate(Friends = Group4, dum1 = dum1.4)
dataset.6 <- sienaDataCreate(Friends = Group6, dum1 = dum1.6)
(FourGroups <- sienaGroupCreate(list(dataset.1, dataset.3, dataset.4,
                                     dataset.6)))
class(FourGroups)
# The main effect of the group-level variable is the \code{egoX} effect:
myeff <- getEffects(FourGroups)
(myeff <- includeEffects(myeff, egoX, interaction1 = "dum1"))

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