tergm-terms: Temporal dependencies for TERGMs

tergm-termsR Documentation

Temporal dependencies for TERGMs

Description

Network statistics that span multiple time points.

Transform a covariate using a function of time.

Usage

timecov(
  covariate,
  minimum = 1,
  maximum = length(covariate),
  transform = function(t) 1 + (0 * t) + (0 * t^2),
  onlytime = FALSE
)

Arguments

covariate

The list of networks or matrices for which to create a time covariate. This can be the list of networks on the left-hand side of the formula, in which case a time trend is created as a covariate list of matrices, or it can be a list of networks or matrices that is used as a dyadic covariate on the right-hand side of the formula, in which case an interaction effect between the time trend and the covariate is created. If used as a model term inside a formula, covariate = NULL is permitted, in which case the networks on the left-hand side will be used to form a time trend.

minimum, maximum

For time steps below the minimum value and above the maximum value, the time covariate is set to 0. These arguments can be used to create step-wise, discrete effects, for example to use a value of 0 up to an external event and 1 from that event onwards in order to control for influences of external events.

transform

In the default case, edges are modeled as being linearly increasingly important over time (i.e., a linear time trend). By tweaking the transform function, arbitrary functional forms of time can be tested. For example, transform = sqrt (for a geometrically decreasing time effect), transform = function(x) x^2 (for a geometrically increasing time effect), transform = function(t) t (for a linear time trend) or polynomial functional forms (e.g., transform = function(t) 0 + (1 * t) + (1 * t^2)) can be used.

onlytime

If TRUE, return a time trend only. If FALSE, return an interaction between the time trend and the covariate. Note that the model term may need to be called twice or more inside a formula: one time to create the time trend main effect and one time for each interaction term; you also need to include the main effects for the covariates separately using edgecov or similar terms.

Details

In addition to the ERGM user terms that can be estimated within a single network (see ergm-terms), the btergm package provides additional model terms that can be used within a formula. These additional statistics span multiple time periods and are therefore called "temporal dependencies." Examples include memory terms (i.e., positive autoregression, dyadic stability, edge innovation, or edge loss), delayed reciprocity or mutuality, and time covariates (i.e., functions of time or interactions with time):

delrecip(mutuality = FALSE, lag = 1)

The delrecip term checks for delayed reciprocity. For example, if node j is tied to node i at t = 1, does this lead to a reciprocation of that tie back from i to j at t = 2? If mutuality = TRUE is set, this extends not only to ties, but also non-ties. That is, if i is not tied to j at t = 1, will this lead to j not being tied to i at t = 2, in addition to positively reciprocal patterns over time? The lag argument controls the size of the temporal lag: with lag = 1, reciprocity over one consecutive time period is checked. Note that as lag increases, the number of time steps on the dependent variable decreases.

memory(type = "stability", lag = 1)

Memory terms control for the impact of a previous network on the current network. Four different types of memory terms are available: positive autoregression (type = "autoregression") checks whether previous ties are carried over to the current network; dyadic stability (type = "stability") checks whether both edges and non-edges are stable between the previous and the current network; edge loss (type = "loss") checks whether ties in the previous network have been dissolved and no longer exist in the current network; and edge innovation (type = "innovation") checks whether previously unconnected nodes have the tendency to become tied in the current network. The lag argument accepts integer values and controls whether the comparison is made with the previous network (lag = 1), the pre-previous network (lag = 2) etc. Note that as lag increases, the number of time steps on the dependent variable decreases.

timecov(x = NULL, minimum = 1, maximum = NULL, transform = function(t) t)

The timecov model term checks for linear or non-linear time trends with regard to edge formation. Optionally, this can be combined with a covariate to create an interaction effect between a dyadic covariate and time in order to test whether the importance of a covariate increases or decreases over time. In the default case, edges modeled as being linearly increasingly important over time. By tweaking the transform function, arbitrary functional forms of time can be tested. For example, transform = sqrt (for a geometrically decreasing time effect), transform = function(x) x^2 (for a geometrically increasing time effect), transform = function(t) t (for a linear time trend) or polynomial functional forms (e.g., 0 + (1 * t) + (1 * t^2)) can be used. For time steps below the minimum value and above the maximum value, the time covariate is set to 0. These arguments can be used to create step-wise, discrete effects, for example to use a value of 0 up to an external event and 1 from that event onwards in order to control for influences of external events.

The timecov model term checks for linear or non-linear time trends with regard to edge formation. Optionally, this can be combined with a covariate to create an interaction effect between a dyadic covariate and time in order to test whether the importance of a covariate increases or decreases over time. The function can either be used in a formula with btergm, mtergm, or tbergm, or it can be executed directly for manual inclusion of the results as a covariate.

Functions

  • timecov(): Time trends and temporal covariate interactions

References

Leifeld, Philip, Skyler J. Cranmer and Bruce A. Desmarais (2017): Temporal Exponential Random Graph Models with btergm: Estimation and Bootstrap Confidence Intervals. Journal of Statistical Software 83(6): 1-36. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v083.i06")}.


btergm documentation built on Oct. 6, 2023, 1:07 a.m.