Model Terms in iglm

Overview

This vignette describes all model terms available in iglm (version 1.2.6) for specifying the sufficient statistics of joint network-attribute models. Terms are passed on the right-hand side of the formula argument in iglm() and govern how individual attributes and network connections jointly determine the log-linear probabilities of the model.

A model in iglm decomposes its sufficient statistics into two families:

The total sufficient statistic of the model is then \[ S(x, y, z) = \sum_i g_i(x_i, y_i) + \sum_{i \ne j} h_{i,j}(x, y, z). \]


Key Definitions

Before stating all statistics, we introduce the formal notation and definitions used throughout this vignette:

The sections below and the summary table list all implemented terms as of iglm version 1.2.6 and will be extended in future releases.


Category 1: Attribute Dependence Terms (\(g_i\) Terms)

These terms capture how individual predictors \(x_i\) (exogenous) and \(y_i\) (endogenous) relate to each other, without reference to the network.

attribute_x

Description: Intercept for the endogenous \(x\)-attribute.

\[ g_i(x_i, y_i) = x_i \]

formula <- object ~ attribute_x

attribute_y

Description: Intercept for the endogenous \(y\)-attribute.

\[ g_i(x_i, y_i) = y_i \]

formula <- object ~ attribute_y

cov_x(data = v)

Description: Effect of a unit-level exogenous covariate \(v_i\) on attribute \(x_i\).

\[ g_i(x_i, y_i) = v_i\, x_i \]

formula <- object ~ cov_x(data = v)

cov_y(data = v)

Description: Effect of a unit-level exogenous covariate \(v_i\) on attribute \(y_i\).

\[ g_i(x_i, y_i) = v_i\, y_i \]

formula <- object ~ cov_y(data = v)

attribute_xy(mode = "global" | "local" | "alocal")

Description: Interaction between the two attributes \(x_i\) and \(y_i\), optionally mediated by the neighbourhood structure.

Mode Formula
global \(x_i\, y_i\)
local \(x_i \sum_{j \in 𝒩_i} y_j + y_i \sum_{j \in 𝒩_i} x_j\)
alocal \(x_i \sum_{j \notin 𝒩_i} y_j + y_i \sum_{j \notin 𝒩_i} x_j\)
formula <- object ~ attribute_xy(mode = "local")

Category 2: Network Dependence Terms (\(h_{i,j}\) Terms)

These terms capture how the network topology \(z\) drives edge formation. All are pair-level statistics.

degrees

Description: Node-level degree fixed effects. One parameter per unit, capturing heterogeneity in activity not explained by other terms. Estimation relies on an MM algorithm constraint.

formula <- object ~ degrees

edges(mode = "global" | "local" | "alocal")

Description: Baseline propensity for a tie \(z_{i,j}\) to form; the network analogue of an intercept.

\[ h_{i,j}(x, y, z) = e_{i,j}^{(\mathtt{s})} \]

Suitable for both directed and undirected networks.

formula <- object ~ edges(mode = "global")
formula <- object ~ edges(mode = "local")
formula <- object ~ edges(mode = "alocal")

mutual(mode = "global" | "local" | "alocal")

Description: Reciprocity in directed networks. Counts pairs where \(i \to j\) and \(j \to i\) both exist (counted once per unordered pair, hence the factor \(1/2\)).

\[ h_{i,j}(x, y, z) = \frac{e_{i,j}^{(\mathtt{s})}\, e_{j,i}^{(\mathtt{s})}}{2} \]

Only valid for directed networks.

formula <- object ~ mutual(mode = "global")

cov_z(data = w, mode = "global" | "local" | "alocal")

Description: Dyadic covariate — exogenous edge-level covariate \(w_{i,j}\) influences tie formation.

\[ h_{i,j}(x, y, z) = w_{i,j}\, e_{i,j}^{(\mathtt{s})} \]

Suitable for both directed and undirected networks.

formula <- object ~ cov_z(data = W, mode = "global")

cov_z_out(data = v, mode = "global" | "local" | "alocal")

Description: Sender covariate — exogenous nodal attribute \(v_i\) influences the propensity to send a tie.

\[ h_{i,j}(x, y, z) = v_i\, e_{i,j}^{(\mathtt{s})} \]

Only valid for directed networks.

formula <- object ~ cov_z_out(data = v, mode = "global")

cov_z_in(data = v, mode = "global" | "local" | "alocal")

Description: Receiver covariate — exogenous nodal attribute \(v_j\) influences the propensity to receive a tie.

\[ h_{i,j}(x, y, z) = v_j\, e_{i,j}^{(\mathtt{s})} \]

Only valid for directed networks.

formula <- object ~ cov_z_in(data = v, mode = "global")

isolates

Description: Captures the proportion of units with no connections at all (total degree zero).

\[ h_{i,j}(x, y, z) = \mathbb{I}\!\left(\sum_{j \in 𝒫 \setminus \{i\}} z_{i,j} + z_{j,i} = 0\right) \]

Suitable for both directed and undirected networks.

formula <- object ~ isolates

nonisolates

Description: Captures the proportion of units that have at least one connection.

\[ h_{i,j}(x, y, z) = \mathbb{I}\!\left(\sum_{j \in 𝒫 \setminus \{i\}} z_{i,j} + z_{j,i} \ne 0\right) \]

Suitable for both directed and undirected networks.

formula <- object ~ nonisolates

gwdegree(mode = "global" | "local", decay = α)

Description: Geometrically Weighted Degree — captures the overall degree distribution with exponential decay parameter \(\alpha\).

\[ h_{i,j}(x, y, z) = w_{\operatorname{deg}(i)}(\alpha) + w_{\operatorname{deg}(j)}(\alpha) \]

Suitable for both directed and undirected networks. Only mode %in% c("global", "local") is available.

formula <- object ~ gwdegree(mode = "global", decay = 0.5)

gwodegree(mode = "global" | "local", decay = α)

Description: Geometrically Weighted Out-Degree — captures the out-degree distribution in directed networks.

\[ h_{i,j}(x, y, z) = w_{\operatorname{deg}(i,\,\mathtt{s})}(\alpha) \]

Only valid for directed networks. Only mode %in% c("global", "local") is available.

formula <- object ~ gwodegree(mode = "global", decay = 0.5)

gwidegree(mode = "global" | "local", decay = α)

Description: Geometrically Weighted In-Degree — captures the in-degree distribution in directed networks.

\[ h_{i,j}(x, y, z) = w_{\operatorname{ideg}(i,\,\mathtt{s})}(\alpha) \]

Only valid for directed networks. Only mode %in% c("global", "local") is available.

formula <- object ~ gwidegree(mode = "global", decay = 0.5)

transitive

Description: Transitivity indicator — rewards edges that close a locally transitive triple.

\[ h_{i,j}(x, y, z) = d_{i,j}(\mathbf{z})\, z_{i,j} \]

Suitable for both directed and undirected networks.

formula <- object ~ transitive

gwesp_symm(mode = "global" | "local", decay = α)

Description: Geometrically Weighted Edgewise Shared Partners (undirected) — the classic GWESP statistic for undirected networks.

\[ h_{i,j}(x, y, z) = e_{i,j}^{(\mathtt{s})}\, w_{\operatorname{CP}(i,j,\mathtt{s})}(\alpha) \]

Suitable for undirected networks only.

formula <- object ~ gwesp_symm(mode = "global", decay = 0.5)

gwesp(mode = "global" | "local", type = "OTP" | "ISP" | "OSP" | "ITP", decay = α)

Description: Geometrically Weighted Edgewise Shared Partners (directed) — conditions shared partners on a specific path type.

\[ h_{i,j}(x, y, z) = e_{i,j}^{(\mathtt{s})}\, w_{\operatorname{CP}(i,j,\mathtt{s},\mathtt{type})}(\alpha) \]

Only valid for directed networks. Only mode %in% c("global", "local") is available.

formula <- object ~ gwesp(mode = "global", type = "OTP", decay = 0.5)

gwdsp_symm(mode = "local", decay = α)

Description: Geometrically Weighted Dyadwise Shared Partners (undirected) — models triadic potential irrespective of the closing edge.

\[ h_{i,j}(x, y, z) = w_{\operatorname{CP}(i,j,\mathtt{local})}(\alpha) \]

Suitable for undirected networks only.

formula <- object ~ gwdsp_symm(mode = "local", decay = 0.5)

gwdsp(mode = "global" | "local", type = "OTP" | "ISP" | "OSP" | "ITP", decay = α)

Description: Geometrically Weighted Dyadwise Shared Partners (directed) — models directed triadic potential irrespective of the closing edge.

\[ h_{i,j}(x, y, z) = w_{\operatorname{CP}(i,j,\mathtt{s},\mathtt{type})}(\alpha) \]

Only valid for directed networks. Only mode %in% c("global", "local") is available.

formula <- object ~ gwdsp(mode = "global", type = "OTP", decay = 0.5)

Category 3: Joint Attribute/Network Dependence Terms (\(h_{i,j}\) Terms)

These terms capture the interplay between nodal attributes and network position. They are the key building blocks for studying spillover effects.

attribute_xz(mode = "local")

Description: Additive effect of \(x_i\) and \(x_j\) on local edge formation.

\[ h_{i,j}(x, y, z) = (x_i + x_j)\, u_{i,j} \]

Suitable for both directed and undirected networks.

formula <- object ~ attribute_xz(mode = "local")

attribute_yz(mode = "local")

Description: Additive effect of \(y_i\) and \(y_j\) on local edge formation.

\[ h_{i,j}(x, y, z) = (y_i + y_j)\, u_{i,j} \]

Suitable for both directed and undirected networks.

formula <- object ~ attribute_yz(mode = "local")

edges_x_match(mode = "global" | "local")

Description: Homophily on \(x\) — rewards edges between units with equal \(x\)-values.

\[ h_{i,j}(x, y, z) = \mathbb{I}(x_i = x_j)\, e_{i,j}^{(\mathtt{s})} \]

Suitable for both directed and undirected networks.

formula <- object ~ edges_x_match(mode = "global")

edges_y_match(mode = "global" | "local")

Description: Homophily on \(y\) — rewards edges between units with equal \(y\)-values.

\[ h_{i,j}(x, y, z) = \mathbb{I}(y_i = y_j)\, e_{i,j}^{(\mathtt{s})} \]

Suitable for both directed and undirected networks.

formula <- object ~ edges_y_match(mode = "global")

outedges_x(mode = "global" | "local" | "alocal")

Description: Effect of sender attribute \(x_i\) on out-degree formation.

\[ h_{i,j}(x, y, z) = x_i\, e_{i,j}^{(\mathtt{s})} \]

Only valid for directed networks.

formula <- object ~ outedges_x(mode = "global")

inedges_x(mode = "global" | "local" | "alocal")

Description: Effect of receiver attribute \(x_j\) on in-degree reception.

\[ h_{i,j}(x, y, z) = x_j\, e_{i,j}^{(\mathtt{s})} \]

Only valid for directed networks.

formula <- object ~ inedges_x(mode = "global")

outedges_y(mode = "global" | "local" | "alocal")

Description: Effect of sender attribute \(y_i\) on out-degree formation.

\[ h_{i,j}(x, y, z) = y_i\, e_{i,j}^{(\mathtt{s})} \]

Only valid for directed networks.

formula <- object ~ outedges_y(mode = "global")

inedges_y(mode = "global" | "local" | "alocal")

Description: Effect of receiver attribute \(y_j\) on in-degree reception.

\[ h_{i,j}(x, y, z) = y_j\, e_{i,j}^{(\mathtt{s})} \]

Only valid for directed networks.

formula <- object ~ inedges_y(mode = "global")

spillover_xx(mode = "local")

Description: Symmetric \(x\)-to-\(x\) spillover — the product \(x_i x_j\) along local connections, capturing peer effects in the \(x\) attribute.

\[ h_{i,j}(x, y, z) = x_i\, x_j\, u_{i,j} \]

Suitable for both directed and undirected networks.

formula <- object ~ spillover_xx(mode = "local")

spillover_xx_scaled(mode = "global" | "local")

Description: Degree-normalised \(x\)-to-\(x\) spillover, accounting for the number of neighbours.

\[ h_{i,j}(x, y, z) = \left(\frac{x_i\, x_j}{\operatorname{deg}(i,\mathtt{s})} + \frac{x_j\, x_i}{\operatorname{deg}(j,\mathtt{s})}\,\mathbb{I}_U(\mathbf{z})\right) e_{i,j}^{(\mathtt{s})} \]

Suitable for both directed and undirected networks.

formula <- object ~ spillover_xx_scaled(mode = "global")

spillover_yy(mode = "local")

Description: Symmetric \(y\)-to-\(y\) spillover — the product \(y_i y_j\) along local connections.

\[ h_{i,j}(x, y, z) = y_i\, y_j\, u_{i,j} \]

Suitable for both directed and undirected networks.

formula <- object ~ spillover_yy(mode = "local")

spillover_yy_scaled(mode = "global" | "local")

Description: Degree-normalised \(y\)-to-\(y\) spillover.

\[ h_{i,j}(x, y, z) = \left(\frac{y_i\, y_j}{\operatorname{deg}(i,\mathtt{s})} + \frac{y_j\, y_i}{\operatorname{deg}(j,\mathtt{s})}\,\mathbb{I}_U(\mathbf{z})\right) e_{i,j}^{(\mathtt{s})} \]

Suitable for both directed and undirected networks.

formula <- object ~ spillover_yy_scaled(mode = "global")

spillover_xy(mode = "local")

Description: Symmetric cross-attribute spillover — \(x_i \to y_j\) and \(x_j \to y_i\) along local connections. For undirected networks both directions are summed.

\[ h_{i,j}(x, y, z) = x_i\, y_j\, u_{i,j} + x_j\, y_i\, u_{i,j}\, \mathbb{I}_U(\mathbf{z}) \]

Suitable for both directed and undirected networks.

formula <- object ~ spillover_xy(mode = "local")

spillover_xy_scaled(mode = "global" | "local")

Description: Degree-normalised symmetric cross-attribute spillover (\(x \to y\)).

\[ h_{i,j}(x, y, z) = \left(\frac{x_i\, y_j}{\operatorname{deg}(i,\mathtt{s})} + \frac{x_j\, y_i}{\operatorname{deg}(j,\mathtt{s})}\,\mathbb{I}_U(\mathbf{z})\right) e_{i,j}^{(\mathtt{s})} \]

Suitable for both directed and undirected networks.

formula <- object ~ spillover_xy_scaled(mode = "global")

spillover_yx(mode = "local")

Description: Directed cross-attribute spillover — \(y_i \to x_j\) only (no symmetrisation). Only for directed networks.

\[ h_{i,j}(x, y, z) = y_i\, x_j\, u_{i,j} \]

Only valid for directed networks.

formula <- object ~ spillover_yx(mode = "local")

spillover_yx_scaled(mode = "global" | "local")

Description: Degree-normalised cross-attribute spillover (\(y \to x\)), with symmetrisation for undirected networks.

\[ h_{i,j}(x, y, z) = \left(\frac{y_i\, x_j}{\operatorname{deg}(i,\mathtt{s})} + \frac{y_j\, x_i}{\operatorname{deg}(j,\mathtt{s})}\,\mathbb{I}_U(\mathbf{z})\right) e_{i,j}^{(\mathtt{s})} \]

Suitable for both directed and undirected networks.

formula <- object ~ spillover_yx_scaled(mode = "global")

spillover_yc(mode = "local", data = v)

Description: Interaction of endogenous attribute \(y\) with exogenous covariate \(v\) along overlapping connections, with symmetrisation for undirected networks.

\[ h_{i,j}(x, y, z) = c_{i,j}\bigl(v_j\, y_i + \mathbb{I}_U(\mathbf{z})\, v_i\, y_j\bigr)\, z_{i,j} \]

Suitable for both directed and undirected networks.

formula <- object ~ spillover_yc(data = v, mode = "local")

Quick-Reference Table

The table below summarises all implemented terms, indicating which variables (\(x\), \(y\), \(z\)) they involve, and whether they support undirected networks.

Term \(x\) \(y\) \(z\) Undirected
attribute_x ✓ ✓
attribute_y ✓ ✓
cov_x ✓ ✓
cov_y ✓ ✓
attribute_xy(mode = "s") ✓ ✓ ✓
degrees ✓ ✓
edges(mode = "s") ✓ ✓
mutual(mode = "s") ✓ ✗
cov_z(mode = "s") ✓ ✓
cov_z_out(mode = "s") ✓ ✗
cov_z_in(mode = "s") ✓ ✗
isolates ✓ ✓
nonisolates ✓ ✓
gwdegree(mode = "global") ✓ ✓
gwodegree(mode = "s") ✓ ✗
gwidegree(mode = "s") ✓ ✗
transitive ✓ ✓
gwesp_symm(mode = "s") ✓ ✓
gwesp(mode = "s", type = "…") ✓ ✗
gwdsp_symm(mode = "local") ✓ ✓
gwdsp(mode = "s", type = "…") ✓ ✗
attribute_xz(mode = "local") ✓ ✓ ✓
attribute_yz(mode = "local") ✓ ✓ ✓
edges_x_match(mode = "s") ✓ ✓ ✓
edges_y_match(mode = "s") ✓ ✓ ✓
outedges_x(mode = "s") ✓ ✓ ✗
inedges_x(mode = "s") ✓ ✓ ✗
outedges_y(mode = "s") ✓ ✓ ✗
inedges_y(mode = "s") ✓ ✓ ✗
spillover_xx(mode = "local") ✓ ✓ ✓
spillover_xx_scaled(mode = "s") ✓ ✓ ✓
spillover_yy(mode = "local") ✓ ✓ ✓
spillover_yy_scaled(mode = "s") ✓ ✓ ✓
spillover_xy(mode = "local") ✓ ✓ ✓ ✓
spillover_xy_scaled(mode = "s") ✓ ✓ ✓ ✓
spillover_yx(mode = "local") ✓ ✓ ✓ ✗
spillover_yx_scaled(mode = "s") ✓ ✓ ✓ ✓
spillover_yc(mode = "local") ✓ ✓ ✓

References

Fritz, C., Schweinberger, M., Bhadra, S., and D.R. Hunter (2025). A Regression Framework for Studying Relationships among Attributes under Network Interference. Journal of the American Statistical Association, to appear. doi:10.1080/01621459.2025.2565851

Schweinberger, M. and M.S. Handcock (2015). Local Dependence in Random Graph Models: Characterization, Properties, and Statistical Inference. Journal of the Royal Statistical Society, Series B, 7, 647–676.

Schweinberger, M. and J.R. Stewart (2020). Concentration and Consistency Results for Canonical and Curved Exponential-Family Models of Random Graphs. The Annals of Statistics, 48, 374–396.