aomstats: aomstats

View source: R/aomstats.R

aomstatsR Documentation

aomstats

Description

Computes statistics for the sender activity rate step and receiver choice step in actor-oriented relational event models (e.g., see Stadtfeld & Block, 2017).

Usage

aomstats(
  reh,
  sender_effects = NULL,
  receiver_effects = NULL,
  memory = c("full", "window", "decay", "interval"),
  memory_value = NA,
  first = 2,
  last = Inf,
  display_progress = FALSE,
  attr_actors = NULL,
  attr_dyads = NULL
)

Arguments

reh

an object of class "remify" characterizing the relational event history. May also be a remify_durem object for duration relational event models.

sender_effects

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the effects in the sender activity rate step of the actor-oriented model for which statistics are computed, see ‘Details’

receiver_effects

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the effects in the receiver choice step of model for which statistics are computed, see ‘Details’

memory

The memory to be used. See ‘Details’.

memory_value

Numeric value indicating the memory parameter. Default is NA, which is only valid for memory = "full" (no memory parameter required). See ‘Details’.

first

an optional integer value, specifying the index of the first unique time point event in the relational event history for which statistics must be computed (see 'Details'). Default is 2: the first event has no history and is used only to initialize statistics, not to fit the model.

last

an optional integer value, specifying the index of the last unique time point in the relational event history for which statistics must be computed (see 'Details')

display_progress

should a progress bar for the computation of the endogenous statistics be shown (TRUE) or not (FALSE)?

attr_actors

optionally, an object of class "data.frame" that contains exogenous attributes for actors (see Details).

attr_dyads

optionally, an object of class data.frame or matrix containing attribute information for dyads (see Details).

Value

An object of class 'aomstats'. List with in the first element the statistics for the sender activity rate step and in the second element the statistics for the receiver choice step. Statistics are computed once per unique time point (per-timepoint "pt" method), so the number of rows in the output equals reh$M (the number of unique time points), which may be less than the total number of observed events when simultaneous events are present. The 'aomstats' object has the following attributes:

model

Type of model that is estimated.

formula

Model formula(s), obtained from the formula(s) inputted to 'sender_effects' and/or 'receiver_effects'.

actors

The set of actors used to construct the statistics, obtained from the remify object inputted to 'reh'.

Effects

The statistics to be computed are defined symbolically and should be supplied to the sender_effects and/or receiver_effects arguments in the form ~ effects. The terms are separated by + operators. For example: receiver_effects = ~ inertia() + otp(). Interactions between two effects can be included with * or : operators. For example: receivereffects = ~ inertia():otp(). A list of available effects can be obtained with actor_effects().

The majority of the statistics can be scaled in some way, see the documentation of the scaling argument in the separate effect functions for more information on this.

Memory

The default 'memory' setting is '"full"', which implies that at each time point $t$ the entire event history before $t$ is included in the computation of the statistics. Alternatively, when 'memory' is set to '"window"', only the past event history within a given time window is considered (see Mulders & Leenders, 2019). This length of this time window is set by the 'memory_value' parameter. For example, when 'memory_value = 100' and 'memory = "window"', at time point $t$ only the past events that happened at most 100 time units ago are included in the computation of the statistics. A third option is to set 'memory' to '"interval"'. In this case, the past event history within a given time interval is considered. For example, when '"memory_value" = c(50, 100)' and 'memory = "interval"', at time point $t$ only the past events that happened between 50 and 100 time units ago are included in the computation of the statistics. Finally, the fourth option is to set 'memory' to '"decay"'. In this case, the weight of the past event in the computation of the statistics depend on the elapsed time between $t$ and the past event. This weight is determined based on an exponential decay function with half-life parameter 'memory_value' (see Brandes et al., 2009).

Event weights

Note that if the relational event history contains a column that is named “weight”, it is assumed that these affect the endogenous statistics. These affect the computation of all endogenous statistics with a few exceptions that follow logically from their definition (e.g., the recenyContinue statistic does depend on time since the event and not on event weights).

Subset of the relational event history

Optionally, statistics can be computed for a slice of the relational event sequence - but based on the entire history. This is achieved by setting the first and last values equal to the index of the first and last event for which statistics are requested. For example, first = 5 and last = 5 computes the statistics for only the 5th event in the relational event sequence, based on the history that consists of events 1-4.

References

Stadtfeld, C., & Block, P. (2017). Interactions, actors, and time: Dynamic network actor models for relational events. Sociological Science, 4, 318–352. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.15195/v4.a14")}

Meijerink-Bosman, M., Back, M., Geukes, K., Leenders, R., & Mulder, J. (2023). Discovering trends of social interaction behavior over time: An introduction to relational event modeling: Trends of social interaction. Behavior Research Methods, 55(3), 997-1023. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3758/s13428-022-01821-8")}

Examples

library(remstats)

# Load the data
data(history)
data(info)

# Prepare the data
reh <- remify::remify(edgelist = history, model = "actor")

# Define the sender effects
seff <- ~ send("extraversion")

# Define the receiver_effects
reff <- ~ receive("agreeableness") + inertia() + otp()

# Compute the statistics
aomstats(
  reh = reh, sender_effects = seff, receiver_effects = reff,
  attr_actors = info
)


remstats documentation built on July 15, 2026, 5:07 p.m.