make_constraint: Function to change the values of the constraints between...

View source: R/sienautils.r

make_constraintR Documentation

Function to change the values of the constraints between networks

Description

This function allows the user to change the constraints of "higher", "disjoint" and "atLeastOne" for a specified pair of networks in a Siena data object.
The functions make_constraint and sienaDataConstraint are identical. The first name is preferred, the other is kept for backward compatibility.
The functions make_constraint and sienaDataConstraint are identical. The first name is preferred, the other is kept for backward compatibility.

Usage

## S3 method for class 'sienadata'
make_constraint(x, net1, net2, type, value = FALSE, ...)
## S3 method for class 'sienaGroup'
make_constraint(x, net1, net2, type, value = FALSE, ...)

sienaDataConstraint(x, net1, net2, type, value = FALSE)

Arguments

x

sienadata object or a sienaGroup object

net1

name of first network

net2

name of second network

type

one of "higher", "disjoint", "atleastOne".

value

Boolean giving the value.

...

Additional arguments, not used now.

Details

The value of the appropriate attribute is set to the value requested. Note that, for value=TRUE, the correspondence of this value to the data is not checked.

Value

Updated sienadata object.

Author(s)

Ruth Ripley

References

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

See Also

make_data_rsiena, make_group_rsiena

Examples

nowFriends <- as_dependent_rsiena(
                array(c(s501, s502, s503), dim=c(50, 50, 3)))
ever <- array(c(s501, s502, s503), dim=c(50, 50, 3))
ever[,,2] <- pmax(ever[,,1], ever[,,2])
ever[,,3] <- pmax(ever[,,2], ever[,,3])
everFriends <- as_dependent_rsiena(ever)
# Note: this data set serves to illustrate this function,
# but it is not an appropriate data set for estimation by siena07,
# because everFriends (for the three waves together) 
# depends deterministically on nowFriends (for the three waves together).
nowOrEver <- make_data_rsiena(nowFriends, everFriends)
attr(nowOrEver, "higher")
nowOrEver
nowOrEver.unconstrained <-
 make_constraint(nowOrEver, everFriends, nowFriends, "higher", FALSE)
nowOrEver.unconstrained
attr(nowOrEver.unconstrained, "higher")

RSiena documentation built on April 20, 2026, 5:07 p.m.