Learn R Programming

goldfish (version 1.6.10)

defineDependentEvents: Define dependent events for a model

Description

The final step in defining the data objects is to identify the dependent events.

Usage

defineDependentEvents(
  events,
  nodes,
  nodes2 = NULL,
  defaultNetwork = NULL,
  envir = environment()
)

Value

an object with additional class dependent.goldfish with attributes:

nodes

a character vector with the names of the nodes set that define the dimensions of the defaultNetwork. nodes and nodes2 arguments.

defaultNetwork

A character value with the name of the network object when this is present. defaultNetwork argument.

type

A character value that can take values monadic or dyadic depending on the arguments used during the definition.

The object can be modified using methods for data frames.

Arguments

events

a data frame containing the event list that should be considered as a dependent variable in models.

nodes

a data frame or a nodes.goldfish object containing the nodes used in the event list.

nodes2

a second nodeset in the case that the events occurs in a two-mode network.

defaultNetwork

the name of a network.goldfish object.

envir

An environment object where the nodes-set and default network objects are defined. The default value is environment().

Details

Before this step is performed, we have to define: the nodeset (defineNodes()), the network (defineNetwork()) and the link the event list to the network (linkEvents()).

During the definition as a dependent event, some checks are done to ensure consistency with the default network and the nodeset. In particular, consistency of the labels of nodes in the events with the nodes' labels in the network and the nodeset is done.

It is possible to define as a dependent event a different set of events to the ones link to the default network. This is useful to model different type of events where the event dynamic is driven by different effects or its weight differs. Fisheries_Treaties_6070 has an example of it, the relational event modeled are fisheries treaties between countries. The bilatchanges data frame contains information of creation and dissolution of treaties. vignette(teaching2) shows how to model just the creation of treaties conditional on creation and dissolution.

See Also

defineNodes(), defineNetwork(), linkEvents()

Examples

Run this code
actors <- data.frame(
  actor = 1:5, label = paste("Actor", 1:5),
  present = TRUE, gender = sample.int(2, 5, replace = TRUE)
)
actors <- defineNodes(nodes = actors)
calls <- data.frame(
  time = c(12, 27, 45, 56, 66, 68, 87),
  sender = paste("Actor", c(1, 3, 5, 2, 3, 4, 2)),
  receiver = paste("Actor", c(4, 2, 3, 5, 1, 2, 5)), increment = rep(1, 7)
)
callNetwork <- defineNetwork(nodes = actors)
callNetwork <- linkEvents(
  x = callNetwork, changeEvent = calls, nodes = actors
)

# Defining the dependent events:
callDependent <- defineDependentEvents(
  events = calls, nodes = actors, defaultNetwork = callNetwork
)

Run the code above in your browser using DataLab